Feedback

Chat Icon

Helm in Practice

Designing, Deploying, and Operating Kubernetes Applications at Scale

Creating, Developing, and Testing a Helm Chart
54%

Generating a Schema for Values File

This section is optional but recommended to make your chart typo-proof and developer-friendly. The values.schema.json file defines a JSON schema that validates values during helm lint, helm install, and helm upgrade.

Adding Schema Annotations

The helm-schema plugin can generate a schema automatically from your values.yaml. To fine-tune the generated schema, you can add annotations using special # @schema comment blocks. Here is a sample values.yaml with schema annotations:

# @schema
# type: integer
# minimum: 1
# @schema
replicaCount: 1

# @schema
# type: object
# required: [repository]
# @schema
image:
  # @schema
  # type: string
  # @schema
  repository: todo-app
  # @schema
  # enum: [Always, IfNotPresent, Never]
  # @schema
  pullPolicy: IfNotPresent

# @schema
# type: object
# additionalProperties: true
# @schema
imageCredentials:
  # @schema
  # type: boolean
  # @schema
  create: false

# @schema
# enum: [ClusterIP, NodePort, LoadBalancer]
# @schema
service:
  type: ClusterIP
  # @schema
  # type: integer
  # minimum: 1
  # maximum: 65535
  # @schema
  port: 5000

Common annotations:

AnnotationDescriptionExample
type

Helm in Practice

Designing, Deploying, and Operating Kubernetes Applications at Scale

Enroll now to unlock current content and receive all future updates for free. Your purchase supports the author and fuels the creation of more exciting content. Act fast, as the price will rise as the course nears completion!

Unlock now  $15.99$11.99

Hurry! This limited time offer ends in:

To redeem this offer, copy the coupon code below and apply it at checkout:

Learn More