Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Name
kf ssh – Shell auf einer Anwendungsinstanz öffnen.
Zusammenfassung
kf ssh APP_NAME [flags]
Beschreibung
Öffnet eine Shell auf einer Anwendungsinstanz mit dem Pod-Exec-Endpunkt.
Dieser Befehl imitiert den SSH-Befehl von CF, indem er eine Verbindung zur Kubernetes-Steuerungsebene herstellt, wodurch ein Prozess in einem Pod ausgelöst wird.
Mit dem Befehl wird eine Verbindung zu einem beliebigen Pod hergestellt, der mit den Laufzeitlabels der Anwendung übereinstimmt. Wenn Sie einen bestimmten Pod suchen möchten, verwenden Sie die Annotation pod/.
HINWEIS: Traffic ist zwischen Befehlszeile und Steuerungsebene sowie zwischen Steuerungsebene und Pod verschlüsselt. Eine schädliche Kubernetes-Steuerungsebene kann Traffic beobachten.
Beispiele
# 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
Befehl, der für die Shell ausgeführt werden soll. Nachfolgende Definitionen werden als Argumente verwendet (Standard [/bin/bash])
--container=string
Container, in dem der Befehl gestartet werden soll. (Standard „user-container“)
-T, --disable-pseudo-tty
Bei der Ausführung kein TTY-Gerät verwenden.
-h, --help
Hilfe zu „ssh“
Übernommene Flags
Diese Flags werden von übergeordneten Befehlen übernommen.
--as=string
Nutzername, dessen Identität für den Vorgang übernommen wird.
--as-group=strings
Gruppe, deren Identität für den Vorgang übernommen wird. Verwenden Sie dieses Flag mehrfach, um mehrere Gruppen anzugeben.
--config=string
Pfad zur Kf-Konfigurationsdatei, die für Befehlszeile-Anfragen verwendet werden soll.
--kubeconfig=string
Pfad zur Datei „kubeconfig“ zur Verwendung für CLI-Anfragen.
--log-http
HTTP-Anfragen im Standardfehler loggen.
--space=string
Bereich zum Ausführen des Befehls. Dieses Flag überschreibt den aktuellen Ziel-Space.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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."]]