Deploy Helm Chart

    The typical usage of deploying Helm Chart is to integrate middleware, many from in bitnami or open-source application tools such as Gitlab, and Jenkins in . KubeVela can help you easily deploy these applications to any managed cluster and manage them.

    Starting from here, you will learn to use the KubeVela Addons to install plug-ins. The Helm Chart is currently supported by the FluxCD addon. In addition to the Helm Chart, FluxCD addon also supports Kustomize.

    • Choose a Helm Chart you want to deploy. In the tutorial, we take as an example.
    • Ensure that the cluster you deliver has a usable default StorageClass. Most of our delivery middleware requires data persistence, and the default StorageClass is needed to allocate PV.
    • Make sure you have VelaUX addon enabled for UI console. If you are only CLI users, you can skip to Deploy via CLI

    Enable fluxcd addon

    Helm Chart delivery relies on addon in KubeVela, you need to enable addon before start. You can refer to addon management doc for more detail information about addon.

    1. vela addon enable fluxcd

    When the addon status become enabled, it means it’s ready for helm chart delivery.

    After fluxcd addon enabled, there’s a helm definition added, you can check the parameter details by:

    1. vela show helm

    You can also check the fluxcd addon docs for details.

    Let’s take the redis chart as example, you can deploy by the following application:

    Deploy it by:

    1. vela up -f https://kubevela.io/example/applications/app-with-chart-redis.yaml

    Then check the deployment status of the application through vela status helm-redis

    expected output of vela status

    1. About:
    2. Name: helm-redis
    3. Namespace: default
    4. Created at: 2022-04-21 17:19:12 +0800 CST
    5. Status: running
    6. Workflow:
    7. mode: DAG
    8. finished: true
    9. Suspend: false
    10. Terminated: false
    11. Steps
    12. - id:n1gxswwina
    13. name:redis
    14. phase:succeeded
    15. message:
    16. Services:
    17. - Name: redis
    18. Cluster: local Namespace: default
    19. Healthy Fetch repository successfully, Create helm release successfully
    20. No trait applied

    Deploy Helm Chart from UI Console

    The experience on UI console is quite the same with container image delivery. When it comes to deploying Helm Chart, all you need is to select type as helm.

    The helm component type will automatically discovered after fluxcd addon enabled.

    Then select the Target which has the default StorageClass that provides PV, and at last enter the deployment parameter configuration page.

    As shown, you need to do the following configuration:

    • Repo Type: Git and Helm are supported. In this example, we choose Helm.
    • Repo URL: Fill in the repo address you needed. we type in: . If you have configured the helm repo in Integration you can choose the repo directly.
    • Chart: After fill Helm repo URL, will list all available charts in this field. You can choose one from the list, here we choose: redis.
    • Version: After choosing the helm chart, will list all available versions in this field. Choose one version of this chart, here we choose: 16.8.5.
    • Values: After choosing the version, will list all parameters of this helm Chart. Since we are using ACK cluster in the example, PV has a minimum capacity requirement, 15Gi. In the same way, other parameters can also be configured according to your cluster’s status.

    After filling in the above parameters, click Create to complete the application creation and enter the application configuration page. The following steps will stay the same as you’ve learned in .

    Clicking the component name, you can open the component configuration page. For the Helm Chart component, we can set the Values configuration options to change the application deployment parameters. the Values configuration options are generated by values.yaml, you can set the custom value for every option.

    In the VelaUX, the value key format like replica.persistence.size=15Gi. they will be converted to YAML value:

    After modifying the deployment parameters, the workflow of the environment must be executed to make the modified parameters take effect in the specified environment. Due to the existence of Revision, the configuration parameters will be saved in each historical version.

    Visualize the resources created by Helm Release

    For a helm chart, users often don’t know what resources they will create, making it difficult to troubleshoot. In VelaUX, users can visualize the resources created by Helm Release. via the resource graph, users could know the relationships between the resources and the status of all resources. Click the Detail action button could view the resource YAML.

    resource-graph

    At this point, Helm Chart in KubeVela is no stranger to you, go ahead and try more!

    You can change the default values file values.yaml with another value file present inside the Helm chart by set the valuesFiles field. eg:

    We use the chart hello-kubernetes-chart as an example.This chart has two values files. You can pull this chart and have a look all contains files in it:

    1. $ tree ./hello-kubernetes-chart
    2. ./hello-kubernetes-chart
    3. ├── Chart.yaml
    4. ├── templates
    5. ├── NOTES.txt
    6. ├── _helpers.tpl
    7. ├── config-map.yaml
    8. ├── deployment.yaml
    9. ├── hpa.yaml
    10. ├── ingress.yaml
    11. ├── service.yaml
    12. ├── serviceaccount.yaml
    13. └── tests
    14. └── test-connection.yaml
    15. ├── values-production.yaml

    As we can see, there are values files values.yaml values-production.yaml in this chart.If you not set the valuesFiles field, values.yaml will used by rendering the resources.

    You can switch to use values-production.yaml by:

    1. apiVersion: core.oam.dev/v1beta1
    2. kind: Application
    3. metadata:
    4. name: hello-kubernetes
    5. spec:
    6. components:
    7. - name: hello-kubernetes
    8. type: helm
    9. properties:
    10. repoType: "helm"
    11. url: "https://wangyikewxgm.github.io/my-charts/"
    12. chart: "hello-kubernetes-chart"
    13. version: "0.1.0"
    14. valuesFiles:
    15. - "values-production.yaml"
    16. EOF

    Files defined in field valuesFiles are merged in the order of this list with the last file overriding the first.

    Example below values-production.yaml will override values.yaml if they have same value key.

    Specify OCI registry

    If your chart is stored in OCI registry, you can create the application like this:

    1. apiVersion: core.oam.dev/v1beta1
    2. kind: Application
    3. metadata:
    4. name: oci-app
    5. namespace: default
    6. spec:
    7. components:
    8. - name: test-helm
    9. type: helm
    10. properties:
    11. repoType: "oci"
    12. url: oci://ghcr.io/stefanprodan/charts
    13. chart: podinfo

    Deploy Helm Chart - 图4note

    Your fluxcd addon version must be 1.3.1+.