码迷,mamicode.com
首页 > Web开发 > 详细

SaltStack自动化部署Kubernetes v1.9.3版本----Dashboard

时间:2018-06-01 23:12:57      阅读:654      评论:0      收藏:0      [点我收藏+]

标签:docker   k8s   kubernetes   

[root@linux-node1 coredns]# pwd
/srv/addons/coredns

[root@linux-node1 srv]# cd addons/
[root@linux-node1 addons]# ls
coredns dashboard nginx-deployment.yaml nginx-service.yaml
[root@linux-node1 addons]# cd coredns/
[root@linux-node1 coredns]# ls
coredns.yaml
[root@linux-node1 coredns]# kubectl create -f .
serviceaccount "coredns" created
clusterrole "system:coredns" created
clusterrolebinding "system:coredns" created
configmap "coredns" created
deployment "coredns" created
service "coredns" created
[root@linux-node1 coredns]# kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-6ff7588dc6-jjgtq 0/1 ContainerCreating 0 12s
coredns-6ff7588dc6-tx8xd 0/1 ContainerCreating 0 12s
kubernetes-dashboard-545b66db97-c9wcc 1/1 Running 0 8h
[root@linux-node1 coredns]#
[root@linux-node1 coredns]# kubectl get service -n kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
coredns ClusterIP 10.1.0.2 <none> 53/UDP,53/TCP 52s
kubernetes-dashboard NodePort 10.1.20.150 <none> 443:20628/TCP 8h
[root@linux-node1 coredns]#

[root@linux-node1 coredns]# kubectl get pod -n kube-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE
coredns-6ff7588dc6-jjgtq 1/1 Running 0 33m 10.2.99.7 192.168.137.253
coredns-6ff7588dc6-tx8xd 1/1 Running 0 33m 10.2.48.7 192.168.137.251
kubernetes-dashboard-545b66db97-62c9k 1/1 Running 0 14s 10.2.48.8 192.168.137.251
[root@linux-node1 coredns]#

[root@linux-node1 coredns]# pwd
/srv/addons/coredns
[root@linux-node1 coredns]# cd ..
[root@linux-node1 addons]# ls
coredns dashboard nginx-deployment.yaml nginx-service.yaml
[root@linux-node1 addons]# cd dashboard/
[root@linux-node1 dashboard]# ls
admin-user-sa-rbac.yaml kubernetes-dashboard.yaml ui-admin-rbac.yaml ui-read-rbac.yaml
[root@linux-node1 dashboard]# kubectl create -f .

创建登录Token
[root@linux-node1 ~]# kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk ‘{print $1}‘)
Name: admin-user-token-2dwfx
Namespace: kube-system
Labels: <none>
Annotations: kubernetes.io/service-account.name=admin-user
kubernetes.io/service-account.uid=fc2863fe-6552-11e8-ae8b-000c2926e6d3

Type: kubernetes.io/service-account-token

Data

ca.crt: 1359 bytes
namespace: 11 bytes
token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTJkd2Z4Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJmYzI4NjNmZS02NTUyLTExZTgtYWU4Yi0wMDBjMjkyNmU2ZDMiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06YWRtaW4tdXNlciJ9.RRc4zPAwlk9tEJXKd6JsgW-wRZjIPSq0vFnTDVKb25ZlQKRqIl8lNMBNCFHamM9eJVSjnjd1h5HDgrdLKLWvGSkvXrNGDf_I-PVwFXNLXijOJGfuNe03L_kRsv_99ZEtWxN_hpgy1CdnEksF9G28TZg2rZBxPTxmvuQLPqEJvJFyd1GyV2CNQb_R-0RG5JaiXlbUbUNwmUQhdg_NmdZMpv0mwnShLldnhuYn_YK4nXBOkfYeQ60HtEIcoW7j7Llla-r02AhCKn0IUesoWtS8MDziSA7hQQKhP8Bb9Uvy0fLrr43593Nt7mx4ahmMbgesXghjFt1rE81G-Wwi65t2ww
[root@linux-node1 ~]# cd /srv

[root@linux-node1 coredns]# kubectl get pod -n kube-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE
coredns-6ff7588dc6-jjgtq 1/1 Running 0 33m 10.2.99.7 192.168.137.253
coredns-6ff7588dc6-tx8xd 1/1 Running 0 33m 10.2.48.7 192.168.137.251
kubernetes-dashboard-545b66db97-62c9k 1/1 Running 0 14s 10.2.48.8 192.168.137.251
[root@linux-node1 coredns]#
[root@linux-node1 coredns]# kubectl get service -n kube-system -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
coredns ClusterIP 10.1.0.2 <none> 53/UDP,53/TCP 33m k8s-app=coredns
kubernetes-dashboard NodePort 10.1.20.150 <none> 443:20628/TCP 9h k8s-app=kubernetes-dashboard

火狐浏览器打开
https://192.168.137.251:20628

1
技术分享图片

2
技术分享图片

3
技术分享图片

4
技术分享图片

openstack2015

SaltStack自动化部署Kubernetes v1.9.3版本----Dashboard

标签:docker   k8s   kubernetes   

原文地址:http://blog.51cto.com/andyliu/2123333

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!