前提
安装 Kuboard 时,假设您已经有一个 Kubernetes 集群,以下任何形式安装的集群都可以:
1、kubeadm 安装(或者基于 kubeadm 的衍生工具,如 Sealos 等);
2、二进制安装;
3、阿里云、腾讯云等公有云托管集群;
4、其他。
安装
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
#输出如下:
deployment.apps/kuboard created
service/kuboard created
serviceaccount/kuboard-user created
clusterrolebinding.rbac.authorization.k8s.io/kuboard-user created
serviceaccount/kuboard-viewer created
clusterrolebinding.rbac.authorization.k8s.io/kuboard-viewer created
查看 Kuboard 运行状态:
kubectl get pods -l k8s.kuboard.cn/name=kuboard -n kube-system
#输出如下:
[root@host161 ~]# kubectl get pods -l k8s.kuboard.cn/name=kuboard -n kube-system
NAME READY STATUS RESTARTS AGE
kuboard-74c645f5df-5rfps 1/1 Running 0 9m54s
获取 Token
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep kuboard-user | awk '{print $1}')
#输出如下:
Name: kuboard-user-token-k769h
Namespace: kube-system
Labels: <none>
Annotations: kubernetes.io/service-account.name: kuboard-user
kubernetes.io/service-account.uid: 7bf17216-b6e4-466a-bcb3-b63ac7ccbfb8
Type: kubernetes.io/service-account-token
Data
====
ca.crt: 1066 bytes
namespace: 11 bytes
token: eyJhbGciOiJSUzI1NiIsImtpZCI6InM3dUwtRHFYMXhfaFlmbjBJRk1JOEhlQlRSNlViZVloSDc0ZmxlRU1uSW8ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJvYXJkLXVzZXItdG9rZW4tazc2OWgiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoia3Vib2FyZC11c2VyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiN2JmMTcyMTYtYjZlNC00NjZhLWJjYjMtYjYzYWM3Y2NiZmI4Iiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmt1Ym9hcmQtdXNlciJ9.cdGOA751UIdp8tL5eF9kiVIIe_E9d-eSRQAyO8xXOuH0kPnOva1Ud5GY--8UXh39Gguv7TV04IEonPORZNNjB4XFCg5yZj1HfvZC4KeAupX8gh6yWIhE2DsPTMI1inOQkJkt7KnSoojZdj9HrGEGFDMgn-C0D_5DVUIVdDQF_eI45CxmEFt0GsBRK_0MbOL17SzUceqiHktlyq10-tMo-oW9QMgqQTOcOy1_pymXqkOU01JKfGsMpYBVYMsF-Go4Hwzr3oZ71FymcaTqiWIfwMy_zWvVT2KDCUvLPFC5iLfohs6ckBY8jGjy-VdRzSEBb7MMtIyfHW76zVCc67VsrQ
如上 Token 拥有 ClusterAdmin 的权限,可以执行所有操作。
登录 Kuboard
1、访问地址
Kuboard Service 使用了 NodePort 的方式暴露服务,NodePort 为 32567;您可以按如下方式访问 Kuboard。
http://master或任意Worker节点的IP地址:32567/
2、输入前面获取到的token登录kuboard
创建第一个服务