Stay organized with collections
Save and categorize content based on your preferences.
Name
kf ssh - Open a shell on an App instance
Synopsis
kf ssh APP_NAME [flags]
Description
Opens a shell on an App instance using the Pod exec endpoint.
This command mimics CF's SSH command by opening a connection to the Kubernetes master which spawns a process in a Pod.
The command connects to an arbitrary Pod that matches the App's runtime labels. If you want a specific Pod, use the pod/ notation.
NOTE: Traffic is encrypted between the CLI and the master, and the master and the Pod, however a malicious Kubernetes master could observe the traffic.
Examples
# Open a shell to a specific App
kf ssh myapp
# Open a shell to a specific Pod
kf ssh pod/myapp-revhex-podhex
# Start a different command with args
kf ssh myapp -c /my/command -c arg1 -c arg2
Flags
-c, --command=stringArray
Command to run for the shell. Subsequent definitions will be used as args. (default [/bin/bash])
--container=string
Container to start the command in. (default "user-container")
-T, --disable-pseudo-tty
Don't use a TTY when executing.
-h, --help
help for ssh
Inherited flags
These flags are inherited from parent commands.
--config=string
Config file (default is $HOME/.kf)
--kubeconfig=string
Kubectl config file (default is $HOME/.kube/config)
--log-http
Log HTTP requests to stderr
--space=string
Space to run the command against. This 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-09-04 UTC."],[],[],null,["# kf ssh\n\n### Name\n\n`kf ssh` - Open a shell on an App instance\n\n### Synopsis\n\n```\nkf ssh APP_NAME [flags]\n```\n\n### Description\n\nOpens a shell on an App instance using the Pod exec endpoint.\n\nThis command mimics CF's SSH command by opening a connection to the Kubernetes master which spawns a process in a Pod.\n\nThe command connects to an arbitrary Pod that matches the App's runtime labels. If you want a specific Pod, use the pod/ notation.\n\nNOTE: Traffic is encrypted between the CLI and the master, and the master and the Pod, however a malicious Kubernetes master could observe the traffic.\n\n### Examples\n\n```\n # Open a shell to a specific App\n kf ssh myapp\n \n # Open a shell to a specific Pod\n kf ssh pod/myapp-revhex-podhex\n \n # Start a different command with args\n kf ssh myapp -c /my/command -c arg1 -c arg2\n```\n\n### Flags\n\n`-c, --command=`\u003cvar translate=\"no\"\u003estringArray\u003c/var\u003e\n: Command to run for the shell. Subsequent definitions will be used as args. (default \\[/bin/bash\\])\n\n`--container=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Container to start the command in. (default \"user-container\")\n\n`-T, --disable-pseudo-tty`\n: Don't use a TTY when executing.\n\n`-h, --help`\n: help for ssh\n\n### Inherited flags\n\nThese flags are inherited from parent commands.\n\n`--config=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Config file (default is $HOME/.kf)\n\n`--kubeconfig=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Kubectl config file (default is $HOME/.kube/config)\n\n`--log-http`\n: Log HTTP requests to stderr\n\n`--space=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n: Space to run the command against. This overrides the currently targeted space"]]