diff --git a/aodh/templates/bin/_aodh-alarms-cleaner.sh.tpl b/aodh/templates/bin/_aodh-alarms-cleaner.sh.tpl index 36e7111827..f92357c2dc 100644 --- a/aodh/templates/bin/_aodh-alarms-cleaner.sh.tpl +++ b/aodh/templates/bin/_aodh-alarms-cleaner.sh.tpl @@ -16,4 +16,6 @@ limitations under the License. set -ex -exec aodh-expirer +exec aodh-expirer \ + --config-file=/etc/aodh/aodh.conf \ + --config-dir=/etc/aodh/aodh.conf.d diff --git a/aodh/templates/bin/_aodh-evaluator.sh.tpl b/aodh/templates/bin/_aodh-evaluator.sh.tpl index 55104009f6..c9491a9d84 100644 --- a/aodh/templates/bin/_aodh-evaluator.sh.tpl +++ b/aodh/templates/bin/_aodh-evaluator.sh.tpl @@ -18,4 +18,6 @@ limitations under the License. set -ex -exec aodh-evaluator --config-file=/etc/aodh/aodh.conf +exec aodh-evaluator \ + --config-file=/etc/aodh/aodh.conf \ + --config-dir=/etc/aodh/aodh.conf.d diff --git a/aodh/templates/bin/_aodh-listener.sh.tpl b/aodh/templates/bin/_aodh-listener.sh.tpl index b833c974ef..54fdd0dfa9 100644 --- a/aodh/templates/bin/_aodh-listener.sh.tpl +++ b/aodh/templates/bin/_aodh-listener.sh.tpl @@ -18,4 +18,6 @@ limitations under the License. set -ex -exec aodh-listener --config-file=/etc/aodh/aodh.conf +exec aodh-listener \ + --config-file=/etc/aodh/aodh.conf \ + --config-dir=/etc/aodh/aodh.conf.d diff --git a/aodh/templates/bin/_aodh-notifier.sh.tpl b/aodh/templates/bin/_aodh-notifier.sh.tpl index beba9f1ec8..73be32084f 100644 --- a/aodh/templates/bin/_aodh-notifier.sh.tpl +++ b/aodh/templates/bin/_aodh-notifier.sh.tpl @@ -18,4 +18,6 @@ limitations under the License. set -ex -exec aodh-notifier --config-file=/etc/aodh/aodh.conf +exec aodh-notifier \ + --config-file=/etc/aodh/aodh.conf \ + --config-dir=/etc/aodh/aodh.conf.d diff --git a/aodh/templates/cron-job-alarms-cleaner.yaml b/aodh/templates/cron-job-alarms-cleaner.yaml index ec0b58f7ad..5cf07d2cd1 100644 --- a/aodh/templates/cron-job-alarms-cleaner.yaml +++ b/aodh/templates/cron-job-alarms-cleaner.yaml @@ -22,6 +22,8 @@ limitations under the License. {{- $serviceAccountName := "aodh-alarms-cleaner" }} {{ tuple $envAll "alarms_cleaner" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.aodh_alarms_cleaner }} --- apiVersion: batch/v1 kind: CronJob @@ -72,6 +74,9 @@ spec: mountPath: /etc/aodh/aodh.conf subPath: aodh.conf readOnly: true + - name: aodh-etc-snippets + mountPath: /etc/aodh/aodh.conf.d/ + readOnly: true {{- if .Values.conf.aodh.DEFAULT.log_config_append }} - name: aodh-etc mountPath: {{ .Values.conf.aodh.DEFAULT.log_config_append }} @@ -88,6 +93,14 @@ spec: secret: secretName: aodh-etc defaultMode: 0444 + - name: aodh-et-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 18 }} +{{- else }} + emptyDir: {} +{{ end }} - name: aodh-bin configMap: name: aodh-bin diff --git a/aodh/templates/deployment-api.yaml b/aodh/templates/deployment-api.yaml index 769195515a..179f056dab 100644 --- a/aodh/templates/deployment-api.yaml +++ b/aodh/templates/deployment-api.yaml @@ -22,6 +22,8 @@ limitations under the License. {{- $serviceAccountName := "aodh-api" }} {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.aodh_api }} --- apiVersion: apps/v1 kind: Deployment @@ -90,6 +92,9 @@ spec: mountPath: /etc/aodh/aodh.conf subPath: aodh.conf readOnly: true + - name: aodh-etc-snippets + mountPath: /etc/aodh/aodh.conf.d/ + readOnly: true {{- if .Values.conf.aodh.DEFAULT.log_config_append }} - name: aodh-etc mountPath: {{ .Values.conf.aodh.DEFAULT.log_config_append }} @@ -124,6 +129,14 @@ spec: secret: secretName: aodh-etc defaultMode: 0444 + - name: aodh-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: aodh-bin configMap: name: aodh-bin diff --git a/aodh/templates/deployment-evaluator.yaml b/aodh/templates/deployment-evaluator.yaml index 2f6b88614c..943d83afa8 100644 --- a/aodh/templates/deployment-evaluator.yaml +++ b/aodh/templates/deployment-evaluator.yaml @@ -22,6 +22,8 @@ limitations under the License. {{- $serviceAccountName := "aodh-evaluator" }} {{ tuple $envAll "evaluator" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.aodh_evaluator }} --- apiVersion: apps/v1 kind: Deployment @@ -81,6 +83,9 @@ spec: mountPath: /etc/aodh/aodh.conf subPath: aodh.conf readOnly: true + - name: aodh-etc-snippets + mountPath: /etc/aodh/aodh.conf.d/ + readOnly: true {{- if .Values.conf.aodh.DEFAULT.log_config_append }} - name: aodh-etc mountPath: {{ .Values.conf.aodh.DEFAULT.log_config_append }} @@ -105,6 +110,14 @@ spec: secret: secretName: aodh-etc defaultMode: 0444 + - name: aodh-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: aodh-bin configMap: name: aodh-bin diff --git a/aodh/templates/deployment-listener.yaml b/aodh/templates/deployment-listener.yaml index cca9fb1669..0e57ba5a73 100644 --- a/aodh/templates/deployment-listener.yaml +++ b/aodh/templates/deployment-listener.yaml @@ -22,6 +22,8 @@ limitations under the License. {{- $serviceAccountName := "aodh-listener" }} {{ tuple $envAll "listener" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.aodh_listener }} --- apiVersion: apps/v1 kind: Deployment @@ -81,6 +83,9 @@ spec: mountPath: /etc/aodh/aodh.conf subPath: aodh.conf readOnly: true + - name: aodh-etc-snippets + mountPath: /etc/aodh/aodh.conf.d/ + readOnly: true {{- if .Values.conf.aodh.DEFAULT.log_config_append }} - name: aodh-etc mountPath: {{ .Values.conf.aodh.DEFAULT.log_config_append }} @@ -105,6 +110,14 @@ spec: secret: secretName: aodh-etc defaultMode: 0444 + - name: aodh-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: aodh-bin configMap: name: aodh-bin diff --git a/aodh/templates/deployment-notifier.yaml b/aodh/templates/deployment-notifier.yaml index eed5d80b0c..d59c8a0978 100644 --- a/aodh/templates/deployment-notifier.yaml +++ b/aodh/templates/deployment-notifier.yaml @@ -22,6 +22,8 @@ limitations under the License. {{- $serviceAccountName := "aodh-notifier" }} {{ tuple $envAll "notifier" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.aodh_notifier }} --- apiVersion: apps/v1 kind: Deployment @@ -81,6 +83,9 @@ spec: mountPath: /etc/aodh/aodh.conf subPath: aodh.conf readOnly: true + - name: aodh-etc-snippets + mountPath: /etc/aodh/aodh.conf.d/ + readOnly: true {{- if .Values.conf.aodh.DEFAULT.log_config_append }} - name: aodh-etc mountPath: {{ .Values.conf.aodh.DEFAULT.log_config_append }} @@ -105,6 +110,14 @@ spec: secret: secretName: aodh-etc defaultMode: 0444 + - name: aodh-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: aodh-bin configMap: name: aodh-bin diff --git a/aodh/values.yaml b/aodh/values.yaml index 92d4638cc5..384d53392f 100644 --- a/aodh/values.yaml +++ b/aodh/values.yaml @@ -148,6 +148,15 @@ pod: aodh_db_sync: volumeMounts: volumes: + # -- This allows users to add Kubernetes Projected Volumes to be mounted at /etc/aodh/aodh.conf.d/ + ## This is a list of projected volume source objects for each deployment/statefulset/daemonset/cronjob + ## https://kubernetes.io/docs/concepts/storage/projected-volumes/ + etcSources: + aodh_api: [] + aodh_evaluator: [] + aodh_listener: [] + aodh_notifier: [] + aodh_alarms_cleaner: [] replicas: api: 1 evaluator: 1 diff --git a/releasenotes/notes/aodh-1002dad350db1c60.yaml b/releasenotes/notes/aodh-1002dad350db1c60.yaml new file mode 100644 index 0000000000..94069252d8 --- /dev/null +++ b/releasenotes/notes/aodh-1002dad350db1c60.yaml @@ -0,0 +1,7 @@ +--- +aodh: + - | + Allow users to add additional sources to the Projected Volume that is mounted + at /etc/aodh/aodh.conf.d/ so they may more easily override configs or provide + additional configs for the various services in the chart. +...