From e7b2e1ec4dc86f73f20bc6cc937fcda249216429 Mon Sep 17 00:00:00 2001 From: Thiago Brito Date: Tue, 22 Mar 2022 15:34:03 -0300 Subject: [PATCH] Enable taint toleration for ceilometer This changes use the helm-toolkit template for toleration in openstack services Signed-off-by: Lucas Cavalcante Story: 2009276 Task: 43531 Depends-On: I168837f962465d1c89acc511b7bf4064ac4b546c Change-Id: I482236b1177b04ddc5e3cd17e92ac7a896f9314e --- ceilometer/Chart.yaml | 2 +- ceilometer/templates/daemonset-compute.yaml | 3 +++ ceilometer/templates/daemonset-ipmi.yaml | 3 +++ ceilometer/templates/deployment-api.yaml | 3 +++ ceilometer/templates/deployment-central.yaml | 3 +++ ceilometer/templates/deployment-collector.yaml | 3 +++ ceilometer/templates/deployment-notification.yaml | 3 +++ ceilometer/templates/job-bootstrap.yaml | 3 +++ ceilometer/templates/job-db-drop.yaml | 3 +++ ceilometer/templates/job-db-init-mongodb.yaml | 3 +++ ceilometer/templates/job-db-init.yaml | 3 +++ ceilometer/templates/job-db-sync.yaml | 3 +++ ceilometer/templates/job-image-repo-sync.yaml | 3 +++ ceilometer/templates/job-ks-endpoints.yaml | 7 +++++-- ceilometer/templates/job-ks-service.yaml | 3 +++ ceilometer/templates/job-ks-user.yaml | 3 +++ ceilometer/templates/job-rabbit-init.yaml | 3 +++ ceilometer/templates/pod-rally-test.yaml | 3 +++ ceilometer/values.yaml | 7 +++++++ releasenotes/notes/ceilometer.yaml | 1 + 20 files changed, 62 insertions(+), 3 deletions(-) diff --git a/ceilometer/Chart.yaml b/ceilometer/Chart.yaml index 0d22ccc3b2..c304caa350 100644 --- a/ceilometer/Chart.yaml +++ b/ceilometer/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceilometer name: ceilometer -version: 0.2.2 +version: 0.2.3 home: https://docs.openstack.org/ceilometer/latest/ sources: - https://opendev.org/openstack/ceilometer diff --git a/ceilometer/templates/daemonset-compute.yaml b/ceilometer/templates/daemonset-compute.yaml index d7047381ac..983833c55c 100644 --- a/ceilometer/templates/daemonset-compute.yaml +++ b/ceilometer/templates/daemonset-compute.yaml @@ -51,6 +51,9 @@ spec: dnsPolicy: ClusterFirstWithHostNet nodeSelector: {{ .Values.labels.compute.node_selector_key }}: {{ .Values.labels.compute.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} initContainers: {{ tuple $envAll "compute" $mounts_ceilometer_compute_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/ceilometer/templates/daemonset-ipmi.yaml b/ceilometer/templates/daemonset-ipmi.yaml index 58f0e40b8c..a5b254ed71 100644 --- a/ceilometer/templates/daemonset-ipmi.yaml +++ b/ceilometer/templates/daemonset-ipmi.yaml @@ -51,6 +51,9 @@ spec: dnsPolicy: ClusterFirstWithHostNet nodeSelector: {{ .Values.labels.ipmi.node_selector_key }}: {{ .Values.labels.ipmi.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} initContainers: {{ tuple $envAll "ipmi" $mounts_ceilometer_ipmi_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/ceilometer/templates/deployment-api.yaml b/ceilometer/templates/deployment-api.yaml index 1cc3a2fc54..2300f4cfc9 100644 --- a/ceilometer/templates/deployment-api.yaml +++ b/ceilometer/templates/deployment-api.yaml @@ -49,6 +49,9 @@ spec: {{ tuple $envAll "ceilometer" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }} initContainers: {{ tuple $envAll "api" $mounts_ceilometer_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} diff --git a/ceilometer/templates/deployment-central.yaml b/ceilometer/templates/deployment-central.yaml index 12efc64e38..b38870a438 100644 --- a/ceilometer/templates/deployment-central.yaml +++ b/ceilometer/templates/deployment-central.yaml @@ -49,6 +49,9 @@ spec: {{ tuple $envAll "ceilometer" "central" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.central.node_selector_key }}: {{ .Values.labels.central.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} initContainers: {{ tuple $envAll "central" $mounts_ceilometer_central_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/ceilometer/templates/deployment-collector.yaml b/ceilometer/templates/deployment-collector.yaml index a5b3117254..25a4e3e976 100644 --- a/ceilometer/templates/deployment-collector.yaml +++ b/ceilometer/templates/deployment-collector.yaml @@ -49,6 +49,9 @@ spec: {{ tuple $envAll "ceilometer" "collector" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.collector.node_selector_key }}: {{ .Values.labels.collector.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} initContainers: {{ tuple $envAll "collector" $mounts_ceilometer_collector_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/ceilometer/templates/deployment-notification.yaml b/ceilometer/templates/deployment-notification.yaml index 1f65ad2121..1559431118 100644 --- a/ceilometer/templates/deployment-notification.yaml +++ b/ceilometer/templates/deployment-notification.yaml @@ -49,6 +49,9 @@ spec: {{ tuple $envAll "ceilometer" "notification" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.notification.node_selector_key }}: {{ .Values.labels.notification.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} initContainers: {{ tuple $envAll "notification" $mounts_ceilometer_notification_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/ceilometer/templates/job-bootstrap.yaml b/ceilometer/templates/job-bootstrap.yaml index 8572a79794..cc72fb44aa 100644 --- a/ceilometer/templates/job-bootstrap.yaml +++ b/ceilometer/templates/job-bootstrap.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if and .Values.manifests.job_bootstrap .Values.bootstrap.enabled }} {{- $bootstrapJob := dict "envAll" . "serviceName" "ceilometer" "keystoneUser" .Values.bootstrap.ks_user -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $bootstrapJob "tolerationsEnabled" true -}} +{{- end -}} {{ $bootstrapJob | include "helm-toolkit.manifests.job_bootstrap" }} {{- end }} diff --git a/ceilometer/templates/job-db-drop.yaml b/ceilometer/templates/job-db-drop.yaml index 6e819b61c4..609761b5da 100644 --- a/ceilometer/templates/job-db-drop.yaml +++ b/ceilometer/templates/job-db-drop.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if .Values.manifests.job_db_drop }} {{- $dbDropJob := dict "envAll" . "serviceName" "ceilometer" -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $dbDropJob "tolerationsEnabled" true -}} +{{- end -}} {{ $dbDropJob | include "helm-toolkit.manifests.job_db_drop_mysql" }} {{- end }} diff --git a/ceilometer/templates/job-db-init-mongodb.yaml b/ceilometer/templates/job-db-init-mongodb.yaml index 60f2974a74..c8fdda998d 100644 --- a/ceilometer/templates/job-db-init-mongodb.yaml +++ b/ceilometer/templates/job-db-init-mongodb.yaml @@ -31,6 +31,9 @@ spec: restartPolicy: OnFailure nodeSelector: {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 10 }} +{{ end }} initContainers: {{ tuple $envAll "db_init_mongodb" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/ceilometer/templates/job-db-init.yaml b/ceilometer/templates/job-db-init.yaml index 3912f4008f..9df4521fe5 100644 --- a/ceilometer/templates/job-db-init.yaml +++ b/ceilometer/templates/job-db-init.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if .Values.manifests.job_db_init }} {{- $dbInitJob := dict "envAll" . "serviceName" "ceilometer" -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $dbInitJob "tolerationsEnabled" true -}} +{{- end -}} {{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }} {{- end }} diff --git a/ceilometer/templates/job-db-sync.yaml b/ceilometer/templates/job-db-sync.yaml index bc5882bdce..6ae0965938 100644 --- a/ceilometer/templates/job-db-sync.yaml +++ b/ceilometer/templates/job-db-sync.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if .Values.manifests.job_db_sync }} {{- $dbSyncJob := dict "envAll" . "serviceName" "ceilometer" "podVolMounts" .Values.pod.mounts.ceilometer_db_sync.ceilometer_db_sync.volumeMounts "podVols" .Values.pod.mounts.ceilometer_db_sync.ceilometer_db_sync.volumes -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $dbSyncJob "tolerationsEnabled" true -}} +{{- end -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/ceilometer/templates/job-image-repo-sync.yaml b/ceilometer/templates/job-image-repo-sync.yaml index a1a8a49a7a..4e174415dc 100644 --- a/ceilometer/templates/job-image-repo-sync.yaml +++ b/ceilometer/templates/job-image-repo-sync.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} {{- $imageRepoSyncJob := dict "envAll" . "serviceName" "ceilometer" -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $imageRepoSyncJob "tolerationsEnabled" true -}} +{{- end -}} {{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/ceilometer/templates/job-ks-endpoints.yaml b/ceilometer/templates/job-ks-endpoints.yaml index 9421c2e7ce..87735baf1e 100644 --- a/ceilometer/templates/job-ks-endpoints.yaml +++ b/ceilometer/templates/job-ks-endpoints.yaml @@ -13,6 +13,9 @@ limitations under the License. */}} {{- if .Values.manifests.job_ks_endpoints }} -{{- $ksServiceJob := dict "envAll" . "serviceName" "ceilometer" "serviceTypes" ( tuple "metering" ) -}} -{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }} +{{- $ksEndpointsJob := dict "envAll" . "serviceName" "ceilometer" "serviceTypes" ( tuple "metering" ) -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $ksEndpointsJob "tolerationsEnabled" true -}} +{{- end -}} +{{ $ksEndpointsJob | include "helm-toolkit.manifests.job_ks_endpoints" }} {{- end }} diff --git a/ceilometer/templates/job-ks-service.yaml b/ceilometer/templates/job-ks-service.yaml index 38b5734288..ea7dff79a1 100644 --- a/ceilometer/templates/job-ks-service.yaml +++ b/ceilometer/templates/job-ks-service.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if .Values.manifests.job_ks_service }} {{- $ksServiceJob := dict "envAll" . "serviceName" "ceilometer" "serviceTypes" ( tuple "metering" ) -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $ksServiceJob "tolerationsEnabled" true -}} +{{- end -}} {{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }} {{- end }} diff --git a/ceilometer/templates/job-ks-user.yaml b/ceilometer/templates/job-ks-user.yaml index 2f5be60e80..df49722eee 100644 --- a/ceilometer/templates/job-ks-user.yaml +++ b/ceilometer/templates/job-ks-user.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if .Values.manifests.job_ks_user }} {{- $ksUserJob := dict "envAll" . "serviceName" "ceilometer" -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $ksUserJob "tolerationsEnabled" true -}} +{{- end -}} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{- end }} diff --git a/ceilometer/templates/job-rabbit-init.yaml b/ceilometer/templates/job-rabbit-init.yaml index 71661784e3..e04afc6646 100644 --- a/ceilometer/templates/job-rabbit-init.yaml +++ b/ceilometer/templates/job-rabbit-init.yaml @@ -13,5 +13,8 @@ limitations under the License. */}} {{- if .Values.manifests.job_rabbit_init }} {{- $rmqUserJob := dict "envAll" . "serviceName" "ceilometer" -}} +{{- if .Values.pod.tolerations.ceilometer.enabled -}} +{{- $_ := set $rmqUserJob "tolerationsEnabled" true -}} +{{- end -}} {{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }} {{- end }} diff --git a/ceilometer/templates/pod-rally-test.yaml b/ceilometer/templates/pod-rally-test.yaml index f253817326..040836e5fc 100644 --- a/ceilometer/templates/pod-rally-test.yaml +++ b/ceilometer/templates/pod-rally-test.yaml @@ -32,6 +32,9 @@ spec: restartPolicy: Never nodeSelector: {{ .Values.labels.test.node_selector_key }}: {{ .Values.labels.test.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ceilometer.enabled }} +{{ tuple $envAll "ceilometer" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 2 }} +{{ end }} serviceAccountName: {{ $serviceAccountName }} initContainers: {{ tuple $envAll "tests" $mounts_tests_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 4 }} diff --git a/ceilometer/values.yaml b/ceilometer/values.yaml index a6c1b2c821..3abd3c0b1c 100644 --- a/ceilometer/values.yaml +++ b/ceilometer/values.yaml @@ -1921,6 +1921,13 @@ pod: default: kubernetes.io/hostname weight: default: 10 + tolerations: + ceilometer: + enabled: false + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule mounts: ceilometer_tests: init_container: null diff --git a/releasenotes/notes/ceilometer.yaml b/releasenotes/notes/ceilometer.yaml index 18fc561831..7d4a16f1b8 100644 --- a/releasenotes/notes/ceilometer.yaml +++ b/releasenotes/notes/ceilometer.yaml @@ -5,4 +5,5 @@ ceilometer: - 0.2.0 Remove support for releases before T - 0.2.1 Use policies in yaml format - 0.2.2 Update htk requirements repo + - 0.2.3 Enable taint toleration for Openstack services ...