Skip to content

Commit

Permalink
feat: Add support for extraConfigMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Maya Baya committed Jun 23, 2022
1 parent e6a2f66 commit ffc5700
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,26 @@ Mounting extra volumes
----------------------

Every file placed in `/mnt/extra-files` will be copied during startup to `/var/www/riotkit/`, this mechanism ensures that
no any file will be created with root-permissions inside of a `/var/www/riotkit` directory - mounting a volume directly could do so.
no any file will be created with root-permissions inside a `/var/www/riotkit` directory - mounting a volume directly could do so.

```yaml
# create extra ConfigMaps
extraConfigMaps:
- name: my-configmap-name
data:
something.php: |
<?php
echo "Hello anarchism!";
# create extra mounts
pv:
# Pod-level volumes section
extraVolumes:
- name: my-config
configMap:
name: my-configmap-name
# Container-level volumeMounts section
extraVolumeMounts:
- name: my-config
mountPath: /mnt/extra-files/wp-content/some-file.php
Expand Down
9 changes: 9 additions & 0 deletions helm/wordpress-hardened/templates/extra-configmaps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- range $attrs := $.Values.extraConfigMaps }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $attrs.name }}
data:
{{- toYaml $attrs.data | nindent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions helm/wordpress-hardened/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ rollingUpdate:
maxSurge: 1
maxUnavailable: 0

extraConfigMaps: []

pv:
wp:
enabled: true
Expand Down

0 comments on commit ffc5700

Please sign in to comment.