mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
docs: Document per-resource generatorOptions
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user