美文网首页
Kubernetes Web UI

Kubernetes Web UI

作者: HaythamXu | 来源:发表于2020-04-13 17:49 被阅读0次

    指路牌

    • Kubernetes

    环境

    • Mac
    • Docker Desktop(with Kubernetes)

    参考资料

    kubernetes.io
    github-kubernetes/dashboard

    步骤

    获取Kubernetes Dashboard UI

    kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
    

    最新命令参考官网

    创建账号

    • 创建文件dashboard-adminuser.yaml,写入
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: admin-user
      namespace: kubernetes-dashboard
    
    • 创建文件dashboard-clusterrolebinding.yaml, 写入
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: admin-user
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: cluster-admin
    subjects:
    - kind: ServiceAccount
      name: admin-user
      namespace: kubernetes-dashboard
    
    • 执行
    kubectl apply -f dashboard-adminuser.yaml 
    kubectl apply -f dashboard-clusterrolebinding.yaml
    
    • 获取token
    Name:         admin-user-token-v57nw
    Namespace:    kubernetes-dashboard
    Labels:       <none>
    Annotations:  kubernetes.io/service-account.name: admin-user
                  kubernetes.io/service-account.uid: 0303243c-4040-4a58-8a47-849ee9ba79c1
    
    Type:  kubernetes.io/service-account-token
    
    Data
    ====
    ca.crt:     1066 bytes
    namespace:  20 bytes
    token:      !! HERE IS TOKEN !!
    

    获取后最好单独保存一下
    最新步骤参考官网

    启动

    • 启动
    kubectl proxy
    

    后记

    流程不是很复杂, 但是官方把流程分别写在了两个不同的地方,此处仅整理简化,文档随时会更新,请以官方为准,2020-04-13

    我的博客即将同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=31w7xws35pa8w

    相关文章

      网友评论

          本文标题:Kubernetes Web UI

          本文链接:https://www.haomeiwen.com/subject/epunmhtx.html