kuboard安装

kuboard安装

这里需要先安装完成kubernetes,如果没有的话,请查看这篇文章kubernetes v1.19.0安装
参考文档:kuboard安装配置

兼容性

kubernetes版本kuboard版本兼容性说明
v1.19v2.0.x兼容已验证
v1.18v1.0.x、v2.0.x兼容已验证
v1.17v1.0.x、v2.0.x兼容已验证
v1.16v1.0.x、v2.0.x兼容已验证
v1.15v1.0.x、v2.0.x兼容已验证
v1.14v1.0.x、v2.0.x兼容已验证
v1.13v1.0.x、v2.0.x兼容已验证
v1.12v1.0.x、v2.0.x不兼容Kubernetes Api v1.12 不支持 dryRun,Kuboard 不支持 Kubernetes v1.12
v1.11v1.0.x、v2.0.x不兼容Kubernetes Api v1.12 不支持 dryRun,Kuboard 不支持 Kubernetes v1.12

在线安装

kubectl apply -f https://kuboard.cn/install-script/kuboard.yaml
kubectl apply -f https://addons.kuboard.cn/metrics-server/0.3.7/metrics-server.yaml

查看 Kuboard 运行状态:

kubectl get pods -l k8s.eip.work/name=kuboard -n kube-system
---------------------------------------------------------------------
NAME                       READY   STATUS        RESTARTS   AGE
kuboard-54c9c4f6cb-6lf88   1/1     Running       0          45s
------------------------------------------------------------------------

获取管理员token

master 节点上执行此命令
echo $(kubectl -n kube-system get secret $(kubectl -n kube-system get secret | grep kuboard-user | awk '{print $1}') -o go-template='{{.data.token}}' | base64 -d)
 ----------------------------------------------------------------------
 eyJhbGciOiJSUzI1NiIsImtpZCI6IjRWZ3dzQWYzZkxpUldVQ3J2VnZRdWlmb0RIVW1lUDhsUFNsQjNkTUk4eDAifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2udC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJvYXJkLXVzZXItdG9rZW4tdGponZpY2UtYWNjb3VudC5uYW1lIjoia3Vib2FyZC11c2VyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiMjQ3MDgzNjic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmt1Ym9hcmQtdXNlciJ9.lPZfLHv1om3RZaJdtBMzYQbfPxIbKuDW6rB8_23YuRTKGtTWSogZZf3MP6BEn-GXAgbJ6a6PXhFkLyVr_rB1q8cAvYcOvmxgRD6ha87_Wt5WztyWBBPWzWoxddOu8JI0Zce8PDSaf2bKHQYdkZTD6ZkVPanQJzlaJu5D2Wf7DSSN4C0ysvRlTicVgMJf3Hqx-BuK76Y2xAsNRj87Kl2ZP-WqgYszacRIpToFrzAvGrbiLnZ03G3Q

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

只读用户token

echo $(kubectl -n kube-system get secret $(kubectl -n kube-system get secret | grep kuboard-viewer | awk '{print $1}') -o go-template='{{.data.token}}' | base64 -d)

离线安装kuboard

  1. 在可以上网的机器上抓取kuboard镜像
docker pull eipwork/kuboard:latest
docker images | grep kuboard
// 86eaead8421e 为上面一个命令查到的imageID
docker save 86eaead8421e > kuboard.tar

之后将kuboard.tar传输到kubernetes集群某一节点上
2. 在 Kubernetes 集群的某一个节点上执行

docker load < kuboard.tar
docker tag 86eaead8421e eipwork/kuboard:latest
  1. 准备kuboard.yaml文件
    注意需要修改两个地方:ImagePullPolicy=IfNotPresent 和 nodeName: your-node-name
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kuboard
  namespace: kube-system
  annotations:
    k8s.eip.work/displayName: kuboard
    k8s.eip.work/ingress: "false"
    k8s.eip.work/service: NodePort
    k8s.eip.work/workload: kuboard
  labels:
    k8s.eip.work/layer: monitor
    k8s.eip.work/name: kuboard
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s.eip.work/layer: monitor
      k8s.eip.work/name: kuboard
  template:
    metadata:
      labels:
        k8s.eip.work/layer: monitor
        k8s.eip.work/name: kuboard
    spec:
      nodeName: your-node-name		#这里需要修改为安装kuboard的主机名
      containers:
      - name: kuboard
        image: eipwork/kuboard:latest
        imagePullPolicy: IfNotPresent	#修改为本地有镜像不从远端拉取
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule

---
apiVersion: v1
kind: Service
metadata:
  name: kuboard
  namespace: kube-system
spec:
  type: NodePort
  ports:
  - name: http
    port: 80
    targetPort: 80
    nodePort: 32567
  selector:
    k8s.eip.work/layer: monitor
    k8s.eip.work/name: kuboard

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: kuboard-user
  namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kuboard-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: kuboard-user
  namespace: kube-system

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: kuboard-viewer
  namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kuboard-viewer
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: view
subjects:
- kind: ServiceAccount
  name: kuboard-viewer
  namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kuboard-viewer:kuboard-minimum-role
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: kuboard-minimum-role
subjects:
  - kind: ServiceAccount
    name: kuboard-viewer
    namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kuboard-minimum-role
rules:
  - apiGroups:
    - ''
    resources:
    - 'namespaces'
    - 'nodes'
    verbs:
    - 'list'

执行命令

kubectl apply -f kuboard-offline.yaml

访问kuboard

http://节点ip:32567/
将上面的token输入浏览器之后如下:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值