• kubernetes云平台管理实战:dashboard安装部署(十五)


    一、实验准备

    1、文件结构与组成

    [root@master dashboard]# ll
    total 8
    -rw-r--r-- 1 root root 1014 May 13 11:59 dashboard-deploy.yaml
    -rw-r--r-- 1 root root  274 May 13 11:43 dashboard-svc.yaml

    2、具体内容

    dashboard-deploy.yaml

    [root@master dashboard]# cat dashboard-deploy.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-latest
      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: 192.168.118.18:5000/kubernetes-dashboard-amd64:v1.4.1
            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://192.168.118.18:8080
            livenessProbe:
              httpGet:
                path: /
                port: 9090
              initialDelaySeconds: 30
              timeoutSeconds: 30

    dashboard-svc.yaml

    [root@master dashboard]# cat dashboard-svc.yaml 
    apiVersion: v1
    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

    镜像仓库                                  

    [root@master dashboard]# docker images
    REPOSITORY                                                         TAG                 IMAGE ID            CREATED             SIZE
    192.168.118.18:5000/kubernetes-dashboard-amd64                     v1.4.1              1dda73f463b2        3 years ago         86.8 MB

    二、操作演示过程

    安装部署

    [root@k8s-master dashboard]# kubectl create -f dashboard-deploy.yaml 
    deployment "kubernetes-dashboard-latest" created
    [root@k8s-master dashboard]# kubectl create -f dashboard-svc.yaml 
    service “kubernetes-dashboard” created
    

    检查

    [root@k8s-master dashboard]# kubectl get pod --namespace=kube-system 
    NAME                                           READY     STATUS    RESTARTS   AGE
    kube-dns-453684471-gxhwn                       4/4       Running   16         23h
    kubernetes-dashboard-latest-1012954252-8gvcp   1/1       Running   0          4m

    三、测试访问

    访问dashboard

     效果演示

     
  • 相关阅读:
    ES6新特性
    CSS + HTML 鼠标在图片上悬停时的显示文字,移走时文字消失
    APICloud closeToWin和closeWin的使用
    基于vue-cli配置移动端自适应
    Cookies,localStorage,sessionStorage,Web SQL Database(客户端)会话存储学习
    select标签默认选择选项
    MySQL数据库的配置
    jsp定义 ,JSON对象
    eclipse配置
    VS2017 C++编译时出现 "the windows sdk version for 8.1 was not found"解决办法(亲测有效)
  • 原文地址:https://www.cnblogs.com/luoahong/p/12936203.html
Copyright © 2020-2023  润新知