instruction: Provide Kubernetes YAML for configuration
output: ```yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
   name: my-nginx
  spec:
   selector:
   matchLabels:
   run: my-nginx
   replicas: 2
   template:
   metadata:
   labels:
   run: my-nginx
   spec:
   containers:
   - name: my-nginx
   image: nginx
   ports:
   - containerPort: 80
  EOF
  
  # Create a kustomization.yaml
  cat <<EOF >./kustomization.yaml
  namePrefix: dev-
  labels:
   - pairs:
   app: my-nginx
   includeSelectors: true
  resources:
  - deployment.yaml
  EOF
  Run the following command to apply the Deployment object dev-my-nginx:> kubectl apply -k ./
  deployment.apps/dev-my-nginx created
  Run one of the following commands to view the Deployment object dev-my-nginx:kubectl get -k ./
  kubectl describe -k ./
  Run the following command to compare the Deployment object dev-my-nginx against the state
  that the cluster would be in if the manifest was applied:kubectl diff -k ./
  Run the following command to delete the Deployment object dev-my-nginx:> kubectl delete -k ./
  deployment.apps "dev-my-nginx" deleted
  Kustomize Feature ListFieldTypeExplanationbases[]stringEach entry in this list should resolve to a directory containing a kustomization.yaml filecommonAnnotationsmap[string]stringannotations to add to all resourcescommonLabelsmap[string]stringlabels to add to all resources and selectorsconfigMapGenerator[]ConfigMapArgsEach entry in this list generates a ConfigMapconfigurations[]stringEach entry in this list should resolve to a file containing Kustomize transformer configurationscrds[]stringEach entry in this list should resolve to an OpenAPI definition file for Kubernetes typesgeneratorOptionsGeneratorOptionsModify behaviors of all ConfigMap and Secret generatorimages[]ImageEach entry is to modify the name, tags and/or digest for one image without creating patcheslabelsmap[string]stringAdd labels without automically injecting corresponding selectorsnamePrefixstringvalue of this field is prepended to the names of all resourcesnameSuffixstringvalue of this field is appended to the names of all resourcespatchesJson6902[]PatchEach entry in this list should resolve to a Kubernetes object and a Json PatchpatchesStrategicMerge[]stringEach entry in this list should resolve a strategic merge patch of a Kubernetes objectreplacements[]Replacementscopy the value from a resource's field into any number of specified targets.resources[]stringEach entry in this list must resolve to an existing resource configuration filesecretGenerator[]SecretArgsEach entry in this list generates a Secretvars[]VarEach entry is to capture text from one resource's fieldWhat's nextKustomizeKubectl BookKubectl Command ReferenceKubernetes API ReferenceFeedbackWas this page helpful?Yes
  NoThanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on
  Stack Overflow.
  Open an issue in the GitHub Repository if you want to
  report a problem
  or
  suggest an improvement.Last modified July 02, 2025 at 8:38 AM PST: Fix: Quote newTag in kustomization.yaml example to avoid YAML error (daac1574b4)  Create child page
   Create an issue
   Print entire sectionBefore you beginOverview of KustomizeGenerating ResourcesSetting cross-cutting fieldsComposing and Customizing ResourcesBases and OverlaysHow to apply/view/delete objects using KustomizeKustomize Feature ListWhat's next© 2025 The Kubernetes Authors | Documentation Distributed under CC BY 4.0© 2025 The Linux Foundation ®. ```