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
kubernetes-dashboard-rc.yml
创建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
kubernetes-dashboard-svc.yml
创建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/ 页面
时间: 2024-11-09 09:26:32