K8S 之 Dashboard安装

一、Dashboard安装

#在运维主机上运行
k8s-yaml]# docker pull k8scn/kubernetes-dashboard-amd64:v1.8.3
k8s-yaml]# docker images|grep dashboard
k8s-yaml]# docker tag fcac9aa03fd6 harbor.od.com/public/dashboard:v1.8.3
k8s-yaml]# docker push test-harbor.cedarhd.com/public/dashboard:v1.8.3
k8s-yaml]# mkdir dashboard
k8s-yaml]# cd dashboard/

#创建四个yaml文件
dashboard]# vi rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    k8s-app: kubernetes-dashboard
    addonmanager.kubernetes.io/mode: Reconcile
  name: kubernetes-dashboard-admin
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kubernetes-dashboard-admin
  namespace: kube-system
  labels:
    k8s-app: kubernetes-dashboard
    addonmanager.kubernetes.io/mode: Reconcile
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: kubernetes-dashboard-admin
  namespace: kube-system

-------------------------------------------------------------------------------------

dashboard]# vi dp.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubernetes-dashboard
  namespace: kube-system
  labels:
    k8s-app: kubernetes-dashboard
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: Reconcile
spec:
  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.yaml
apiVersion: v1
kind: Service
metadata:
  name: kubernetes-dashboard
  namespace: kube-system
  labels:
    k8s-app: kubernetes-dashboard
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: Reconcile
spec:
  selector:
    k8s-app: kubernetes-dashboard
  ports:
  - port: 443
    targetPort: 8443

    -------------------------------------------------------------------------------------

dashboard]vi ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: kubernetes-dashboard
  namespace: kube-system
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - host: dashboard.od.com
    http:
      paths:
      - backend:
          serviceName: kubernetes-dashboard
          servicePort: 443
-------------------------------------------------------------------------------------

#在其中一台运算节点运行
~]# 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

[[email protected] ~]# kubectl get pods -n kube-system
NAME                                    READY   STATUS    RESTARTS   AGE
coredns-6c69fbcc6c-6vqgr                1/1     Running   0          21h
kubernetes-dashboard-5d6f5f9cdd-plsjq   1/1     Running   0          20m
traefik-ingress-44ptk                   1/1     Running   0          4h4m
traefik-ingress-vrvr4                   1/1     Running   0          4h4m

[[email protected] ~]# kubectl get svc -n kube-system
NAME                      TYPE        CLUSTER-IP        EXTERNAL-IP   PORT(S)                  AGE
coredns                   ClusterIP   192.168.0.2       <none>        53/UDP,53/TCP,9153/TCP   21h
kubernetes-dashboard      ClusterIP   192.168.177.146   <none>        443/TCP                  20m
traefik-ingress-service   ClusterIP   192.168.254.186   <none>        80/TCP,8080/TCP          4h4m

[[email protected] ~]# kubectl get ingress -n kube-system
NAME                   HOSTS                        ADDRESS   PORTS   AGE
kubernetes-dashboard   test-dashboard.cedarhd.com             80      20m
traefik-web-ui         test-traefik.cedarhd.com               80      3h44m

原文地址:https://blog.51cto.com/12965094/2469340

时间: 2024-10-10 06:42:10

K8S 之 Dashboard安装的相关文章

K8s+dashboard安装部署 不错

系统安装使用虚拟机安装两个centos系统,在/etc/hosts里增加两行192.168.140.128 kuber-master192.168.140.129 kuber-node1 关闭防火墙systemctl stop firewalld & systemctl disable firewalld 关闭selinuxsed -i ‘s/enforcing/disabled/’ /etc/selinux/configsetenforce 0 关闭swapswapoff -a #临时关闭vi

[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.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

[k8s]kube-dns/dashboard排错历险记(含sa加载用法/集群搭建)

kube-dns原理 参考: 组件架构看这个就够了 http://cizixs.com/2017/04/11/kubernetes-intro-kube-dns 设置细节看这个就够了 http://blog.fleeto.us/translation/configuring-private-dns-zones-and-upstream-nameservers-kubernetes busybox你的忠实实验伴侣 命令看这里: https://kubernetes.io/docs/concepts

kubernetes+docker+dashboard安装部署详细步骤

对docker和kubernetes都不熟悉,搜了很多指导,在kubernetes集群中安装dashboard的时候总是会遇到各种问题,花了两天时间试了很多方法,终于安装成功,主体步骤来自https://blog.csdn.net/chenyufeng1991/article/details/79251498,补全安装过程中遇到的问题及解决方法. 实验环境: 1.OS:Centos7.5 每个操作系统设置一个主机IP 2.使用的软件包 master:docker/kubernetes-maste

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-

k8s之Dashboard部署及使用

前面章节 Kubernetes 所有的操作我们都是通过命令行工具 kubectl 完成的.为了提供更丰富的用户体验,Kubernetes 还开发了一个基于 Web 的 Dashboard,用户可以用 Kubernetes Dashboard 部署容器化的应用.监控应用的状态.执行故障排查任务以及管理 Kubernetes 各种资源. 在 Kubernetes Dashboard 中可以查看集群中应用的运行状态,也能够创建和修改各种 Kubernetes 资源,比如 Deployment.Job.

推荐K8s的一键安装和一键升级

centos7 deploy_Kubernetes-v1.15.1 后续脚本更新统一由kkitDeploy项目持续更新相应脚本 请移步至kkitDeploy项目 https://github.com/luckman666/kkitdeploy_server ########################################################################## k8s 1.15.2一键部署地址: https://github.com/luckman66

openstack-mikata之dashboard安装部署(仅在controller配置)

1.在controller主机安装相关软件包 2.配置/etc/openstack-dashboard/local_settings 1)设置openstack主机名 允许所有主机访问仪表板 配置 memcached 会话存储服务 启用第3版认证API 启用对域的支持 配置API版本 通过仪表盘创建用户时的默认域配置为default 通过仪表盘创建的用户默认角色配置为user 禁用支持3层网络服务 设置时区 3.重启Apache.缓存服务,并检查状态是否正常 4.验证是否成功登录http://c