本文主要是介绍k8s学习(二十八) k8s部署kuboard,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、获取kuboard.yaml
从网址https://kuboard.cn/install-script/kuboard.yaml下载
apiVersion: apps/v1
kind: Deployment
metadata:name: kuboardnamespace: kube-systemannotations:k8s.eip.work/displayName: kuboardk8s.eip.work/ingress: "true"k8s.eip.work/service: NodePortk8s.eip.work/workload: kuboardlabels:k8s.eip.work/layer: monitork8s.eip.work/name: kuboard
spec:replicas: 1selector:matchLabels:k8s.eip.work/layer: monitork8s.eip.work/name: kuboardtemplate:metadata:labels:k8s.eip.work/layer: monitork8s.eip.work/name: kuboardspec:containers:- name: kuboardimage: eipwork/kuboard:latestimagePullPolicy: Alwaystolerations:- key: node-role.kubernetes.io/mastereffect: NoSchedule---
apiVersion: v1
kind: Service
metadata:name: kuboardnamespace: kube-system
spec:type: NodePortports:- name: httpport: 80targetPort: 80nodePort: 32567selector:k8s.eip.work/layer: monitork8s.eip.work/name: kuboard---
apiVersion: v1
kind: ServiceAccount
metadata:name: kuboard-usernamespace: kube-system---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:name: kuboard-user
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: cluster-admin
subjects:
- kind: ServiceAccountname: kuboard-usernamespace: kube-system---
apiVersion: v1
kind: ServiceAccount
metadata:name: kuboard-viewernamespace: kube-system---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:name: kuboard-viewer
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: view
subjects:
- kind: ServiceAccountname: kuboard-viewernamespace: kube-system---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:name: kuboard-viewer-node
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: system:node
subjects:
- kind: ServiceAccountname: kuboard-viewernamespace: kube-system---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:name: kuboard-viewer-pvp
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: system:persistent-volume-provisioner
subjects:
- kind: ServiceAccountname: kuboard-viewernamespace: kube-system---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:name: kuboardnamespace: kube-systemannotations:nginx.org/websocket-services: "kuboard"nginx.com/sticky-cookie-services: "serviceName=kuboard srv_id expires=1h path=/"
spec:rules:- host: kuboard.yourdomain.comhttp:paths:- path: /backend:serviceName: kuboardservicePort: http
2、获取kuboard镜像
docker pull docker pull eipwork/kuboard
docker save -o kuboard.tar eipwork/kuboard
已经准备好在”用到的离线包”内
将离线包拷贝到master节点
docker load -i kuboard.tardocker tag eipwork/kuboard 192.168.100.94:80/kuboarddocker push 192.168.100.94:80/kuboard
3、 修改kuboard.yaml的镜像地址并配置启动
将eipwork/kuboard 修改为192.168.100.94:80/kuboard
将imagePullPolicy 需要改为IfNotPresent
kubectl apply -f kuboard.yaml
4、 访问
获取token
kubectl get secret
kubectl describe secret/cluster-admin-dashboard-sa-token-xsqj8
拷贝token
访问 http://[ip]:32567
输入token
这篇关于k8s学习(二十八) k8s部署kuboard的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!