Helm簡化了應用程式的定義、安裝和升級,使得Kubernetes叢集的應用管理更為高效且便捷。Container Compute Service (ACS)在應用目錄管理功能中整合了Helm工具,並進行了功能擴充,提供了Spark、Dify等常見的第三方應用。
Helm介紹
Helm是一個用於在Kubernetes叢集中進行應用管理的開源工具,它提供了統一的應用打包方式,同時支援版本控制,降低了應用分發和部署的複雜性。您可參照下方的表格,瞭解Helm的基本概念,更多資訊,請參見Helm。
Helm概念 | 說明 |
Chart | 一個Helm包,其中包含了運行一個應用所需要的鏡像、依賴和資源定義等,還可能包含Kubernetes叢集中的服務定義,類似Homebrew中的formula、APT的dpkg或者Yum的rpm檔案。 |
Release | 在Kubernetes叢集上啟動並執行Chart的一個執行個體。在同一個叢集上,一個Chart可以安裝多次。每次安裝都會建立一個新的Release。例如,如果一個MySQL Chart想在伺服器上運行兩個資料庫,可以將此Chart安裝兩次,並在每次安裝中產生自己的Release以及Release名稱。 |
Repository | Chart存放庫,Helm用戶端通過HTTP協議來訪問存放庫中Chart的索引檔案和壓縮包。 |
Helm CLI | Helm命令列工具,Helm CLI的安裝方式請參見Installing Helm。 |
通過ACS Repository部署應用
ACS提供了一個Repository,其中包含了一些例如Spark等常見的應用,您可通過控制台或Helm CLI使用ACS提供的Repository。
控制台
登入容器計算服務控制台,在左側導覽列選擇叢集列表。
在叢集列表頁面,單擊目的地組群名稱,然後在左側導覽列,選擇。
在Helm頁面,單擊左上方的建立。
參考以下資訊完成基本資料配置,然後單擊下一步。
參數
說明
樣本值
應用程式名稱
Release在叢集內的名稱。
demo-app
命名空間
Release部署的命名空間。
default
來源
Chart的來源。
應用目錄:應用市場
ACR EE:ACR企業版
應用目錄
Chart
安裝應用所使用的Chart。
ack-dify
按需選擇Chart版本並調整Chart內容,然後單确定。
說明Release安裝完成後,您可以通過控制台管理已安裝的應用。具體操作,請參見使用Helm管理ACS應用。
Helm CLI
在本機電腦上安裝配置kubectl和Helm CLI,然後串連叢集。具體操作,請參見擷取叢集KubeConfig並通過kubectl工具串連叢集和Install Helm。
說明使用CloudShell串連叢集時,機器已預裝Helm CLI,您無需手動安裝。更多資訊,請參見在CloudShell上通過kubectl管理Kubernetes叢集。
將ACS Repository以aliyunhub為名稱添加到Helm的Repository列表中。
helm repo add aliyunhub https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/預期輸出:
"aliyunhub" has been added to your repositories更新aliyunhub資訊。
helm repo update aliyunhub預期輸出:
Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "aliyunhub" chart repository Update Complete. ⎈Happy Helming!⎈查看Repository中的Chart。
helm search repo aliyunhub預期輸出:
NAME CHART VERSION APP VERSION DESCRIPTION aliyunhub/ack-acr-acceleration-p2p 0.3.6 0.3.6 Speed Up Container Startup on ACK aliyunhub/ack-acr-acceleration-suite 0.2.8 0.2.8 Speed Up Container Startup on ACK aliyunhub/ack-advanced-audit 0.5.0 0.5.0 Kubernetes advanced audit aliyunhub/ack-advanced-horizontal-pod-autoscaler 0.1.0 1.0 A Helm chart for Kubernetes aliyunhub/ack-aegis-installer 0.1.1 Install Aegis in Alibaba Cloud Kubernetes cluster. aliyunhub/ack-agones 1.23.0 1.23.0 a library for hosting, running and scaling dedi... aliyunhub/ack-ags-wdl 1.1.0 1.16.0 A Helm chart for AGS to support WDL language. aliyunhub/ack-ahas-pilot 1.17.2 1.17.2 A cloud service that aims to improve the high a... aliyunhub/ack-ahas-sentinel-pilot 0.3.0 0.3.0 AHAS Sentinel Pilot - Webhook Admission Controller aliyunhub/ack-ahas-springcloud-gateway 0.1.1 0.1.1 Spring Cloud Gateway with AHAS Sentinel integra... aliyunhub/ack-ai-dashboard 1.0.15 1.0.0 ai-dashboard for Kube-AI aliyunhub/ack-ai-dev-console 1.2.1 1.2.1 ack-ai-dev-console of KubeAI aliyunhub/ack-ai-installer 1.9.15 1.9.15 a toolkit for scheduling computing resources in... aliyunhub/ack-ai-pipeline 1.0.4 1.0.4 ack-ai-pipeline of KubeAI aliyunhub/ack-alibaba-cloud-metrics-adapter 1.3.4 0.1.5 An implementation of the Kubernetes Custom Metr... aliyunhub/ack-amd-device-plugin 1.0.0 1.0.0 A Helm chart for deploying ack-amd-device-plugin aliyunhub/ack-amd-smi-exporter 1.0.0 1.0.0 A Helm chart for deploying ack-amd-smi-exporter aliyunhub/ack-application-acceleration 1.1.0 1.1.0 Reduce application startup time on ACK aliyunhub/ack-arena 0.9.16 0.9.16 Running Deep Learning Containers on ACK aliyunhub/ack-arena-exporter 0.5.0 0.5.0 A Helm chart for deploying arena-exporter aliyunhub/ack-arms-cmonitor 4.1.2 4.1.2 ARMS Container Monitor aliyunhub/ack-arms-pilot 1.52.4 1.52.4 ARMS Pilot - deprecated aliyunhub/ack-arms-prometheus 1.1.25 4.2.0 ARMS Prometheus Operator aliyunhub/ack-arms-vector 1.0.2 1.0.0 ARMS Prometheus Vector aliyunhub/ack-autoscaling-placeholder 1.1.0 1.1 Installs the a deployment that overprovisions t... aliyunhub/ack-blazing-dns 2.0.0 2.0.0 BlazingDNS speeds up DNS. aliyunhub/ack-celeborn 0.1.0 Apache Celeborn is an intermediate data service... aliyunhub/ack-cgpu 1.5.2 1.5.2 A GPU sharing and isolation solution on Kuberne... aliyunhub/ack-coredns-dnstap-analyser 0.1.0 v0.4.0.0 A dnstap receiver and analyser for CoreDNS dnst... aliyunhub/ack-cost-exporter 1.0.17 0.1 export cost metrics of cloud resources aliyunhub/ack-descheduler 0.27.1 0.27.1 ACK descheduler for Kubernetes is used to rebal... aliyunhub/ack-dify 0.1.7 0.8.3 Helm chart for deploying dify resources. aliyunhub/ack-edge-acr-acceleration-p2p 0.2.2 0.2.2 Speed Up Container Startup on ACK aliyunhub/ack-edge-arms-prometheus 0.1.5 1.0.5 ARMS Prometheus Operator aliyunhub/ack-edge-nas-csiplugin 1.1.0 v1 this chart provides nas csi driver for ack@edge. aliyunhub/ack-edge-node-problem-detector 1.2.0 0.8.0 this chart aims to make various node problems ... ...以Spark 3.0為樣本進行部署。
說明下方的命令僅為樣本,在您實際部署時,可能需要考慮地區等因素並調整內容。
helm install spark aliyunhub/ack-spark-operator3.0 \ --namespace spark-operator \ --create-namespace \ --set image.repository=registry-cn-shanghai-vpc.ack.aliyuncs.com/acs/spark-operator預期輸出:
NAME: spark LAST DEPLOYED: * * ****** 2024 NAMESPACE: spark-operator STATUS: deployed REVISION: 1 TEST SUITE: None
通過Helm CLI使用第三方庫部署應用
如果ACS提供的Chart無法滿足您的需求,您可參照以下樣本,使用第三方庫部署應用。
helm repo add <REPO_NAME> <REPO_URL> # 添加Chart存放庫,REPO_NAME替換為Chart存放庫的名稱,REPO_URL替換為存放庫的地址
helm repo update # 更新存放庫資訊
helm install <APP_NAME> <REPO_NAME>/<CHART_NAME> # 安裝應用,APP_NAME替換為一個應用的名稱,CHART_NAME替換為Chart的名稱更多關於Helm命令的資訊,請參見Using Helm。