Centos7 配置kubernetes dashboard

操作环境

操作环境同 《 Centos7 下Kubernetes集群安装部署》,注意要将flannel网络配置好,否则会出问题。

操作步骤

1.在2个节点上手动下载kubernetes dashboard image

[root@k8s-node2 ~]# 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文件如下:

[root@k8s-master 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

[root@k8s-master yaml]# kubectl create -f kubernetes-dashboard.yaml
4.访问kuberne-dashboard,http://10.10.200.224:8080/ui


相关文章
相关标签/搜索