Version: v1.1

Helm

KubeVela’s Helm component meets the needs of users to connect to Helm Chart. You can deploy any ready-made Helm chart software package from Helm Repo, Git Repo or OSS bucket through the Helm component, and overwrite its parameters.

Deploy From Helm Repo

In this Application, we hope to deliver a component called redis-comp. It is a chart from the bitnami.

  1. cat <<EOF | kubectl apply -f -
  2. apiVersion: core.oam.dev/v1beta1
  3. kind: Application
  4. metadata:
  5. name: app-delivering-chart
  6. spec:
  7. components:
  8. - name: redis-comp
  9. type: helm
  10. properties:
  11. chart: redis-cluster
  12. version: 6.2.7
  13. url: https://charts.bitnami.com/bitnami
  14. repoType: helm
  15. EOF

Please copy the above code block and deploy it directly to the runtime cluster:

  1. application.core.oam.dev/app-delivering-chart created

Finally, we use vela ls to view the application status after successful delivery:

  1. APP COMPONENT TYPE TRAITS PHASE HEALTHY STATUS CREATED-TIME
  2. app-delivering-chart redis-comp helm running healthy 2021-08-28 18:48:21 +0800 CST

We also see that the PHASE of the app-delivering-chart APP is running and the STATUS is healthy.

Attributes

ParametersDescriptionExample
repoTyperequired, indicates where it’s fromHelm
pullIntervaloptional, synchronize with Helm Repo, tunning interval and 5 minutes by default10m
urlrequired, Helm Reop address, it supports http/httpshttps://charts.bitnami.com/bitnami
secretRefoptional, The name of the Secret object that holds the credentials required to pull the repo. The username and password fields must be included in the HTTP/S basic authentication Secret. For TLS the secret must contain a certFile and keyFile, and/or caCert fields. For TLS authentication, the secret must contain a certFile / keyFile field and/or caCert field.sec-name
timeoutoptional, timeout for pulling repo index60s
chartrequired, chart titleredis-cluster
versionoptional, chart version, * by default6.2.7
targetNamespaceoptional, the namespace to install chart, decided by chart itselfyour-ns
releaseNameoptional, release name after installedyour-rn
valuesoptional, override the Values.yaml inchart, using for the rendering of Helm

Deploy From OSS bucket

ParametersDescriptionExample
repoTyperequired, indicates where it’s fromoss
pullIntervaloptional, synchronize with bucket, tunning interval and 5 minutes by default10m
urlrequired, bucket’s endpoint and no need to fill in with schemeoss-cn-beijing.aliyuncs.com
secretRefoptional, Save the name of a Secret, which is the credential to read the bucket. Secret contains accesskey and secretkey fieldssec-name
timeoutoptional, The timeout period of the download operation, the default is 20s60s
chartrequired, Chart storage path (key)./chart/podinfo-5.1.3.tgz
versionoptional, In OSS source, this parameter has no effect
targetNamespaceoptional, The namespace of the installed chart, which is determined by the chart itself by defaultyour-ns
releaseNameoptional, Installed release nameyour-rn
valuesoptional, Overwrite the Values.yaml of the chart for Helm rendering.
oss.bucketNamerequired, bucket nameyour-bucket
oss.provideroptional, Optional generic or aws, fill in aws if the certificate is obtained from aws EC2. The default is generic.generic
oss.regionoptional, bucket region

How-to

  1. (Opentional) If your OSS bucket needs identity verification, create a Secret:
  1. $ kubectl create secret generic bucket-secret --from-literal=accesskey=<your-ak> --from-literal=secretkey=<your-sk>
  2. secret/bucket-secret created
  1. Example
  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: bucket-app
  5. spec:
  6. components:
  7. - name: bucket-comp
  8. type: helm
  9. properties:
  10. repoType: oss
  11. # required if bucket is private
  12. secretRef: bucket-secret
  13. chart: ./chart/podinfo-5.1.3.tgz
  14. url: oss-cn-beijing.aliyuncs.com
  15. oss:
  16. bucketName: definition-registry

Deploy From Git Repo

ParametersDescriptionExample
repoTyperequired, indicates where it’s fromgit
pullIntervaloptional, synchronize with Git Repo, tunning interval and 5 minutes by default10m
urlrequired, Git Repo addresshttps://github.com/oam-dev/terraform-controller
secretRefoptional, The name of the Secret object that holds the credentials required to pull the Git repository. For HTTP/S basic authentication, the Secret must contain the username and password fields. For SSH authentication, the identity, identity.pub and known_hosts fields must be includedsec-name
timeoutoptional, The timeout period of the download operation, the default is 20s60s
chartrequired, Chart storage path (key)./chart/podinfo-5.1.3.tgz
versionoptional, In Git source, this parameter has no effect
targetNamespaceoptional, the namespace to install chart, decided by chart itselfyour-ns
releaseNameoptional, Installed release nameyour-rn
valuesoptional, Overwrite the Values.yaml of the chart for Helm rendering.
git.branchoptional, Git branch, master by defaultdev

How-to

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: app-delivering-chart
  5. spec:
  6. components:
  7. - name: terraform-controller
  8. type: helm
  9. properties:
  10. repoType: git
  11. url: https://github.com/oam-dev/terraform-controller
  12. chart: ./chart
  13. git:
  14. branch: master