日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

安装Kubernetes-Dashboard插件

發布時間:2025/6/15 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 安装Kubernetes-Dashboard插件 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

為什么80%的碼農都做不了架構師?>>> ??

關于如何搭建基于docker的Kubernetes環境,請看筆者另一片博客: https://my.oschina.net/u/3559870/blog/1031428

插件說明

完成使用Kubeadm搭建Kubernetes(docker)之后,Kubernetes實際已經搭建成功~但是頻繁操作命令行界面是會崩潰的好嗎!!所以在Kubernetes 1.2版本后新增了Kube Dashboard,我們就可以在瀏覽器愉快的通過點 點 點操作啦。 ##功能說明 ## create:上傳json或者yaml的方式新建resource,同kubectl create -f delete:刪除副本(Replication Controllers) modify:修改副本數(replicas) query:查詢相關信息,同kubectl get 通過web-ui+上述功能,我們就能基本脫離命令行界面了!

安裝步驟

此時已經完成kubernetes的搭建。 我們將dashboard以靜態Pod的方式運行在Master Node上。

cd /etc/kubernetes/manifests

此目錄是已有的靜態Pod的yaml文件,我們創建kubernetes-dashboard.yaml文件

# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.# Configuration to deploy release version of the Dashboard UI compatible with # Kubernetes 1.6 (RBAC enabled). # # Example usage: kubectl create -f <this_file>apiVersion: v1 kind: ServiceAccount metadata:labels:app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata:name: kubernetes-dashboardlabels:app: kubernetes-dashboard roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: cluster-admin subjects: - kind: ServiceAccountname: kubernetes-dashboardnamespace: kube-system --- kind: Deployment apiVersion: extensions/v1beta1 metadata:labels:app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kube-system spec:replicas: 1revisionHistoryLimit: 10selector:matchLabels:app: kubernetes-dashboardtemplate:metadata:labels:app: kubernetes-dashboardspec:containers:- name: kubernetes-dashboardimage: registry.cn-beijing.aliyuncs.com/bbt_k8s/kubernetes-dashboard-amd64:v1.6.0imagePullPolicy: Alwaysports:- containerPort: 9090protocol: TCPargs:# Uncomment the following line to manually specify Kubernetes API server Host# If not specified, Dashboard will attempt to auto discover the API server and connect# to it. Uncomment only if the default does not work.# - --apiserver-host=http://my-address:portlivenessProbe:httpGet:path: /port: 9090initialDelaySeconds: 30timeoutSeconds: 30serviceAccountName: kubernetes-dashboard# Comment the following tolerations if Dashboard must not be deployed on mastertolerations:- key: node-role.kubernetes.io/mastereffect: NoSchedule --- kind: Service apiVersion: v1 metadata:labels:app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kube-system spec:type: NodePortports:- port: 80targetPort: 9090selector:app: kubernetes-dashboard

創建文件kubernetes-dashboard-rbac.yaml文件

kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 metadata:name: dashboard-admin roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: cluster-admin subjects: - kind: ServiceAccountname: defaultnamespace: kube-system

創建dashboard、dashboard-rbac resource

kubectl create -f kubernetes-dashboard-rbac.yml kubectl create -f kubernetes-dashboard.yaml

創建成功結果如下所示

[root@kube-master manifests]# kubectl create -f dashboard-rbac.yaml clusterrolebinding "dashboard-admin" created [root@kube-master manifests]# kubectl create -f dashboard.yaml serviceaccount "kubernetes-dashboard" created clusterrolebinding "kubernetes-dashboard" created deployment "kubernetes-dashboard" created service "kubernetes-dashboard" created

查詢dashboard運行的端口

kubectl describe --namespace kube-system service kubernetes-dashboard [root@kube-master manifests]# kubectl describe --namespace kube-system service kubernetes-dashboard Name: kubernetes-dashboard Namespace: kube-system Labels: app=kubernetes-dashboard Annotations: <none> Selector: app=kubernetes-dashboard Type: NodePort IP: 10.110.236.54 Port: <unset> 80/TCP NodePort: <unset> 30989/TCP Endpoints: 10.244.0.16:9090 Session Affinity: None Events: <none>

NodePort就是我們要訪問的端口啦!快快打開瀏覽器輸入{master-ip}:{node-port}吧!

轉載于:https://my.oschina.net/zili/blog/1031430

總結

以上是生活随笔為你收集整理的安装Kubernetes-Dashboard插件的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。