mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Add a configMapGenerator to the example
Slightly alter the reCAPTCHA component to use a `configMapGenerator`, instead of patching the base `ConfigMap` as in the rest of the components, to show that this is supported as well.
This commit is contained in:
@@ -596,8 +596,15 @@ secretGenerator:
|
|||||||
- site_key.txt
|
- site_key.txt
|
||||||
- secret_key.txt
|
- secret_key.txt
|
||||||
|
|
||||||
patchesStrategicMerge:
|
# Updating the ConfigMap works with generators as well.
|
||||||
- configmap.yaml
|
configMapGenerator:
|
||||||
|
- name: conf
|
||||||
|
behavior: merge
|
||||||
|
literals:
|
||||||
|
- recaptcha.conf=|
|
||||||
|
enabled=true
|
||||||
|
site_key=/var/run/secrets/recaptcha/site_key.txt
|
||||||
|
secret_key=/var/run/secrets/recaptcha/secret_key.txt
|
||||||
|
|
||||||
patchesJson6902:
|
patchesJson6902:
|
||||||
- target:
|
- target:
|
||||||
@@ -621,18 +628,6 @@ cat <<EOF >$RECAPTCHA/deployment.yaml
|
|||||||
mountPath: /var/run/secrets/recaptcha/
|
mountPath: /var/run/secrets/recaptcha/
|
||||||
name: recaptcha
|
name: recaptcha
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF >$RECAPTCHA/configmap.yaml
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: conf
|
|
||||||
data:
|
|
||||||
recaptcha.conf: |
|
|
||||||
enabled=true
|
|
||||||
site_key=/var/run/secrets/recaptcha/site_key.txt
|
|
||||||
secret_key=/var/run/secrets/recaptcha/secret_key.txt
|
|
||||||
EOF
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Define a `community` variant, that bundles the external DB and reCAPTCHA
|
Define a `community` variant, that bundles the external DB and reCAPTCHA
|
||||||
@@ -714,7 +709,6 @@ Now the workspace has following directories:
|
|||||||
│ │ ├── kustomization.yaml
|
│ │ ├── kustomization.yaml
|
||||||
│ │ └── ldappass.txt
|
│ │ └── ldappass.txt
|
||||||
│ └── recaptcha
|
│ └── recaptcha
|
||||||
│ ├── configmap.yaml
|
|
||||||
│ ├── deployment.yaml
|
│ ├── deployment.yaml
|
||||||
│ ├── kustomization.yaml
|
│ ├── kustomization.yaml
|
||||||
│ ├── secret_key.txt
|
│ ├── secret_key.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user