k8s v1.5 web界面——kubernetes-dashboard续之v1.5

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

        本篇文章仅是根据k8s 大版本变迁,及对应dashboard升级的介绍,使用kubernetes-dashboard v1.5版本的,需要参考以下两篇文章:

        1、 Kubernetes 1.5版本之简单安装

        2、 k8s v1.2 web界面——kubernetes-dashboard详解

        以下部分,根据【 k8s v1.2 web界面——kubernetes-dashboard详解 】,修改变动部分,其他的依旧以原文章部分为准

--------------------------------------------------------------------------------------------------------

③、kubernetes dashboard镜像获取:

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

 #这里重新tag,并push到自己的镜像仓库了

docker tag e5133bac8024 www.perofu.com:7070/kubernetes-dashboard-amd64:v1.5.0 

docker push www.perofu.com:7070/kubernetes-dashboard-amd64:v1.5.0

 

④、kubernetes-dashboard相关资源的配置文件:

[root@www: kube-dashboard]#curl -O kubernetes-dashboard_1.5.0.yaml https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml

[1446][root@www: kube-dashboard]#cat kubernetes-dashboard_1.5.0.yaml

kind: Deployment

apiVersion: extensions/v1beta1

metadata:

  labels:

    app: kubernetes-dashboard

  name: kubernetes-dashboard

  namespace: kube-system

spec:

  replicas: 1

  revisionHistoryLimit: 10

  selector:

    matchLabels:

      app: kubernetes-dashboard

  template:

    metadata:

      labels:

        app: kubernetes-dashboard

      # Comment the following annotation if Dashboard must not be deployed on master

      annotations:

        scheduler.alpha.kubernetes.io/tolerations: |

          [

            {

              "key": "dedicated",

              "operator": "Equal",

              "value": "master",

              "effect": "NoSchedule"

            }

          ]

    spec:

      containers:

      - name: kubernetes-dashboard

        #image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.0

        image: www.perofu.com:7070/kubernetes-dashboard-amd64:v1.5.0

        imagePullPolicy: Always

        ports:

        - containerPort: 9090

          protocol: TCP

        args:

        livenessProbe:

          httpGet:

            path: /

            port: 9090

          initialDelaySeconds: 30

          timeoutSeconds: 30

---

kind: Service

apiVersion: v1

metadata:

  labels:

    app: kubernetes-dashboard

  name: kubernetes-dashboard

  namespace: kube-system

spec:

  type: NodePort

  ports:

  - port: 80

    targetPort: 9090

  selector:

    app: kubernetes-dashboard

⑤、创建kubernetes-dashboard相关资源:

[1396][root@www: kube-dashboard]# kubectl create -f kubernetes-dashboard_1.5.0.yaml                                                      

deployment "kubernetes-dashboard" created

service "kubernetes-dashboard" created

[1397][root@www: kube-dashboard]# kubectl get pods --all-namespaces

NAMESPACE     NAME                                   READY     STATUS    RESTARTS   AGE

kube-system   kubernetes-dashboard-728075524-s6gd0   0/1       Pending   0          2s

[1398][root@www: kube-dashboard]# kubectl get pods --all-namespaces

NAMESPACE     NAME                                   READY     STATUS    RESTARTS   AGE

kube-system   kubernetes-dashboard-728075524-s6gd0   1/1       Running   0          18s

⑥、访问kubernetes dashboard界面:

 

http://192.168.16.234:8080/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard/

k8s v1.5 web界面——kubernetes-dashboard续之v1.5_第1张图片

    kubernetes dashboard V1.5,相对改变了很多,

        ①、左侧的任务栏,多了k8s的资源对象

        ②、dashboard 部署应用的没有改变

      附上几张图片,剩下的,大家可以去探索一下!!!

k8s v1.5 web界面——kubernetes-dashboard续之v1.5_第2张图片

k8s v1.5 web界面——kubernetes-dashboard续之v1.5_第3张图片

k8s v1.5 web界面——kubernetes-dashboard续之v1.5_第4张图片

转载于:https://my.oschina.net/fufangchun/blog/854314

你可能感兴趣的:(运维,python,网络)