Kubeapps視覺化管理Helm Chart包

尹正杰發表於2024-11-29

目錄
  • 一.基於helm部署kubeapps
    • 1.kubeapps介紹
    • 2.新增kubeapps的repo
    • 3.搜尋kubeapps
    • 4.下載指定的kubeapps版本
    • 5.基於helm部署kubeapps
    • 6.訪問kubeapps的WebUI
  • 二.透過kubeapps部署應用案例
    • 1 透過kubeapps檢視已經部署的Chart
    • 2.透過kubeapps搜尋Chart資訊

一.基於helm部署kubeapps

1.kubeapps介紹

Kubeapps提供了一個開源的Helm UI介面,方便以圖形介面的形式管理Helm應用。
	- 部署應用:
		可從公共或私有倉庫中瀏覽chart並將其部署到叢集中。
		
	- 管理應用:
		升級、管理和刪除部署在kubernetes叢集中的應用程式。
		
	- 搜尋功能:
		Kubeapps提供chart搜尋頁面。

官網地址:
	https://github.com/vmware-tanzu/kubeapps/

2.新增kubeapps的repo

	1.新增第三方倉庫
[root@master231 03-kubeapps]# helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories
[root@master231 03-kubeapps]# 

	2.檢視倉庫資訊
[root@master231 03-kubeapps]# helm repo list
NAME            	URL                                                   
azure           	http://mirror.azure.cn/kubernetes/charts/             
aliyun				https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
bitnami         	https://charts.bitnami.com/bitnami                    
[root@master231 03-kubeapps]# 

	3.更新repo源
[root@master231 03-kubeapps]# helm repo update 
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "aliyun" chart repository
...Successfully got an update from the "azure" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
[root@master231 03-kubeapps]#  

3.搜尋kubeapps

 	1.搜尋kubeapps的Chart歷史列表資訊
[root@master231 03-kubeapps]# helm search repo kubeapps  -l
NAME            	CHART VERSION	APP VERSION	DESCRIPTION                                       
bitnami/kubeapps	17.0.3       	2.12.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	17.0.2       	2.12.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	17.0.1       	2.11.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	17.0.0       	2.11.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	16.0.1       	2.11.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	16.0.0       	2.11.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.10      	2.11.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.9       	2.11.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.8       	2.11.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.7       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.6       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.5       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.4       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.3       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.2       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.1       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.3.0       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.2.2       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.2.1       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.2.0       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.1.2       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.1.1       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.0.5       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.0.4       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.0.3       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.0.2       	2.10.0     	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.0.1       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	15.0.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.7.2       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.7.1       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.7.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.6.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.5.2       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.5.1       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.4.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.3.3       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.3.2       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.3.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.2.1       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.2.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.1.3       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.1.2       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.1.1       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.1.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.0.2       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.0.1       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	14.0.0       	2.9.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	13.1.1       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	13.1.0       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	13.0.1       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	13.0.0       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.12      	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.11      	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.10      	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.9       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.8       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.7       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.6       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.5       	2.8.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.4       	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.3       	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.2       	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.4.1       	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.3.3       	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.3.2       	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.3.1       	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.10      	2.7.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.9       	2.6.4      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.8       	2.6.4      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.7       	2.6.4      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.6       	2.6.3      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.5       	2.6.3      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.4       	2.6.3      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.3       	2.6.3      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.2       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.1       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.2.0       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.1.6       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.1.5       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.1.4       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.1.3       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.1.2       	2.6.2      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.1.1       	2.6.1      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.1.0       	2.6.1      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	12.0.0       	2.6.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	11.0.1       	2.6.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.3.5       	2.5.1      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.3.4       	2.5.1      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.3.3       	2.5.1      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.3.1       	2.5.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.3.0       	2.5.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.2.2       	2.5.0      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.2.1       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.2.0       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.1.1       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.0.6       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.0.5       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.0.4       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.0.3       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.0.2       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.0.1       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	10.0.0       	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	9.0.3        	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	9.0.2        	2.4.6      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	8.1.11       	2.4.5      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	8.1.10       	2.4.5      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	8.1.9        	2.4.5      	Kubeapps is a web-based UI for launching and ma...
bitnami/kubeapps	8.1.8        	2.4.5      	Kubeapps is a web-based UI for launching and ma...
[root@master231 03-kubeapps]# 

	2.以寬格式顯示
[root@master231 03-kubeapps]# helm search repo kubeapps  -l --max-col-width 200
NAME            	CHART VERSION	APP VERSION	DESCRIPTION                                                                                                                                                                           
bitnami/kubeapps	17.0.3       	2.12.0     	Kubeapps is a web-based UI for launching and managing applications on Kubernetes. It allows users to deploy trusted applications and operators to control users access to the cluster.
bitnami/kubeapps	17.0.2       	2.12.0     	Kubeapps is a web-based UI for launching and managing applications on Kubernetes. It allows users to deploy trusted applications and operators to control users access to the cluster.
...

4.下載指定的kubeapps版本

溫馨提示:
	- 1.對於K8S 1.23.17如果採用最新"Chart 17.0.3"版本進行部署,可能會導致PostgreSQL的Pod在不斷重啟。
	- 2.推薦大家部署12.2.10版本進行部署,對於15.3.10版本測試過發現也會在重啟喲。
	

