Files
kustomize/site/content/en/docs/Reference/API/namespace.md
2023-09-14 12:40:54 +09:00

913 B

title, linkTitle, type, weight, description
title linkTitle type weight description
namespace namespace docs 12 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

# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: the-deployment
  namespace: the-namespace
spec:
  replicas: 5
  template:
    containers:
      - name: the-container
        image: registry/container:latest
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: kustomize-namespace

resources:
- deployment.yaml

Build Output

apiVersion: apps/v1
kind: Deployment
metadata:
  name: the-deployment
  namespace: kustomize-namespace
spec:
  replicas: 5
  template:
    containers:
    - image: registry/container:latest
      name: the-container