kubeapps作为helm的ui界面,方便快速的部署常用的docker应用
由于是采用kubespray部署kubernetes环境自带helm,所以这部分不再累述
进入https://github.com/kubeapps/kubeapps/blob/master/docs/user/getting-started.md,参考官方的安装说明

  1. 首先执行
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install --name kubeapps --namespace kubeapps bitnami/kubeapps

通过helm安装kubeapps界面

  1. 创建kubeapps的sa,并创建token
kubectl create serviceaccount kubeapps-operator
kubectl create clusterrolebinding kubeapps-operator --clusterrole=cluster-admin --serviceaccount=default:kubeapps-operator
kubectl get secret $(kubectl get serviceaccount kubeapps-operator -o jsonpath='{.secrets[].name}') -o jsonpath='{.data.token}' | base64 --decode
#这个token将作为kubeapps的登录密码
  1. 编写kubeapps-svc.yml
cat kubeapps-svc.yml
apiVersion: v1
kind: Service
metadata:
 name: kubeapps-svc
 namespace: kubeapps
 labels:
  app: kubeapps
spec:
 type: NodePort
 ports:
 - port: 8080
   nodePort: 30080
 selector:
  app: kubeapps
kubectl apply -f kubeapps-svc.yml
#检查kubeapps对应的pod是否都已启动,如果完成启动,则可以通过http://宿主机ip:30080 进行访问
kubectl get pod -n kubeapps|grep kubeapps
kubeapps-7c46df9474-6fl29                                     1/1     Running     4          4h39m
kubeapps-7c46df9474-6jvg5                                     1/1     Running     3          4h39m
kubeapps-internal-apprepository-controller-6599d8d6fd-n4jw4   1/1     Running     1          4h39m
kubeapps-internal-chartsvc-cb789dc6d-tdnxv                    1/1     Running     20         4h8m
kubeapps-internal-chartsvc-cb789dc6d-zhj4f                    1/1     Running     2          4h39m
kubeapps-internal-dashboard-56ccd84644-fv95p                  1/1     Running     1          4h39m
kubeapps-internal-dashboard-56ccd84644-mvlpk                  1/1     Running     1          4h39m
kubeapps-internal-tiller-proxy-6989959484-5q67c               1/1     Running     4          4h39m
kubeapps-internal-tiller-proxy-6989959484-mx6f5               1/1     Running     22         4h7m
kubeapps-mongodb-5f9b776f75-z74sn                             1/1     Running     1          4h39m

可以通过http://宿主机ip:30080 进行访问,如下
heml2.png
密码这里的登录就是上文中的token
heml3.png

文章作者: 鲜花的主人
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 爱吃可爱多
Kubernetes Kubernetes
喜欢就支持一下吧
打赏
微信 微信
支付宝 支付宝