转载请注明出处
相关链接
- K8S单机部署-00.旧版本卸载
- K8S单机部署-01.单机部署K8S
- K8S单机部署-02.Kuboard面板部署
- K8S单机部署-03.验证K8S的第一个Deployment
- K8S单机部署-04.NFS服务器搭建
- K8S单机部署-05.静态持久化之PV、PVC(基于NFS)
- K8S单机部署-06.动态持久化StorageClass(基于NFS)
- K8S单机部署-07.调整nodePort端口范围
- K8S单机部署-08.安装ingress-nginx-controller
- K8S单机部署-10.增加自定义域名解析
- K8S单机部署-11.安装Kubernetes Metrics Server监控
官网地址
https://www.kuboard.cn/
https://www.kuboard.cn/install/v3/install-built-in.html#%E5%AE%89%E8%A3%85
安装脚本
sudo docker run -d \
--restart=unless-stopped \
--name=kuboard \
-p 80:80/tcp \
-p 8081:10081/tcp \
-e KUBOARD_ENDPOINT="http://192.168.21.223:80" \
-e KUBOARD_AGENT_SERVER_TCP_PORT="8081" \
-v /kuboard-data:/data \
eipwork/kuboard:v3.5.2.6
# 也可以使用镜像 swr.cn-east-2.myhuaweicloud.com/kuboard/kuboard:v3 ,可以更快地完成镜像下载。
# 请不要使用 127.0.0.1 或者 localhost 作为内网 IP \
# Kuboard 不需要和 K8S 在同一个网段,Kuboard Agent 甚至可以通过代理访问 Kuboard Server \
访问页面
浏览器输入 http://192.168.21.223:80/
默认用户admin
默认密码Kuboard123
添加K8S集群
登录完成后按照提示执行以下命令获取token, 然后回填到页面即可
[root@master k8s-init-file]# cat << EOF > kuboard-create-token.yaml
> ---
> apiVersion: v1
> kind: Namespace
> metadata:
> name: kuboard
>
> ---
> apiVersion: v1
> kind: ServiceAccount
> metadata:
> name: kuboard-admin
> namespace: kuboard
>
> ---
> apiVersion: rbac.authorization.k8s.io/v1
> kind: ClusterRoleBinding
> metadata:
> name: kuboard-admin-crb
> roleRef:
> apiGroup: rbac.authorization.k8s.io
> kind: ClusterRole
> name: cluster-admin
> subjects:
> - kind: ServiceAccount
> name: kuboard-admin
> namespace: kuboard
>
> ---
> apiVersion: v1
> kind: Secret
> type: kubernetes.io/service-account-token
> metadata:
> annotations:
> kubernetes.io/service-account.name: kuboard-admin
> name: kuboard-admin-token
> namespace: kuboard
> EOF
[root@master k8s-init-file]#
[root@master k8s-init-file]# kubectl apply -f kuboard-create-token.yaml
namespace/kuboard unchanged
serviceaccount/kuboard-admin unchanged
clusterrolebinding.rbac.authorization.k8s.io/kuboard-admin-crb unchanged
secret/kuboard-admin-token unchanged
[root@master k8s-init-file]# echo -e "\033[1;34m将下面这一行红色输出结果填入到 kuboard 界面的 Token 字段:\033[0m"
将下面这一行红色输出结果填入到 kuboard 界面的 Token 字段:
[root@master k8s-init-file]# echo -e "\033[31m$(kubectl -n kuboard get secret $(kubectl -n kuboard get secret kuboard-admin-token | grep kuboard-admin-token | awk '{print $1}') -o go-template='{{.data.token}}' | base64 -d)\033[0m"
eyJhbGciOiJSUzI1NiIsImtpZCI6IkdNTUhJeU96R1NJY0xGV2tTTHAzZmRtYVFUVmo0NkR1OTNST0dhdklsbEEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJvYXJkIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Imt1Ym9hcmQtYWRtaW4tdG9rZW4iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoia3Vib2FyZC1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjNiYjg2MjllLTc3NTItNDQ0MS1hYTk4LThmYmE5ZmVmM2RmZSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJvYXJkOmt1Ym9hcmQtYWRtaW4ifQ.c6Y1T9ji723eL1Eog5w5SvQrK2asx3YlyO9EBZlVFylXPMLrqzG6CNpbX4rUrhu-mlDwVdS0bapA1-oZOhFqUzEra25oHZ6aICnvdHeYsjsl0SBnO716hc2kVtVI1XmGWK9v4Ajy9qjq-IqKWOpjZ5CprUeWqlR5gze4ZMOx92EAB7HqcUgPtRYuGQz00DAtDdraoOgcRz7qIoFxZX9TUQ-JNWP8MU9V7BwkTN69s_1gIyhamZuJuc-wpQ5j9ZSptsvMSvpYx3TIsBKJAXUOYH6VtS4-ndHdfAKqxtVd2DRCFjE53iIzGaFY5AoaOMfypkZ731sKD-2mgQTkqLAAGg
查看集群信息
转载请注明出处来源