安装kubernetes dashboard

一.kubernetes dashboard

kubernetes dashboard是k8s的web管理界面

二.安装

k8s的版本为1.5

1.创建dashboard-controller.yaml

[[email protected] dashboard]# cat dashboard-controller.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
# Keep the name in sync with image version and
# gce/coreos/kube-manifests/addons/dashboard counterparts
  name: kubernetes-dashboard-latest
  namespace: kube-system
spec:
  replicas: 1
  template:
    metadata:
      labels:
        k8s-app: kubernetes-dashboard
        version: latest
        kubernetes.io/cluster-service: "true"
    spec:
      containers:
      - name: kubernetes-dashboard
        image: bestwu/kubernetes-dashboard-amd64:v1.6.3
        resources:
          # keep request = limit to keep this container in guaranteed class
          limits:
            cpu: 100m
            memory: 50Mi
          requests:
            cpu: 100m
            memory: 50Mi
        ports:
        - containerPort: 9090
        args:
         -  --apiserver-host=http://192.168.2.17:8080
        livenessProbe:
          httpGet:
            path: /
            port: 9090
          initialDelaySeconds: 30
          timeoutSeconds: 30

  

ps:
上文中的--apiserver-host,这是master的地址

应用该配置文件:

#kubectl apply -f dashboard-controller.yaml

  

2.创建dashboard-service.yaml

[[email protected] dashboard]# cat dashboard-service.yaml
kind: Service
metadata:
  name: kubernetes-dashboard
  namespace: kube-system
  labels:
    k8s-app: kubernetes-dashboard
    kubernetes.io/cluster-service: "true"
spec:
  selector:
    k8s-app: kubernetes-dashboard
  ports:
  - port: 80
    targetPort: 9090

应用该配置文件:

#kubectl apply -f dashboard-service.yaml

  

3.查看创建状况:

[[email protected] dashboard]# kubectl get pods -n=kube-system
NAME                                           READY     STATUS    RESTARTS   AGE
kubernetes-dashboard-3708984300-cx0cz          1/1       Running   0          5h

[[email protected] dashboard]# kubectl get svc -n=kube-system
NAME                   CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
kubernetes-dashboard   10.254.46.214   <none>        80/TCP          25m

  

三.外部访问(请参见ingress)

1.创建kubernetes-dashboard-ingress.yaml

[[email protected] ingress]# cat kubernetes-dashboard-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dashboard-ui-ingress
  namespace: kube-system
spec:
  rules:
  - host: ui.k8.ingress
    http:
      paths:
      - path: /
        backend:
          serviceName: kubernetes-dashboard
          servicePort: 80

  

ps

注意namespace,并不是默认值

应用配置文件

#kubectl apply -f kubernetes-dashboard-ingress.yaml

  

2.查看ingress

[[email protected] dashboard]# kubectl get ingress -n=kube-system
NAME                   HOSTS           ADDRESS        PORTS     AGE
dashboard-ui-ingress   ui.k8.ingress   192.168.2.26   80        19m

  

3.做hosts

192.168.2.26 ui.k8.ingress

4.访问http://ui.k8.ingress, 应该能看到k8s的web管理界面

原文地址:https://www.cnblogs.com/itfenqing/p/10127226.html

时间: 2024-10-12 04:11:15

安装kubernetes dashboard的相关文章

利用kubernetes 安装 Kubernetes Dashboard

最近再次学习下k8s,版本已经升级到1.17了,准备部署一下,以下是官方地址 https://github.com/kubernetes/dashboard 接着往下面看 kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc2/aio/deploy/recommended.yaml [[email protected] ~]# kubectl get pods --all-namespa

开启和安装Kubernetes k8s 基于Docker For Windows

0.最近发现,Docker For Windows Stable在Enable Kubernetes这个问题上是有Bug的,建议切换到Edge版本,并且采用下文AliyunContainerService来解决中国区网络问题. 1.为Docker For Windows配置加速镜像服务. { "registry-mirrors": [ "https://registry.docker-cn.com" ], "insecure-registries"

kubernetes dashboard 安装

1.下载  dashboard.yaml文件 我安装的k8s版本为1.5.2,从github下载相近的dashaboard版本 wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.5.0/src/deploy/kubernetes-dashboard.yaml 2.编辑kubernetes-dashboard.yaml 由于yaml文件中的image使用的是谷歌gcr.io,被墙无法下载,因此,需将文件中image 用do

Kubernetes Dashboard的安装与配置

Kubernetes Dashboard的安装与配置 一 背景 通过kubeadm快速完成了kubernetes的安装,即可迅速地体验到kubernetes的强大功能.美中不足的是,只能通过命令来查看或操作,没有一个直观且简洁的Web UI来感受一下这种成功的喜悦.此外,国内的网络环境,也在某种程度上增加了一些门槛.面对如此种种,依然有办法体验kunernetes dashboard. 二 操作步骤 因为不清楚Pod会被调度到哪一个Node上,所以在每一个节点上执行以下脚本: #!/bin/ba

kubernetes 1.14安装部署dashboard

简单介绍: Dashboard是一个基于web的Kubernetes用户界面.您可以使用Dashboard将容器化应用程序部署到Kubernetes集群,对容器化应用程序进行故障诊断,并管理集群资源.可以使用Dashboard来获得运行在集群上的应用程序的概观,以及创建或修改单个Kubernetes资源(如Deployments, Jobs, DaemonSets等).例如,您可以扩展deployment.启动滚动更新.重启pod或使用deploy向导部署新应用程序. 官网:https://ku

[k8s]kubernetes dashboard的安装

之前一直使用的是命令行,但是又觉得如果连控制台都还没有动手实践过会不会有点low 1.安装dashboard 参阅官网的安装方法,https://github.com/kubernetes/dashboard,安装很简单,如果慢可以使用其它的镜像网站,我这里使用的是mirrorgooglecontainers/kubernetes-dashboard-amd64,然后重新打了k8s.gcr.io/kubernetes-dashboard-amd64的tag 2.暴露服务 [email prote

Kubernetes Dashboard 安装与认证

1.安装dashboard $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml(images地址记得改掉,因为墙,你懂得) 1.2, 配置ingress 映像域名xxx.dashboard.qing.cn(必须是https) 2 .创建admin token #cat dashboard-

Kubernetes Dashboard的安装与坑

1.前言 https://github.com/kubernetes/dashboard/releases kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml Kubernetes Dashboard is a general purpose, web-based UI for Kuberne

Kubernetes dashboard安装

1. To download Dashboard plugin deployment YAML file from internet. #cd /home #mkdir k8s #cd k8s # wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml  ##官方链接https://kubernetes.io/docs/