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)
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:
# labels to add to all generated resources

View File

@@ -90,9 +90,9 @@ commonAnnotations:
Each entry in this list results in the creation of
one ConfigMap resource (it's a generator of n maps).
The example below creates two ConfigMaps. One with the
names and contents of the given files, the other with
key/value as data.
The example below creates three ConfigMaps. One with the names and contents of
the given files, one with key/value as data, and a third which sets an
annotation and label via generatorOptions for that single ConfigMap.
Each configMapGenerator item accepts a parameter of
`behavior: [create|replace|merge]`.
@@ -109,6 +109,14 @@ configMapGenerator:
literals:
- JAVA_HOME=/opt/java/jdk
- 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
@@ -651,6 +659,15 @@ secretGenerator:
envs:
- env.txt
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