Kustomize
Last updated
Last updated
Kustomize is a Kubernetes native configuration management tool.
Helm templates consist of:
Templated YAML files (the template)
A values file (template variables)
Kustomized files consist of:
Base YAML files (the base)
A modifications file (the overlay)
On the surface, these two approaches seem similar. However, they’re fundamentally different.
Kustomizations should be treated as code and code should be clean.
Use kustomize cfg fmt
to format your yaml configuration. It will ensure consistent field ordering and indentation.
Always use generators to emit ConfigMap
(with configMapGenerator
) and Secret
(with secretGenerator
) resources. Generators add a content hash to the resource name which ensures that rolling updates are triggered when the content changes.
Use a consistent naming scheme for resources. We recommend the following format: <metadata.name>.<lowercase(kind)>.yaml
. Use the most significant part of a resource apiVersion
instead of <kind>
in the case where a single file stores multiple resources. E.g. use rbac
for the RBAC example above.