189 8069 5689

kubernetes怎么安装部署Dashboard-创新互联

kubernetes怎么安装部署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

[root@test-nodes1 ~]# 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          4h5m
traefik-ingress-vrvr4                   1/1     Running   0          4h5m

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

[root@test-nodes1 ~]# 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      3h54m

kubernetes怎么安装部署Dashboard

看完这篇文章,你们学会kubernetes安装部署Dashboard的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注创新互联网站建设公司行业资讯频道,感谢各位的阅读!

另外有需要云服务器可以了解下创新互联建站www.cdcxhl.com,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享文章:kubernetes怎么安装部署Dashboard-创新互联
标题路径:http://cdxtjz.com/article/dcpphp.html

其他资讯