Stay organized with collections
Save and categorize content based on your preferences.
Name
kf env - Print information about an App's environment variables.
Synopsis
kf env APP_NAME [flags]
Description
The env command gets the names and values of developer managed
environment variables for an App.
Environment variables are evaluated in the following order with later values
overriding earlier ones with the same name:
Space (set by administrators)
App (set by developers)
System (set by Kf)
Environment variables containing variable substitution "$(...)" are
replaced at runtime by Kubernetes.
Kf provides the following runtime environment variables:
CF_INSTANCE_ADDR: The cluster-visible IP:PORT of the App instance.
CF_INSTANCE_GUID: The UUID of the App instance.
INSTANCE_GUID: Alias of CF_INSTANCE_GUID
CF_INSTANCE_INDEX: The index number of the App instance, this will ALWAYS be 0.
INSTANCE_INDEX: Alias of CF_INSTANCE_INDEX
CF_INSTANCE_IP: The cluster-visible IP of the App instance.
CF_INSTANCE_INTERNAL_IP: Alias of CF_INSTANCE_IP
VCAP_APP_HOST: Alias of CF_INSTANCE_IP
CF_INSTANCE_PORT: The cluster-visible port of the App instance. In Kf this is the same as PORT.
DATABASE_URL: The first URI found in a VCAP_SERVICES credential.
DISK_LIMIT: The maximum amount of disk storage in MB the App can use.
LANG: Required by buildpacks to ensure consistent script load order.
MEMORY_LIMIT: The maximum amount of memory in MB the App can consume.
PORT: The port the App should listen on for requests.
VCAP_APP_PORT: Alias of PORT
VCAP_APPLICATION: A JSON structure containing app metadata.
VCAP_SERVICES: A JSON structure specifying bound services.
Examples
kf env myapp
Flags
-h, --help
help for env
Inherited flags
These flags are inherited from parent commands.
--as=string
Username to impersonate for the operation.
--as-group=strings
Group to impersonate for the operation. Include this flag multiple times to specify multiple groups.
--config=string
Path to the Kf config file to use for CLI requests.
--kubeconfig=string
Path to the kubeconfig file to use for CLI requests.
--log-http
Log HTTP requests to standard error.
--space=string
Space to run the command against. This flag overrides the currently targeted Space.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# kf env\n\n### Name\n\n`kf env` - Print information about an App's environment variables.\n\n### Synopsis\n\n```\nkf env APP_NAME [flags]\n```\n\n### Description\n\nThe env command gets the names and values of developer managed\nenvironment variables for an App.\n\nEnvironment variables are evaluated in the following order with later values\noverriding earlier ones with the same name:\n\n1. Space (set by administrators)\n2. App (set by developers)\n3. System (set by Kf) Environment variables containing variable substitution \"$(...)\" are replaced at runtime by Kubernetes. Kf provides the following runtime environment variables:\n\n- CF_INSTANCE_ADDR: The cluster-visible IP:PORT of the App instance.\n- CF_INSTANCE_GUID: The UUID of the App instance.\n- INSTANCE_GUID: Alias of CF_INSTANCE_GUID\n- CF_INSTANCE_INDEX: The index number of the App instance, this will ALWAYS be 0.\n- INSTANCE_INDEX: Alias of CF_INSTANCE_INDEX\n- CF_INSTANCE_IP: The cluster-visible IP of the App instance.\n- CF_INSTANCE_INTERNAL_IP: Alias of CF_INSTANCE_IP\n- VCAP_APP_HOST: Alias of CF_INSTANCE_IP\n- CF_INSTANCE_PORT: The cluster-visible port of the App instance. In Kf this is the same as PORT.\n- DATABASE_URL: The first URI found in a VCAP_SERVICES credential.\n- DISK_LIMIT: The maximum amount of disk storage in MB the App can use.\n- LANG: Required by buildpacks to ensure consistent script load order.\n- MEMORY_LIMIT: The maximum amount of memory in MB the App can consume.\n- PORT: The port the App should listen on for requests.\n- VCAP_APP_PORT: Alias of PORT\n- VCAP_APPLICATION: A JSON structure containing app metadata.\n- VCAP_SERVICES: A JSON structure specifying bound services.\n\n### Examples\n\n```\n kf env myapp\n```\n\n### Flags\n\n`-h, --help`\n: help for env\n\n### Inherited flags\n\nThese flags are inherited from parent commands.\n\n`--as=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Username to impersonate for the operation.\n\n`--as-group=`\u003cvar translate=\"no\"\u003estrings\u003c/var\u003e\n: Group to impersonate for the operation. Include this flag multiple times to specify multiple groups.\n\n`--config=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Path to the Kf config file to use for CLI requests.\n\n`--kubeconfig=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Path to the kubeconfig file to use for CLI requests.\n\n`--log-http`\n: Log HTTP requests to standard error.\n\n`--space=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Space to run the command against. This flag overrides the currently targeted Space."]]