[root@master231 03-kubeapps]# mkdir kubeapps-12.2.10
[root@master231 03-kubeapps]#
[root@master231 03-kubeapps]# cd kubeapps-12.2.10
[root@master231 kubeapps-12.2.10]# ll
total 8
drwxr-xr-x 2 root root 4096 Nov 29 11:57 ./
drwxr-xr-x 5 root root 4096 Nov 29 11:57 ../
[root@master231 kubeapps-12.2.10]# 
[root@master231 kubeapps-12.2.10]# helm pull bitnami/kubeapps --version 12.2.10
[root@master231 kubeapps-12.2.10]# 
[root@master231 kubeapps-12.2.10]# ll
total 216
drwxr-xr-x 2 root root   4096 Nov 29 11:58 ./
drwxr-xr-x 5 root root   4096 Nov 29 11:57 ../
-rw-r--r-- 1 root root 212910 Nov 29 11:58 kubeapps-12.2.10.tgz
[root@master231 kubeapps-12.2.10]# 

5.基於helm部署kubeapps

	1.外網無法訪問kubeapp服務,將svc的型別改為NodePort
檢視"kubeapps/values.yaml"目錄,將svc的ClusterIP改為"NodePort"型別。

與此同時,修改"nodePort"的埠為"4090"。


	2.安裝kubeapps
[root@master231 kubeapps-12.2.10]# helm  install oldboyedu-kubeapps kubeapps
NAME: oldboyedu-kubeapps
LAST DEPLOYED: Fri Nov 29 12:00:36 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: kubeapps
CHART VERSION: 12.2.10
APP VERSION: 2.7.0** Please be patient while the chart is being deployed **

Tip:

  Watch the deployment status using the command: kubectl get pods -w --namespace default

Kubeapps can be accessed via port 80 on the following DNS name from within your cluster:

   oldboyedu-kubeapps.default.svc.cluster.local

To access Kubeapps from outside your K8s cluster, follow the steps below:

1. Get the Kubeapps URL by running these commands:

   export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
   export NODE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services oldboyedu-kubeapps)
   echo "Kubeapps URL: http://$NODE_IP:$NODE_PORT"

2. Open a browser and access Kubeapps using the obtained URL.
[root@master231 kubeapps-12.2.10]# 


	3.檢視Pod資訊,如下所示,STATUS個別Pod存在問題的兩個Pod可以暫時忽略。
[root@master231 kubeapps-12.2.10]# kubectl get pods -o wide
NAME                                                              READY   STATUS                       RESTARTS   AGE     IP             NODE        NOMINATED NODE   READINESS GATES
apprepo-default-sync-bitnami-28880890-ggm2p                       0/1     Completed                    0          68s     10.100.1.4     worker232   <none>           <none>
apprepo-default-sync-bitnami-fx7nm-hxdq2                          0/1     Completed                    0          8m57s   10.100.2.9     worker233   <none>           <none>
apprepo-kubernet-497878190-sync-aliyun-28880890-c58sb             0/1     Completed                    0          68s     10.100.2.13    worker233   <none>           <none>
apprepo-kubernet-497878190-sync-aliyun-njqdv-c6qnr                0/1     Completed                    0          8m57s   10.100.2.10    worker233   <none>           <none>
apprepo-oldboyedu-helm-sync-bitnami-28880890-ktzg6                0/1     CreateContainerConfigError   0          68s     10.100.2.12    worker233   <none>           <none>
apprepo-oldboyedu-helm-sync-bitnami-7lnwz-9ms6z                   0/1     CreateContainerConfigError   0          8m57s   10.100.2.11    worker233   <none>           <none>
oldboyedu-kubeapps-5c48854857-4pvhg                               1/1     Running                      0          10m     10.100.1.3     worker232   <none>           <none>
oldboyedu-kubeapps-5c48854857-fhv6t                               1/1     Running                      0          10m     10.100.2.8     worker233   <none>           <none>
oldboyedu-kubeapps-internal-apprepository-controller-797f8fgf8g   1/1     Running                      0          10m     10.100.2.7     worker233   <none>           <none>
oldboyedu-kubeapps-internal-dashboard-7c589dfbc9-ktkv4            1/1     Running                      0          10m     10.100.2.5     worker233   <none>           <none>
oldboyedu-kubeapps-internal-dashboard-7c589dfbc9-p27q5            1/1     Running                      0          10m     10.100.1.2     worker232   <none>           <none>
oldboyedu-kubeapps-internal-kubeappsapis-645b5f574-7z8gd          1/1     Running                      0          10m     10.100.1.254   worker232   <none>           <none>
oldboyedu-kubeapps-internal-kubeappsapis-645b5f574-jnp2l          1/1     Running                      0          10m     10.100.2.6     worker233   <none>           <none>
oldboyedu-kubeapps-postgresql-0                                   1/1     Running                      0          10m     10.100.1.253   worker232   <none>           <none>
[root@master231 kubeapps-12.2.10]# 

6.訪問kubeapps的WebUI

http://10.0.0.233:4090/#/login


溫馨提示:
	我們可以基於token登入kubeapps,如何基於token登入,可以參考我們之前登入dashboard的解決方案。

二.透過kubeapps部署應用案例

1 透過kubeapps檢視已經部署的Chart

如上圖所示,我們可以看到當前K8S系統已經部署好的Chart。

2.透過kubeapps搜尋Chart資訊

如上圖所示,我們可以新增第三方參考,而後在WebUI進行搜尋我們關心的Chart。

相關文章