I have a kind: Namespace template yaml, as per below:
apiVersion: v1 kind: Namespace metadata: name: {{ .Values.namespace }} namespace: "" How do I make helm install create the above-given namespace ({{ .Values.namespace }}) if and only if above namespace ({{ .Values.namespace }}) doesn't exits in the pointed Kubernetes cluster?
Thanks.
To list the existing namespaces in a cluster 'kubectl get namespace' command is used. After executing the command, the following output will be generated: Observe that the Kubernetes object starts with four initial namespaces: Default, kube-node-lease, kube-public, and kube-system.
This feature is implemented in helm >= 3.2 (Pull Request)
Use --create-namespace in addition to --namespace <namespace>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With