kube-ui安裝

NO IMAGE

kube-ui安裝

kube-ui是k8s提供的web管理介面,可以展示節點的記憶體、CPU、磁碟、Pod、RC、SVC等資訊。

1.編輯kube-dashboard-rc.yml定義檔案
[[email protected] pods]# cat kubernetes-dashboard-rc.yml

複製程式碼

1 kind: ReplicationController
2 apiVersion: v1
3 metadata:
4   labels:
5     app: kubernetes-dashboard
6   name: kubernetes-dashboard
7   namespace: kube-system
8 spec:
9   replicas: 1
10   selector:
11       app: kubernetes-dashboard
12   template:
13     metadata:
14       labels:
15         app: kubernetes-dashboard
16     spec:
17       containers:
18       - name: kubernetes-dashboard
19         image: docker.gaoxiaobang.com/kubernetes/kube-ui:v5
20         imagePullPolicy: Always
21         ports:
22         - containerPort: 8080
23         livenessProbe:  
24           httpGet:  
25             path: /  
26             port: 8080  
27           initialDelaySeconds: 30  
28           timeoutSeconds: 5

複製程式碼

 

建立pod

kubectl create -f kubernetes-dashboard-rc.yml

複製程式碼

1 kind: Service
2 apiVersion: v1
3 metadata:
4   labels:
5     app: kubernetes-dashboard
6   name: kubernetes-dashboard
7   namespace: kube-system
8 spec:
9   type: NodePort
10   ports:
11   - port: 80
12     targetPort: 8080
13   selector:
14     app: kubernetes-dashboard

複製程式碼

 

建立service

kubectl create -f kubernetes-dashboard-svc.yml

 

 

訪問master ip 10.64.8.68:8080/ui / 不出問題會直接跳轉到http://10.64.8.68:8080/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard/#/dashboard/  頁面