Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Nom
kf ssh : ouvre une interface système sur une instance d'application
Synopsis
kf ssh APP_NAME [flags]
Description
Ouvre une interface système sur une instance d'application à l'aide du point de terminaison d'exécution du pod.
Cette commande imite la commande SSH de Cloud Foundry en ouvrant une connexion au plan de contrôle Kubernetes qui génère un processus dans un pod.
La commande se connecte à un pod arbitraire qui correspond aux libellés de l'environnement d'exécution de l'application. Si vous souhaitez définir un pod spécifique, utilisez la notation pod/.
REMARQUE : Le trafic est chiffré entre la CLI et le plan de contrôle, ainsi qu'entre le plan de contrôle et le pod. Un plan de contrôle Kubernetes malveillant peut observer le trafic.
Exemples
# 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
Options
-c, --command=stringArray
Commande à exécuter pour l'interface système. Les définitions suivantes seront utilisées comme arguments. (par défaut [/bin/bash])
--container=string
Conteneur dans lequel lancer la commande. (par défaut, "user-container")
-T, --disable-pseudo-tty
N'utilisez pas de TTY lors de l'exécution.
-h, --help
aide de la commande ssh
Options héritées
Ces options sont héritées des commandes parentes.
--as=string
Nom d'utilisateur à emprunter pour l'opération.
--as-group=strings
Identité de groupe à emprunter pour l'opération. Incluez cette option plusieurs fois pour spécifier plusieurs groupes.
--config=string
Chemin d'accès au fichier de configuration Kf à utiliser pour les requêtes CLI.
--kubeconfig=string
Chemin d'accès au fichier kubeconfig à utiliser pour les requêtes CLI.
--log-http
Envoyez les requêtes HTTP vers la sortie d'erreur standard.
--space=string
Espace dans lequel exécuter la commande. Cette option remplace l'espace actuellement ciblé.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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."]]