Kubernetes Dashboard1.8.3部署

Kubernetes Dashboard1.8.3部署

  1. 說明
    下文中所需鏡像請點擊images自行下載使用!
  2. 安裝dashboard
    #下載yaml
    wget https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
    #查看yaml中image
    image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.3
  3. 安裝heapster
    #下載yaml
    wget https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/grafana.yaml
    wget https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/rbac/heapster-rbac.yaml
    wget https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/heapster.yaml
    wget https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/influxdb.yaml
    #修改yaml中image爲自己的
    #grafana.yaml
      - name: grafana
        image: k8s.gcr.io/heapster-grafana-amd64:v4.4.3
    #heapster.yaml
      - name: heapster
        image: k8s.gcr.io/heapster-amd64:v1.5.3
    #influxdb.yaml
      - name: influxdb
        image: k8s.gcr.io/heapster-influxdb-amd64:v1.3.3
  4. 修改kubernetes-dashboard.yaml
    將service type設置爲NodePort,修改後的yaml文件見yaml
  5. 部署dashboard
    #先cd到相應目錄下
    pwd
    /etc/kubernetes/manifests/my.conf
    #查看該目錄下文件
    ll
    grafana.yaml
    heapster-rbac.yaml
    heapster.yaml
    influxdb.yaml
    kubernetes-dashboard.yaml
    #部署service
    kubectl create -f ./
    #獲取dashboard的外網訪問端口:
    kubectl -n kube-system get svc kubernetes-dashboard
    NAME                   TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
    kubernetes-dashboard   NodePort   10.109.50.237   <none>        443:31173/TCP   1h
  6. 瀏覽器訪問dashboard登陸頁面
    如http://192.168.2.100:31173
    (使用http或https訪問),支持使用kubeconfig和token兩種的認證方式:
    Kubernetes Dashboard1.8.3部署
  7. 首次登入出現訪問權限報錯
    Kubernetes Dashboard1.8.3部署
    #解決方法
    ##vi kube-dashboard-access.yaml
    apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: ClusterRoleBinding
    metadata:
        name: kubernetes-dashboard
        labels:
            k8s-app: kubernetes-dashboard
    roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: cluster-admin
    subjects:
     - kind: ServiceAccount
        name: kubernetes-dashboard
        namespace: kube-system
    ##create
    kubectl create -f kube-dashboard-access.yaml
  8. 登陸界面
    Kubernetes Dashboard1.8.3部署
    Kubernetes Dashboard1.8.3部署
  9. 鏡像使用總結
    Master 和 Node 節點由於分工不一樣,所以安裝的服務不同,最終安裝完畢,Master 和 Node 啓動的核心服務分別如下:
Image Name Version swarm2(master) swarm1
k8s.gcr.io/kube-apiserver-amd64 v1.10.0 需要 不需要
k8s.gcr.io/kube-controller-manager-amd64 v1.10.0 需要 不需要
k8s.gcr.io/kube-scheduler-amd64 v1.10.0 需要 不需要
k8s.gcr.io/kube-proxy-amd64 v1.10.0 需要 需要
k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64 1.14.8 需要 不需要
k8s.gcr.io/k8s-dns-sidecar-amd64 1.14.8 需要 不需要
k8s.gcr.io/k8s-dns-kube-dns-amd64 1.14.8 需要 不需要
k8s.gcr.io/pause-amd64 3.1 需要 需要
quay.io/coreos/flannel v0.9.1 需要 需要
quay.io/calico/node v2.6.2 需要 不需要
quay.io/calico/cni v1.11.0 需要 不需要
k8s.gcr.io/etcd-amd64 3.1.12 需要 不需要
k8s.gcr.io/kubernetes-dashboard-amd64 v1.8.3 需要 需要
k8s.gcr.io/kubernetes-dashboard-init-amd64 v1.0.1 需要 需要
k8s.gcr.io/heapster-amd64 v1.5.3 需要 需要
k8s.gcr.io/heapster-influxdb-amd64 v1.3.3 需要 需要
k8s.gcr.io/heapster-grafana-amd64 v4.4.3 需要 需要
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章