namePrefix

Prepends the value to the names of all resources and references.

As namePrefix is self explanatory, it helps adding prefix to names in the defined yaml files.

Example

File Input

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

Build Output

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

References

Apply will propagate the namePrefix to any place Resources within the project are referenced by other Resources including:

  • Service references from StatefulSets
  • ConfigMap references from PodSpecs
  • Secret references from PodSpecs