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

Dashboard installation of K8S

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

Share

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

I. Dashboard installation # run k8s-yaml] # docker pull k8scn/kubernetes-dashboard-amd64:v1.8.3k8s-yaml] # docker images | grep dashboardk8s-yaml] # docker tag fcac9aa03fd6 harbor.od.com/public/dashboard:v1.8.3k8s-yaml] # docker push test-harbor.cedarhd.com/public/dashboard:v1.8.3k8s-yaml] # mkdir dashboardk8s-yaml] # cd dashboard/# create four yaml files dashboard] # vi rbac.yamlapiVersion: v1kind: ServiceAccountmetadata: labels: K8s-app: kubernetes-dashboard addonmanager.kubernetes.io/mode: Reconcile name: kubernetes-dashboard-admin namespace: kube-system---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: kubernetes-dashboard-admin namespace: kube-system labels: k8s-app: kubernetes-dashboard addonmanager.kubernetes.io/mode: ReconcileroleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-adminsubjects:- kind: ServiceAccount name: kubernetes-dashboard-admin namespace: kube-system-- -dashboard] # vi dp.yamlapiVersion: apps/v1kind: Deploymentmetadata: name: kubernetes-dashboard namespace: kube-system labels: k8s-app: kubernetes-dashboard Kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcilespec: selector: matchLabels: k8s-app: kubernetes-dashboard template: metadata: labels: k8s-app: kubernetes-dashboard annotations: scheduler.alpha.kubernetes.io/critical-pod:''spec: priorityClassName: system-cluster-critical containers:-name: kubernetes-dashboard image: test- Harbor.cedarhd.com/public/dashboard:v1.8.3 resources: limits: cpu: 100m memory: 300Mi requests: cpu: 50m memory: 100Mi ports:-containerPort: 8443 protocol: TCP args: # PLATFORM-SPECIFIC ARGS HERE-auto-generate-certificates VolumeMounts:-name: tmp-volume mountPath: / tmp livenessProbe: httpGet: scheme: HTTPS path: / port: 8443 initialDelaySeconds: 30 timeoutSeconds: 30 volumes:-name: tmp-volume emptyDir: {} serviceAccountName: kubernetes-dashboard-admin tolerations:-key: "CriticalAddonsOnly" Operator: "Exists"-dashboard] # vi svc.yamlapiVersion: v1kind: Servicemetadata: name: kubernetes-dashboard namespace: kube-system labels: K8s-app: kubernetes-dashboard kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcilespec: selector: k8s-app: kubernetes-dashboard ports:-port: 443targetPort: 8443-- -dashboard] vi ingress.yamlapiVersion: extensions/v1beta1kind: Ingressmetadata: name: kubernetes-dashboard namespace: kube-system annotations: kubernetes.io/ingress.class: traefikspec: rules:-host: dashboard.od.com http: paths:-backend: serviceName: kubernetes-dashboard servicePort: 443- -# run on one of the computing nodes ~] # kubectl apply-f http://k8s-yaml.cedarhd.com/dashboard/rbac.yaml~]# kubectl apply-f http://k8s-yaml.cedarhd .com / dashboard/dp.yaml~] # kubectl apply-f http://k8s-yaml.cedarhd.com/dashboard/svc.yaml~]# kubectl apply-f http://k8s-yaml.cedarhd.com/dashboard/ingress.yaml[root@test-nodes1 ~] # kubectl get pods-n kube-systemNAME READY STATUS RESTARTS AGEcoredns-6c69fbcc6c-6vqgr 1 Running 0 21hkubernetes- Dashboard-5d6f5f9cdd-plsjq 1 to 1 Running 0 20mtraefik-ingress-44ptk 1 to 1 Running 0 4h5mtraefik-ingress-vrvr4 1 to 1 Running 0 4h5m [root@test-nodes1] # kubectl get svc-n kube-systemNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEcoredns ClusterIP 192.168.0.2 53/UDP 53/TCP,9153/TCP 21hkubernetes-dashboard ClusterIP 192.168.177.146 443/TCP 20mtraefik-ingress-service ClusterIP 192.168.254.186 80/TCP 8080/TCP 4h5m [root@test-nodes1 ~] # kubectl get ingress-n kube-systemNAME HOSTS ADDRESS PORTS AGEkubernetes-dashboard test-dashboard.cedarhd.com 80 20mtraefik-web-ui test-traefik.cedarhd.com 80 3h54m

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