Kustomize: Add generatorOptions

Created on 19 Oct 2018  路  6Comments  路  Source: kubernetes-sigs/kustomize

Add an option field in kustomization.yaml to

  • allow disable appending namehash to generated secrets/configmaps #459
  • allow add annotations/labels #353
  • allow setting shell #362
  • set timeout for executing command, move timeout from SecretGenerator to GeneratorOptions

These options will have a global impact. All configmapGenerator and secretGenerator in one kustomization.yaml will follow the same option.

kinfeature

Most helpful comment

Cool!

I wonder: what was the motivation to implement this only as a global option, and not specific to single generators?

Maybe in the future it could be also specified like this:

configMapGenerator:
- name: ldap-configmap
  generatorOptions:
   disableHash: true

All 6 comments

Add documentation as well.

doc PR #501

Cool!

I wonder: what was the motivation to implement this only as a global option, and not specific to single generators?

Maybe in the future it could be also specified like this:

configMapGenerator:
- name: ldap-configmap
  generatorOptions:
   disableHash: true

Following up on @schweikert's request, I'd like to be able to add different labels to my generated resources.

E.g.

commonLabels:
  app: logging

configMapGenerator:
- name: fluent-bit
  labels:
    component: fluent-bit
  files:
  - fluent-bit.conf
  - parsers.conf
- name: fluentd
  labels:
    component: fluentd
  files:
  - fluentd.conf

secretGenerator:
- name: fluentd
  labels:
    component: fluentd
  commands:
    ...
  type: Opaque

@mgoodness You can put the secrets into different bases, each base with a different generatorOptions

@Liujingfang1 ah yes, of course. Thanks!

Was this page helpful?
0 / 5 - 0 ratings