namespace

Adds namespace to all resources.

Will override the existing namespace if it is set on a resource, or add it if it is not set on a resource.

Example

File Input

  1. # deployment.yaml
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: the-deployment
  6. namespace: the-namespace
  7. spec:
  8. replicas: 5
  9. template:
  10. containers:
  11. - name: the-container
  12. image: registry/conatiner:latest
  1. # kustomization.yaml
  2. apiVersion: kustomize.config.k8s.io/v1beta1
  3. kind: Kustomization
  4. namespace: kustomize-namespace
  5. resources:
  6. - deployment.yaml

Build Output

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: the-deployment
  5. namespace: kustomize-namespace
  6. spec:
  7. replicas: 5
  8. template:
  9. containers:
  10. - image: registry/conatiner:latest
  11. name: the-container