Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy dashboard in kubernetes

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Kubernetes how to deploy dashboard, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Applicable scenarios: linux system, kubernetes1.4 or above, no authentication such as CA. Other scenarios are for reference only.

Dashboard is mainly used to view the resource status information of K8s cluster! It can also be used for the integration of monitoring

To configure dashboard, you need two yaml files, Deployment and service, or you can write the contents of these two files together in one file and separate them in the middle.

Here are the details of the file:

Dashboard-deployment.yaml file contents kind: DeploymentapiVersion: extensions/v1beta1metadata: labels: app: kubernetes-dashboard version: v1.1.1 name: kubernetes-dashboard namespace: kube-systemspec: replicas: 1 selector: matchLabels: app: kubernetes-dashboard template: metadata: labels: app: kubernetes-dashboard spec: containers:-name: kubernetes-dashboard image: registry.cn-hangzhou.aliyuncs.com/sjq-k8s/ Kube-dashboard-amd64:v1.4.0 imagePullPolicy: Always ports:-containerPort: 9090 protocol: TCP args: # 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://192.168.122.10:8080 # # Please modify it to your own kebu-apiserver livenessProbe: httpGet: path: / port: 9090 initialDelaySeconds: 30 timeoutSeconds: 30

To prevent image download errors, I have replaced the image with my Aliyun image, which can be downloaded directly.

Be sure to change one of the-apiserver-host to the apiserver of your K8s cluster

Contents of dashboard-svc.yaml file kind: ServiceapiVersion: v1metadata: labels: app: kubernetes-dashboard name: kubernetes-dashboard namespace: kube-systemspec: type: NodePort ports:-port: 80 targetPort: 9090 selector: app: kubernetes-dashboard start deployment and service in turn

(take the merged files on my git as an example.)

Kubectl create-f kube-dashboard.yaml to check whether it is running status kubectl get pods-n kube-system runs successfully, you can go to the page to view information verification

Typing http://localhost:8080/ui/ in the browser will automatically jump to http://localhost:8080/api/v1/proxy/namespaces/kube-system/services/kube-ui/#/dashboard/ OK!

The actual construction process diagram:

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report