1. 程式人生 > >Centos7 配置kubernetes dashboard

Centos7 配置kubernetes dashboard

操作環境

操作步驟

1.在2個節點上手動下載kubernetes dashboard image
[[email protected] ~]# docker pull  docker.io/mritd/kubernetes-dashboard-amd64
Using default tag: latest
Trying to pull repository docker.io/mritd/kubernetes-dashboard-amd64 ... 
latest: Pulling from docker.io/mritd/kubernetes-dashboard-amd64
Digest: sha256:377d905c758d08674fd434e567fbfb4411f64a52090d0de7f64fd70b72b2fbeb
2.在k8s-master節點上編輯kubernetes-dashboard.yaml檔案如下:
[[email protected] yaml]# vi kubernetes-dashboard.yaml 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
# Keep the name in sync with image version and
# gce/coreos/kube-manifests/addons/dashboard counterparts
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  replicas: 1
  template:
    metadata:
      labels:
        k8s-app: kubernetes-dashboard
        version: latest
        kubernetes.io/cluster-service: "true"
    spec:
      containers:
      - name: kubernetes-dashboard
        image: docker.io/mritd/kubernetes-dashboard-amd64
        resources:
          # keep request = limit to keep this container in guaranteed class
          limits:
            cpu: 100m
            memory: 50Mi
          requests:
            cpu: 100m
            memory: 50Mi
        ports:
        - containerPort: 9090
        args:
         - --apiserver-host=http://10.10.200.224:8080
        livenessProbe:
          httpGet:
            path: /
            port: 9090
          initialDelaySeconds: 30
          timeoutSeconds: 30
---
kind: Service
metadata:
  name: kubernetes-dashboard
  namespace: kube-system
  labels:
    k8s-app: kubernetes-dashboard
    kubernetes.io/cluster-service: "true"
spec:
  selector:
    k8s-app: kubernetes-dashboard
  ports:
  - port: 80
    targetPort: 9090
3.啟動kubernetes-dashboard
[[email protected] yaml]# kubectl create -f kubernetes-dashboard.yaml
4.訪問kuberne-dashboard,http://10.10.200.224:8080/ui