docs: Document per-resource generatorOptions

This commit is contained in:
Chance Zibolski
2020-02-26 09:53:08 -08:00
parent 62f21cbe69
commit aec264d2b5
2 changed files with 24 additions and 3 deletions

View File

@@ -131,6 +131,10 @@ crds:
Modifies behavior of all [ConfigMap](#configmapgenerator) Modifies behavior of all [ConfigMap](#configmapgenerator)
and [Secret](#secretgenerator) generators. and [Secret](#secretgenerator) generators.
Additionally, generatorOptions can be set on a per resource level within each
generator. For details on per-resource generatorOptions usage see
[field-name-configMapGenerator] and See [field-name-secretGenerator].
``` ```
generatorOptions: generatorOptions:
# labels to add to all generated resources # labels to add to all generated resources

View File

@@ -90,9 +90,9 @@ commonAnnotations:
Each entry in this list results in the creation of Each entry in this list results in the creation of
one ConfigMap resource (it's a generator of n maps). one ConfigMap resource (it's a generator of n maps).
The example below creates two ConfigMaps. One with the The example below creates three ConfigMaps. One with the names and contents of
names and contents of the given files, the other with the given files, one with key/value as data, and a third which sets an
key/value as data. annotation and label via generatorOptions for that single ConfigMap.
Each configMapGenerator item accepts a parameter of Each configMapGenerator item accepts a parameter of
`behavior: [create|replace|merge]`. `behavior: [create|replace|merge]`.
@@ -109,6 +109,14 @@ configMapGenerator:
literals: literals:
- JAVA_HOME=/opt/java/jdk - JAVA_HOME=/opt/java/jdk
- JAVA_TOOL_OPTIONS=-agentlib:hprof - JAVA_TOOL_OPTIONS=-agentlib:hprof
- name: dashboards
files:
- mydashboard.json
generatorOptions:
annotations:
dashboard: "1"
labels:
app.kubernetes.io/name: "app1"
``` ```
It is also possible to It is also possible to
@@ -651,6 +659,15 @@ secretGenerator:
envs: envs:
- env.txt - env.txt
type: Opaque type: Opaque
- name: secret-with-annotation
files:
- app-config.yaml
type: Opaque
generatorOptions:
annotations:
app_config: "true"
labels:
app.kubernetes.io/name: "app2"
``` ```
### Usage via plugin ### Usage via plugin