The data source kubectl_path_documents
now supports terraform template evaluation performed during loading documents from file 🎉 This gives you the flexibility of parameterizing your manifests, and loading & templating in a single command.
#
# Given the following YAML template
#
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
name: nginx
spec:
containers:
- name: nginx
image: ${docker_image}
ports:
- containerPort: 80
#
# Load the yaml file, parsing the ${docker_image} variable
#
data "kubectl_path_documents" "manifests" {
pattern = "./manifests/*.yaml"
vars = {
docker_image = "https://myregistry.example.com/nginx"
}
}
All the terraform hcl template features are supported (e.g. directives).
You can now also disable the waiting for rollout behavior via the wait_for_rollout
parameter. By default, the kubectl-provider will wait for Deployments/DaemonSets/APIServices to finish rollout before proceeding. Set this flag to false to disable this behavior.