Helm Developer Guide

    If you have already installed KubeSphere, then Helm is deployed in your environment. Otherwise, refer to the Helm documentation to install Helm first.

    Create a Local Repository

    Execute the following commands to create a repository on your machine.

    Use helm create to create a folder named nginx, which automatically creates YAML templates and directories for your app. Generally, it is not recommended to change the name of files and directories in the top level directory.

    1. $ helm create nginx
    2. $ tree nginx/
    3. nginx/
    4. ├── charts
    5. ├── Chart.yaml
    6. ├── templates
    7. ├── deployment.yaml
    8. ├── _helpers.tpl
    9. ├── ingress.yaml
    10. ├── NOTES.txt
    11. └── service.yaml
    12. └── values.yaml

    Chart.yaml is used to define the basic information of the chart, including name, API, and app version. For more information, see Chart.yaml File.

    When you deploy Helm-based apps to Kubernetes, you can edit the values.yaml file on the KubeSphere console directly.

    An example of the values.yaml file:

    1. # Default values for test.
    2. # This is a YAML-formatted file.
    3. # Declare variables to be passed into your templates.
    4. repository: nginx
    5. tag: stable
    6. pullPolicy: IfNotPresent
    7. nameOverride: ""
    8. fullnameOverride: ""
    9. service:
    10. type: ClusterIP
    11. port: 80
    12. ingress:
    13. enabled: false
    14. annotations: {}
    15. # kubernetes.io/ingress.class: nginx
    16. # kubernetes.io/tls-acme: "true"
    17. path: /
    18. hosts:
    19. - chart-example.local
    20. tls: []
    21. # - secretName: chart-example-tls
    22. # hosts:
    23. # We usually recommend not to specify default resources and to leave this as a conscious
    24. # choice for the user. This also increases chances charts run on environments with little
    25. # resources, such as Minikube. If you do want to specify resources, uncomment the following
    26. # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    27. # limits:
    28. # cpu: 100m
    29. # memory: 128Mi
    30. # requests:
    31. # cpu: 100m
    32. # memory: 128Mi
    33. nodeSelector: {}
    34. tolerations: []
    35. affinity: {}

    Refer to to edit files in the nginx folder and save them when you finish editing.

    Create an Index File (Optional)

    To add a repository with an HTTP or HTTPS URL in KubeSphere, you need to upload an index.yaml file to the object storage in advance. Use Helm to create the index file by executing the following command in the previous directory of nginx.

    1. helm repo index .
    • If the repository URL is S3-styled, an index file will be created automatically in the object storage when you add apps to the repository.

    • For more information about how to add repositories to KubeSphere, see .

    Go to the previous directory of nginx and execute the following command to package your chart which creates a .tgz package.

    1. helm package nginx
    1. $ ls
    2. nginx nginx-0.1.0.tgz

    Upload Your App

    Now that you have your Helm-based app ready, you can load it to KubeSphere and test it on the platform.