[root@cicd kubernetes]# ls bash ca harbor-offline-installer-v1.4.0.tgz image.tar.gz kube-yunwei-197.tar.gz sock-shop bin ca.tar.gz image k8s197.tar.gz scope.yaml
2)创建weave名称空间
[root@cicd kubernetes]# kubectl create namespace weave
[root@cicd kubernetes]# kubectl get pod -n weave NAME READY STATUS RESTARTS AGE weave-scope-agent-4xw7b 1/1 Running 0 2h weave-scope-agent-cll6f 1/1 Running 0 2h weave-scope-agent-nfl8c 1/1 Running 0 2h weave-scope-app-5969c9bc78-fmm4s 1/1 Running 0 2h [root@cicd kubernetes]# kubectl get svc -n weave NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE weave-scope-app NodePort 10.68.210.240 <none> 80:33274/TCP 2h
注意port端口号,用来浏览器访问。
上图:左边框为atach按钮,右边框为exec按钮。一个是继续进程,一个是重开终端。
[root@cicd kubernetes]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 415b685b8ace 1acb4fd5df5b "/bin/sh" 4 days ago Up 4 days keen_noyce 22c236dd2666 1acb4fd5df5b "/bin/sh" 4 days ago Up 4 days eloquent_bhabha [root@cicd kubernetes]# docker exec -it 415b685b8ace /bin/sh
[root@cicd kubernetes]# docker exec -it 415b685b8ace /bin/sh / # cd /etc/ansible//etc/ansible # ls 01.prepare.yml 03.docker.yml 05.kube-node.yml 99.clean.yml bin hosts roles 02.etcd.yml 04.kube-master.yml 06.network.yml ansible.cfg example manifests tools /etc/ansible # cd manifests/ /etc/ansible/manifests # ls coredns dashboard efk heapster ingress kubedns /etc/ansible/manifests # cd heapster/ /etc/ansible/manifests/heapster # ls grafana.yaml heapster.yaml influxdb-v1.1.1 influxdb-with-pv influxdb.yaml /etc/ansible/manifests/heapster # kubectl apply -f .
/etc/ansible/manifests/heapster # kubectl get pod -n kube-system -o wide NAME READY STATUS RESTARTS AGE IP NODE calico-kube-controllers-754c88ccc8-fm9kn 1/1 Running 0 4d 192.168.253.11 192.168.253.11 calico-node-62wzk 2/2 Running 0 4d 192.168.253.14 192.168.253.14 calico-node-lszzj 2/2 Running 6 4d 192.168.253.10 192.168.253.10 calico-node-nvtwd 2/2 Running 0 4d 192.168.253.11 192.168.253.11 coredns-6ff7588dc6-62nnv 1/1 Running 0 9h 172.20.104.44 192.168.253.11 coredns-6ff7588dc6-f6d4z 1/1 Running 147 4d 172.20.104.1 192.168.253.11 heapster-7f8bf9bc46-l8qv5 1/1 Running 0 3h 172.20.104.60 192.168.253.11 kubernetes-dashboard-545b66db97-mmt6p 1/1 Running 0 9h 172.20.104.43 192.168.253.11 monitoring-grafana-64747d765f-rb59j 1/1 Running 0 3h 172.20.135.23 192.168.253.10 monitoring-influxdb-565ff5f9b6-m99z8 1/1 Running 0 3h 172.20.135.21 192.168.253.10
/etc/ansible/manifests/heapster # kubectl get svc -n kube-system -o wide NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR coredns ClusterIP 10.68.0.2 <none> 53/UDP,53/TCP 4d k8s-app=coredns heapster ClusterIP 10.68.198.107 <none> 80/TCP 3h k8s-app=heapster kubernetes-dashboard NodePort 10.68.6.114 <none> 443:37107/TCP 4d k8s-app=kubernetes-dashboard monitoring-grafana ClusterIP 10.68.59.90 <none> 80/TCP 3h k8s-app=grafana monitoring-influxdb ClusterIP 10.68.11.36 <none> 8086/TCP 3h k8s-app=influxdb
/etc/ansible/manifests/heapster # kubectl cluster-info Kubernetes master is running at https://192.168.253.14:6443 CoreDNS is running at https://192.168.253.14:6443/api/v1/namespaces/kube-system/services/coredns:dns/proxy kubernetes-dashboard is running at https://192.168.253.14:6443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy monitoring-grafana is running at https://192.168.253.14:6443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
并打开浏览器访问。
原文:https://www.cnblogs.com/zzzynx/p/11079041.html