commonAnnotations

为所有字段添加注释。

为所有资源添加注释,如果资源上已经存在注解键,该值将被覆盖。

  1. apiVersion: kustomize.config.k8s.io/v1beta1
  2. kind: Kustomization
  3. commonAnnotations:
  4. oncallPager: 800-555-1212

Example

输入文件

  1. # kustomization.yaml
  2. apiVersion: kustomize.config.k8s.io/v1beta1
  3. kind: Kustomization
  4. commonAnnotations:
  5. oncallPager: 800-555-1212
  6. resources:
  7. - deploy.yaml
  1. # deploy.yaml
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: example
  6. spec:
  7. ...

构建输出

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: example
  5. annotations:
  6. oncallPager: 800-555-1212
  7. spec:
  8. ...