Simplify application deployment with Helm

更新时间:
复制 MD 格式

Deploy and manage ACK applications by packaging Kubernetes resources into reusable Helm Charts.

Create a Helm application

This example deploys a Dify application from the ACK console. Your cluster must have at least 2 vCPU cores and 4 GB of memory available.
  1. Create the Container Network File System (CNFS) and Network Attached Storage (NAS) StorageClasses for Dify.

    1. Log on to the ACK console and navigate to the Clusters page. Click your target cluster, then choose Volumes > StorageClasses from the left navigation pane.

    2. On the StorageClasses page, click Create from YAML. Paste the following YAML into the template, then click Create.

      If a resource with the same name already exists, the CNFS and NAS StorageClasses are already created. Proceed to deploy the application. Creating a NAS file system incurs fees. See NAS billing.
      apiVersion: storage.alibabacloud.com/v1beta1
      kind: ContainerNetworkFileSystem
      metadata:
        name: cnfs-nas-filesystem
      spec:
        description: "cnfs"
        type: nas
        reclaimPolicy: Retain  # Only Retain is supported. Deleting the CNFS will not delete the backend NAS instance.
      ---
      apiVersion: storage.k8s.io/v1
      kind: StorageClass
      metadata:
        name: alibabacloud-cnfs-nas
      mountOptions:
        - nolock,tcp,noresvport
        - vers=3
      parameters:
        volumeAs: subpath # Each persistent volume claim (PVC) will create a separate subdirectory in the NAS file system.
        containerNetworkFileSystem: cnfs-nas-filesystem # Associates with the CNFS instance defined above.
        path: "/"
      provisioner: nasplugin.csi.alibabacloud.com
      reclaimPolicy: Retain
      allowVolumeExpansion: true # Optional: Set to true to allow volume expansion for directory quotas.
  2. Deploy the Dify application.

    On the cluster details page, choose Applications > Helm from the left navigation pane. On the Helm page, click Deploy.

    • Basic Information: In the Chart section, search for and select ack-dify.

    • Parameters: For Chart Version, select the latest version.

  3. Access the Dify application.

    1. Expose the ack-dify service to the public Internet.

      Public access is for demonstration only. In production, use access control to secure your application data.

      Navigate to Network > Services and select the dify-system namespace. Find the service named ack-dify, click Update, configure the following, and click OK.

      • Service Type : click SLB .

      • Access Method: select Public Access.

      • VSwitch: select the appropriate vSwitches for the availability zones in your Virtual Private Cloud (VPC).

    2. Access the Dify application.

      Copy the External IP address and open it in your browser to access Dify.

Manage Helm applications

Manage deployed applications on the Helm page in the console.

Action

Description

View

Click the application name or Details to view resources, YAML manifest, and release history.

Update

Click Update. In the Update Release panel, modify the parameters as needed, then click OK.

Important

Updates may cause service restarts or functional issues. Assess the impact before making changes and update during off-peak hours.

Delete

Click Delete. In the Delete dialog box, select Clear Release Records, then click OK to delete the application and its resources, such as Services and Deployments.

Deleting the Dify application does not delete backend NAS resources. Manually delete the NAS file system.
Important

If you do not select Clear Release Records, the application name is preserved. Deploying another application with the same name will fail.

FAQ

How do I deploy a third-party application using the Helm CLI?

If ACK Charts do not meet your needs, use the Helm CLI to deploy applications.
  1. Connect to your cluster.

    Cloud-based

    Connect clusters with kubectl on Workbench or CloudShell.

    The Alibaba Cloud browser-based CLI includes Helm pre-installed. No additional setup is required.

    Local machine

    1. Connect to an ACK cluster using kubectl.

    2. Install the Helm CLI.

      curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
  2. Add a Chart repository.

    ReplaceREPO_NAMEwith the repository alias and REPO_URL with the its URL .
    helm repo add REPO_NAME REPO_URL
  3. Update your local repository information.

    helm repo update
  4. Deploy the third-party application.

    ReplaceAPP_NAMEwith your application name and CHART_NAMEwith the chart name.
    helm install APP_NAME REPO_NAME/CHART_NAME

See the official Helm documentation for more commands.

Why can't I delete a Helm application?

Symptoms

  • In the console, the Helm application remains in the "Uninstalling" state for a long time.

  • The helm uninstall command fails with an error like:

    no matches for kind "***" in version "***"
    ensure CRDs are installed first

Cause

This typically occurs after a cluster upgrade removes an API version used by a Helm chart resource. Uninstall fails because the specified API version no longer exists.

See Deprecated API Migration Guide for deprecated APIs in each Kubernetes version.

Solution

  1. Use the helm-mapkubeapis plugin to map deprecated APIs to supported versions, then delete the application.

    Replace RELEASE_NAME and NAMESPACE with the name and namespace of your Helm application.
    helm plugin install https://github.com/helm/helm-mapkubeapis
    helm mapkubeapis RELEASE_NAME -n NAMESPACE 

    A ...completed successfully message confirms the API versions are mapped.

  2. Uninstall the application again.

    helm uninstall RELEASE_NAME -n NAMESPACE

    The output release "***" uninstalled confirms the Helm application is deleted.

References