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:
Alex Pyrgiotis
2020-05-15 17:50:52 +00:00
parent 844824e8e9
commit e1087cdfbc

View File

@@ -596,8 +596,15 @@ secretGenerator:
- site_key.txt
- secret_key.txt
patchesStrategicMerge:
- configmap.yaml
# Updating the ConfigMap works with generators as well.
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:
- target:
@@ -621,18 +628,6 @@ cat <<EOF >$RECAPTCHA/deployment.yaml
mountPath: /var/run/secrets/recaptcha/
name: recaptcha
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
@@ -714,7 +709,6 @@ Now the workspace has following directories:
│ │ ├── kustomization.yaml
│ │ └── ldappass.txt
│ └── recaptcha
│ ├── configmap.yaml
│ ├── deployment.yaml
│ ├── kustomization.yaml
│ ├── secret_key.txt