Helm


The Helm Parent folder has 

1. following folders

* templates

* charts

2. following files

* Chart.yaml

* values.yaml

Templates folders has all K8s object. 

Here is list of built-in objects https://helm.sh/docs/chart_template_guide/builtin_objects/

The important ones are: 

1. Release

This object describes the release itself. It has several objects inside of it:

  • Release.Name: The release name
  • Release.Namespace: The namespace to be released into (if the manifest doesn’t override)
  • Release.IsUpgrade: This is set to true if the current operation is an upgrade or rollback.
  • Release.IsInstall: This is set to true if the current operation is an install.
  • Release.Revision: The revision number for this release. On install, this is 1, and it is incremented with each upgrade and rollback.
  • Release.Service: The service that is rendering the present template. On Helm, this is always Helm.

2. Chart

The contents of the Chart.yaml file. The fields are as per https://helm.sh/docs/topics/charts/#the-chartyaml-file

apiVersion: The chart API version (required)
name: The name of the chart (required)
version: A SemVer 2 version (required)
kubeVersion: A SemVer range of compatible Kubernetes versions (optional)
description: A single-sentence description of this project (optional)
type: The type of the chart (optional)
keywords:
  - A list of keywords about this project (optional)
home: The URL of this projects home page (optional)
sources:
  - A list of URLs to source code for this project (optional)
dependencies: # A list of the chart requirements (optional)
  - name: The name of the chart (nginx)
    version: The version of the chart ("1.2.3")
    repository: (optional) The repository URL ("https://example.com/charts") or alias ("@repo-name")
    condition: (optional) A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
    tags: # (optional)
      - Tags can be used to group charts for enabling/disabling together
    import-values: # (optional)
      - ImportValues holds the mapping of source values to parent key to be imported. Each item can be a string or pair of child/parent sublist items.
    alias: (optional) Alias to be used for the chart. Useful when you have to add the same chart multiple times
maintainers: # (optional)
  - name: The maintainers name (required for each maintainer)
    email: The maintainers email (optional for each maintainer)
    url: A URL for the maintainer (optional for each maintainer)
icon: A URL to an SVG or PNG image to be used as an icon (optional).
appVersion: The version of the app that this contains (optional). Needn't be SemVer. Quotes recommended.
deprecated: Whether this chart is deprecated (optional, boolean)
annotations:
  example: A list of annotations keyed by name (optional).

3. Values

Values passed into the template from the values.yaml file and from user-supplied files.

Now commands

1. helm lint .

2. helm template .

3. helm install --dry-run my-release

4. helm install my-release

5. helm list

We can pass external values.yaml using "--values /path/values.yaml"

6. helm upgrade my-release

7. helm rollback my-release

8. helm rollback <release-name> <revision-number>

9. helm uninstall my-release

10. helm package my-release

to put it on GitHub, S3 etc. 

Debugging of Helm

1. helm lint

2. helm get values: This command will output the release values installed to the cluster.

3. helm install --dry-run

4. helm get manifest: This command will output the manifests that are running in the cluster.

5. helm diff: It will output the differences between the two revisions.

Reference: https://devopscube.com/create-helm-chart/

0 comments:

Post a Comment