拉取kubernets-dashboard镜像

docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/kubernetes-dashboard-amd64:v1.6.0

修改成本地镜像

docker tag registry.cn-hangzhou.aliyuncs.com/google-containers/kubernetes-dashboard-amd64:v1.6.0 192.168.1.20:5000/kubernetes-dashboard-amd64:v1.6.0

删除远程镜像

docker rmi registry.cn-hangzhou.aliyuncs.com/google-containers/kubernetes-dashboard-amd64:v1.6.0

dashboard.yaml安装文件内容如下

kind: ReplicationController
apiVersion: v1
metadata:
  labels:
    app: kubernetes-dashboard
  name: kubernetes-dashboard  
  namespace:  kube-system
spec:
  replicas: 1
  selector:
      app: kubernetes-dashboard
  template:
    metadata:
      labels:
        app: kubernetes-dashboard
    spec:
      containers:
      - name: kubernetes-dashboard
        image:  docker.uat.prg.com:5000/kub-dashboard:latest
        #lanny/gcr.io_google_containers_kubernetes-dashboard-amd64:v1.8.1
        #docker.uat.prg.com:5000/kub-dashboard:latest
        ports:
        - containerPort: 9090
        args:
        - --apiserver-host=http://192.168.1.40:8080
        - --heapster-host=http://192.168.1.25:30002
---
kind: Service
apiVersion: v1
metadata:
  labels:
    app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  type: NodePort
  ports:
  - port: 7960
    targetPort: 9090
    nodePort: 30000
  selector:
    app: kubernetes-dashboard

安装命令

kubectl create -f dashboard.yaml

查看pods

kubectl get pods --namespace=kube-system

查看pod明细

kubectl describe service/kubernetes-dashboard --namespace="kube-system"

查看pod日志

kubectl logs kubernetes-dashboard-latest-139424868-tdc0t --namespace=kube-system 

 

posted on 2019-09-25 11:11  遥-ZHZ  阅读(250)  评论(0编辑  收藏  举报