Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Nome
kf ssh: apri una shell in un'istanza dell'app.
Synopsis
kf ssh APP_NAME [flags]
Descrizione
Apre una shell in un'istanza di app utilizzando l'endpoint Pod exec.
Questo comando imita il comando SSH di Cloud Foundry aprendo una connessione al piano di controllo Kubernetes che genera un processo in un pod.
Il comando si connette a un pod arbitrario che corrisponde alle etichette di runtime dell'app. Se vuoi un pod specifico, utilizza la notazione pod/ .
NOTA: il traffico viene criptato tra la CLI e il piano di controllo e tra il piano di controllo e il pod. Un piano di controllo Kubernetes malintenzionato potrebbe osservare il traffico.
Esempi
# 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
Flag
-c, --command=stringArray
Comando da eseguire per la shell. Le definizioni successive verranno utilizzate come args. (valore predefinito [/bin/bash])
--container=string
Container in cui avviare il comando. (valore predefinito "user-container")
-T, --disable-pseudo-tty
Non utilizzare un dispositivo TTY durante l'esecuzione.
-h, --help
Guida per ssh
Flag ereditati
Questi flag vengono ereditati dai comandi principali.
--as=string
Nome utente da rubare per l'operazione.
--as-group=strings
Gruppo da simulare per l'operazione. Includi questo flag più volte per specificare più gruppi.
--config=string
Percorso del file di configurazione Kf da utilizzare per le richieste dell'interfaccia a riga di comando.
--kubeconfig=string
Percorso del file kubeconfig da utilizzare per le richieste della CLI.
--log-http
Registra le richieste HTTP nell'errore standard.
--space=string
Spazio in cui eseguire il comando. Questo flag sostituisce lo spazio attualmente scelto come target.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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\nKubernetes control plane which spawns a process in a Pod.\n\nThe command connects to an arbitrary Pod that matches the App's runtime\nlabels. If you want a specific Pod, use the pod/ notation.\n\nNOTE: Traffic is encrypted between the CLI and the control plane, and\nbetween the control plane and Pod. A malicious Kubernetes control plane\ncould observe the traffic.\n\n### Examples\n\n```\n# Open a shell to a specific App\nkf ssh myapp\n\n# Open a shell to a specific Pod\nkf ssh pod/myapp-revhex-podhex\n\n# Start a different command with args\nkf 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\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\n: Container to start the command in. (default \"user-container\")\n\n`-T, --disable-pseudo-tty`\n\n: Don't use a TTY when executing.\n\n`-h, --help`\n\n: help for ssh\n\n### Inherited flags\n\nThese flags are inherited from parent commands.\n\n`--as=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Username to impersonate for the operation.\n\n`--as-group=`\u003cvar translate=\"no\"\u003estrings\u003c/var\u003e\n\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\n: Path to the Kf config file to use for CLI requests.\n\n`--kubeconfig=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Path to the kubeconfig file to use for CLI requests.\n\n`--log-http`\n\n: Log HTTP requests to standard error.\n\n`--space=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Space to run the command against. This flag overrides the currently targeted Space."]]