创建一个2节点Kubernetes集群:
KUBERNETES_PROVIDER=aws NUM_NODES=2 kube-up.sh
这将输出显示为:
Found 2 node(s).
NAME STATUS AGE
ip-172-20-0-226.us-west-2.compute.internal Ready 57s
ip-172-20-0-227.us-west-2.compute.internal Ready 55s
Validate output:
NAME STATUS MESSAGE ERROR
controller-manager Healthy ok
scheduler Healthy ok
etcd-0 Healthy {"health": "true"}
etcd-1 Healthy {"health": "true"}
Cluster validation succeeded
Done, listing cluster services:
Kubernetes master is running at https://52.33.9.1
Elasticsearch is running at https://52.33.9.1/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging
Heapster is running at https://52.33.9.1/api/v1/proxy/namespaces/kube-system/services/heapster
Kibana is running at https://52.33.9.1/api/v1/proxy/namespaces/kube-system/services/kibana-logging
KubeDNS is running at https://52.33.9.1/api/v1/proxy/namespaces/kube-system/services/kube-dns
kubernetes-dashboard is running at https://52.33.9.1/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
Grafana is running at https://52.33.9.1/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana
InfluxDB is running at https://52.33.9.1/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb
我可以在EC2控制台中看到实例。如何进入主节点?
答案 0 :(得分:5)
这是对我有用的确切命令:
ssh -i ~/.ssh/kube_aws_rsa admin@<masterip>
kube_aws_rsa
是生成的默认密钥,否则由AWS_SSH_KEY
环境变量控制。对于AWS,它在文件cluster/aws/config-default.sh
中指定。
可以使用kubectl.sh config view
找到有关群集的更多详细信息。
答案 1 :(得分:0)
&#34;创建名为kubernetes-的AWS SSH密钥。这里的指纹是OpenSSH密钥指纹,因此多个用户可以使用不同的密钥运行脚本,并且它们的密钥不会发生冲突(几乎可靠)。如果在AWS_SSH_KEY中找到一个密钥,它将使用现有密钥,否则它将在那里创建一个密钥。 (使用默认的Ubuntu映像,如果你必须SSH:用户是ubuntu,那个用户可以sudo&#34;
https://github.com/kubernetes/kubernetes/blob/master/docs/design/aws_under_the_hood.md
你应该在ssh config中本地看到ssh key-fingerprint,或者设置ENV并重新创建。
答案 2 :(得分:0)
如果您要使用kops在AWS上建立集群,并使用CoreOS作为映像,则登录名将为“ core”。