Skip to main content

Managing Chart Metadata

1. Setting Chart Annotations

Annotation Key Value Type Description Example
helm.sh/chart string Chart name and version "myapp-1.2.3"
app.kubernetes.io/name string Name of the application "myapp"
app.kubernetes.io/version string Version of the application "v1.2.3"
app.kubernetes.io/instance string Name of the chart instance "myapp-production"
app.kubernetes.io/managed-by string Tool used to manage the chart "helm"

Example: Setting Annotations in Chart.yaml

apiVersion: v2
name: myapp
description: A Helm chart for myapp
version: 1.2.3
appVersion: "v1.2.3"
annotations:
  helm.sh/chart: "myapp-1.2.3"
  app.kubernetes.io/name: "myapp"
  app.kubernetes.io/version: "v1.2.3"
  app.kubernetes.io/instance: "myapp-production"
  app.kubernetes.io/managed-by: "helm"

2. Adding Custom Metadata

Field Description Example
annotations Map of key-value pairs for additional metadata {"helm.sh/chart": "my-chart-1.0.0"}
labels Map of key-value pairs for organizational tagging {"app.kubernetes.io/name": "my-app"}

Example: Custom Metadata in Chart.yaml

apiVersion: v2
name: my-app
version: 1.0.0
annotations:
  helm.sh/chart: "my-chart-1.0.0"
  app.kubernetes.io/managed-by: "Helm"
labels:
  app.kubernetes.io/name: "my-app"
  app.kubernetes.io/version: "1.0.0"

3. Documenting Chart Purpose

Field Description Example
name The name of the chart "my-app"
version Chart version (semantic versioning) "1.2.3"
description A one-sentence description of the chart's purpose "A Helm chart for deploying a web application"
home Homepage URL for the project "https://example.com/my-app"
icon URL to an icon image "https://example.com/my-app-icon.png"
keywords List of keywords for the chart ["web", "application", "frontend"]
maintainers List of chart maintainers with name and email [{ "name": "John Doe", "email": "john@example.com" }]

Example: Chart Metadata

name: my-app
version: 1.2.3
description: A Helm chart for deploying a web application
home: https://example.com/my-app
icon: https://example.com/my-app-icon.png
keywords:
  - web
  - application
  - frontend
maintainers:
  - name: John Doe
    email: john@example.com

4. Listing Chart Dependencies

Command Description Flags
helm dependency list Lists all dependencies defined in the Chart.yaml file. --chart-repo, --output

Example: Listing Chart Dependencies

helm dependency list my-chart
Note: The helm dependency list command reads from the Chart.yaml and requirements.yaml files to display the dependencies.

Summary of Helm Dependency Commands

  • helm dependency list: Lists all dependencies defined in the chart.
  • helm dependency update: Updates dependencies based on Chart.yaml.
  • helm dependency build: Builds dependencies using Chart.lock.

5. Setting Minimum Kubernetes Version

Field Value Description
kubeVersion ">=1.20.0" Minimum Kubernetes version required for the chart

Example: kubeVersion in Chart.yaml

apiVersion: v2
name: my-app
version: 1.0.0
kubeVersion: ">=1.20.0"
Note: The kubeVersion field ensures that the chart is only installed on Kubernetes clusters that meet or exceed the specified version.

6. Adding Chart Maturity

Field Description Values Notes
maturity Indicates the maturity level of the chart experimental, beta, stable, deprecated Used for categorizing charts in repositories and dashboards

Example: Setting maturity in Chart.yaml

maturity: beta
Note: Setting maturity helps users understand the stability and support level of a chart.

7. Linking to Source Code

Field Description Example
sources List of URLs to the source code for this chart ["https://github.com/example/my-chart"]

Example: Defining Source URLs

sources:
  - https://github.com/example/my-chart
  - https://gitlab.com/example/my-chart
Note: The sources field is optional but recommended for transparency and maintainability.

8. Providing Support Contacts

Field Description Example
maintainers List of maintainers with name and email
[
  {
    "name": "John Doe",
    "email": "john.doe@example.com"
  }
]
sources List of URLs to project sources
[
  "https://github.com/example/project"
]
home URL to project homepage https://example.com/project
icon URL to project icon https://example.com/project/icon.png

Example: Maintainer Contact in Chart Metadata

maintainers:
- name: Jane Smith
  email: jane.smith@example.com
  url: https://github.com/janesmith
Note: Including support contact information helps users get help when they encounter issues with your chart.

9. Setting Chart License

Property Values Description
license MIT, Apache-2.0, GPL-3.0, etc. License identifier for the chart
licenseUrl https://example.com/license URL to the full license text

Example: Setting License in Chart.yaml

apiVersion: v2
name: my-app
description: A Helm chart for my application
version: 0.1.0
appVersion: "1.0"
license: MIT
licenseUrl: https://opensource.org/licenses/MIT

10. Adding Chart Category

Field Description Example
categories List of categories to which the chart belongs. Used for organizing charts in repositories. ["database", "web-server"]

Example: Setting Chart Categories

apiVersion: v2
name: my-app
version: 1.0.0
categories:
  - database
  - web-server

Was this article helpful?