Creating, Developing, and Testing a Helm Chart
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:
| Annotation | Description | Example |
|---|---|---|
type |
Helm in Practice
Designing, Deploying, and Operating Kubernetes Applications at ScaleEnroll 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!
Hurry! This limited time offer ends in:
To redeem this offer, copy the coupon code below and apply it at checkout:
