feat(ceilometer): allow users to provide configs in ceilometer.conf.d

Allow users to provide additional projected volumes to be mounted into
the various deployments, statefulsets, and jobs that the ceilometer chart has
in the /etc/ceilometer/ceilometer.conf.d/ path. This allows for users to provide
service account or database secrets via different operators as well as
provide ways to use the chart to define common deployments while being
able to have site specific overrides.

Change-Id: If6759cebe20430f4547f933171496effbb320b98
Signed-off-by: Mathieu Gagné <mgagne@calavera.ca>
This commit is contained in:
Mathieu Gagné
2026-02-19 15:54:06 -05:00
parent de768d35e6
commit 2c9753c8bd
10 changed files with 75 additions and 4 deletions

View File

@@ -18,4 +18,5 @@ set -ex
exec ceilometer-polling \
--polling-namespaces central \
--config-file /etc/ceilometer/ceilometer.conf
--config-file /etc/ceilometer/ceilometer.conf \
--config-dir /etc/ceilometer/ceilometer.conf.d

View File

@@ -18,4 +18,5 @@ set -ex
exec ceilometer-polling \
--polling-namespaces compute \
--config-file /etc/ceilometer/ceilometer.conf
--config-file /etc/ceilometer/ceilometer.conf \
--config-dir /etc/ceilometer/ceilometer.conf.d

View File

@@ -18,4 +18,5 @@ set -ex
exec ceilometer-polling \
--polling-namespaces ipmi \
--config-file /etc/ceilometer/ceilometer.conf
--config-file /etc/ceilometer/ceilometer.conf \
--config-dir /etc/ceilometer/ceilometer.conf.d

View File

@@ -17,4 +17,5 @@ limitations under the License.
set -ex
exec ceilometer-agent-notification \
--config-file /etc/ceilometer/ceilometer.conf
--config-file /etc/ceilometer/ceilometer.conf \
--config-dir /etc/ceilometer/ceilometer.conf.d

View File

@@ -20,6 +20,8 @@ limitations under the License.
{{- $serviceAccountName := "ceilometer-compute" }}
{{ tuple $envAll "compute" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $etcSources := .Values.pod.etcSources.ceilometer_compute }}
---
apiVersion: apps/v1
kind: DaemonSet
@@ -72,6 +74,9 @@ spec:
mountPath: /etc/ceilometer/ceilometer.conf
subPath: ceilometer.conf
readOnly: true
- name: ceilometer-etc-snippets
mountPath: /etc/ceilometer/ceilometer.conf.d/
readOnly: true
- name: ceilometer-etc
mountPath: /etc/ceilometer/api_paste.ini
subPath: api_paste.ini
@@ -125,6 +130,14 @@ spec:
secret:
secretName: ceilometer-etc
defaultMode: 0444
- name: ceilometer-etc-snippets
{{- if $etcSources }}
projected:
sources:
{{ toYaml $etcSources | indent 14 }}
{{- else }}
emptyDir: {}
{{ end }}
- name: ceilometer-bin
configMap:
name: ceilometer-bin

View File

@@ -20,6 +20,8 @@ limitations under the License.
{{- $serviceAccountName := "ceilometer-ipmi" }}
{{ tuple $envAll "ipmi" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $etcSources := .Values.pod.etcSources.ceilometer_ipmi }}
---
apiVersion: apps/v1
kind: DaemonSet
@@ -74,6 +76,9 @@ spec:
mountPath: /etc/ceilometer/ceilometer.conf
subPath: ceilometer.conf
readOnly: true
- name: ceilometer-etc-snippets
mountPath: /etc/ceilometer/ceilometer.conf.d/
readOnly: true
- name: ceilometer-etc
mountPath: /etc/ceilometer/api_paste.ini
subPath: api_paste.ini
@@ -119,6 +124,14 @@ spec:
secret:
secretName: ceilometer-etc
defaultMode: 0444
- name: ceilometer-etc-snippets
{{- if $etcSources }}
projected:
sources:
{{ toYaml $etcSources | indent 14 }}
{{- else }}
emptyDir: {}
{{ end }}
- name: ceilometer-bin
configMap:
name: ceilometer-bin

View File

@@ -20,6 +20,8 @@ limitations under the License.
{{- $serviceAccountName := "ceilometer-central" }}
{{ tuple $envAll "central" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $etcSources := .Values.pod.etcSources.ceilometer_central }}
---
apiVersion: apps/v1
kind: Deployment
@@ -70,6 +72,9 @@ spec:
mountPath: /etc/ceilometer/ceilometer.conf
subPath: ceilometer.conf
readOnly: true
- name: ceilometer-etc-snippets
mountPath: /etc/ceilometer/ceilometer.conf.d/
readOnly: true
- name: ceilometer-etc
mountPath: /etc/ceilometer/api_paste.ini
subPath: api_paste.ini
@@ -112,6 +117,14 @@ spec:
secret:
secretName: ceilometer-etc
defaultMode: 0444
- name: ceilometer-etc-snippets
{{- if $etcSources }}
projected:
sources:
{{ toYaml $etcSources | indent 14 }}
{{- else }}
emptyDir: {}
{{ end }}
- name: ceilometer-bin
configMap:
name: ceilometer-bin

View File

@@ -20,6 +20,8 @@ limitations under the License.
{{- $serviceAccountName := "ceilometer-notification" }}
{{ tuple $envAll "notification" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $etcSources := .Values.pod.etcSources.ceilometer_notification }}
---
apiVersion: apps/v1
kind: Deployment
@@ -70,6 +72,9 @@ spec:
mountPath: /etc/ceilometer/ceilometer.conf
subPath: ceilometer.conf
readOnly: true
- name: ceilometer-etc-snippets
mountPath: /etc/ceilometer/ceilometer.conf.d/
readOnly: true
- name: ceilometer-etc
mountPath: /etc/ceilometer/api_paste.ini
subPath: api_paste.ini
@@ -116,6 +121,14 @@ spec:
secret:
secretName: ceilometer-etc
defaultMode: 0444
- name: ceilometer-etc-snippets
{{- if $etcSources }}
projected:
sources:
{{ toYaml $etcSources | indent 14 }}
{{- else }}
emptyDir: {}
{{ end }}
- name: ceilometer-bin
configMap:
name: ceilometer-bin

View File

@@ -1533,6 +1533,14 @@ pod:
ceilometer_db_sync:
volumeMounts:
volumes:
# -- This allows users to add Kubernetes Projected Volumes to be mounted at /etc/ceilometer/ceilometer.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:
ceilometer_compute: []
ceilometer_central: []
ceilometer_ipmi: []
ceilometer_notification: []
replicas:
central: 1
notification: 1

View File

@@ -0,0 +1,7 @@
---
ceilometer:
- |
Allow users to add additional sources to the Projected Volume that is mounted
at /etc/ceilometer/ceilometer.conf.d/ so they may more easily override configs or provide
additional configs for the various services in the chart.
...