Kustomize
Kustomize is a Kubernetes native configuration management tool.
Help vs. Kustomize
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.
Style Guide
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
(withconfigMapGenerator
) andSecret
(withsecretGenerator
) 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 resourceapiVersion
instead of<kind>
in the case where a single file stores multiple resources. E.g. userbac
for the RBAC example above.
Project Layout
Reference
Last updated