【发布时间】:2018-03-01 03:23:46
【问题描述】:
我用过这样的命令:
sshpass -p password ssh root@x.x.x.x 'date;kubectl get pod;date'
我明白了:
Wed Sep 20 14:39:19 CST 2017
Unable to connect to the server: EOF
Wed Sep 20 14:39:20 CST 2017
如何解决这个问题?
所有 kubectl 命令在目标系统上运行良好。 命令:
sshpass -p password ssh root@x.x.x.x 'kubectl'
也很好用:
mynode /etc » sshpass -p password ssh -o StrictHostKeyChecking=no root@x.x.x.x "kubectl"
kubectl controls the Kubernetes cluster manager.
Find more information at https://github.com/kubernetes/kubernetes.
Basic Commands (Beginner):
create Create a resource by filename or stdin
expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service
run Run a particular image on the cluster
set Set specific features on objects
Basic Commands (Intermediate):
get Display one or many resources
explain Documentation of resources
edit Edit a resource on the server
delete Delete resources by filenames, stdin, resources and names, or by resources and label selector
...
【问题讨论】:
-
看你可以通过k8s配置文件并测试一下。
kubectl --kubeconfig=path to kube config -
对不起,我没明白你的意思,我忘了提供一些重要信息。请看上面的问题。
标签: ssh kubernetes kubectl sshpass