From 4232ecac4daac635bb0d0de984b4ae4d23730ff4 Mon Sep 17 00:00:00 2001 From: okozachenko Date: Wed, 2 Feb 2022 01:34:50 +1100 Subject: [PATCH] senlin: Added conductor & health manager Co-Authored-By: Oleksandr Kozachenko Change-Id: I99cffcb6fd198526f29a8a946cb1e3c806b0d99c --- releasenotes/notes/senlin.yaml | 1 + senlin/Chart.yaml | 2 +- senlin/templates/bin/_senlin-conductor.sh.tpl | 19 ++++ .../bin/_senlin-health-manager.sh.tpl | 19 ++++ senlin/templates/configmap-bin.yaml | 4 + senlin/templates/deployment-conductor.yaml | 102 ++++++++++++++++++ .../templates/deployment-health-manager.yaml | 102 ++++++++++++++++++ senlin/values.yaml | 58 ++++++++++ 8 files changed, 306 insertions(+), 1 deletion(-) create mode 100644 senlin/templates/bin/_senlin-conductor.sh.tpl create mode 100644 senlin/templates/bin/_senlin-health-manager.sh.tpl create mode 100644 senlin/templates/deployment-conductor.yaml create mode 100644 senlin/templates/deployment-health-manager.yaml diff --git a/releasenotes/notes/senlin.yaml b/releasenotes/notes/senlin.yaml index 83915f715f..63dc190d13 100644 --- a/releasenotes/notes/senlin.yaml +++ b/releasenotes/notes/senlin.yaml @@ -5,4 +5,5 @@ senlin: - 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 Add conductor & health manager ... diff --git a/senlin/Chart.yaml b/senlin/Chart.yaml index ddebabc93c..fa851dca05 100644 --- a/senlin/Chart.yaml +++ b/senlin/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Senlin name: senlin -version: 0.2.2 +version: 0.2.3 home: https://docs.openstack.org/senlin/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Senlin/OpenStack_Project_Senlin_vertical.png sources: diff --git a/senlin/templates/bin/_senlin-conductor.sh.tpl b/senlin/templates/bin/_senlin-conductor.sh.tpl new file mode 100644 index 0000000000..ea120a6bf3 --- /dev/null +++ b/senlin/templates/bin/_senlin-conductor.sh.tpl @@ -0,0 +1,19 @@ +#!/bin/bash + +{{/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +set -ex +exec senlin-conductor \ + --config-file /etc/senlin/senlin.conf \ No newline at end of file diff --git a/senlin/templates/bin/_senlin-health-manager.sh.tpl b/senlin/templates/bin/_senlin-health-manager.sh.tpl new file mode 100644 index 0000000000..b19779a83d --- /dev/null +++ b/senlin/templates/bin/_senlin-health-manager.sh.tpl @@ -0,0 +1,19 @@ +#!/bin/bash + +{{/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +set -ex +exec senlin-health-manager \ + --config-file /etc/senlin/senlin.conf \ No newline at end of file diff --git a/senlin/templates/configmap-bin.yaml b/senlin/templates/configmap-bin.yaml index 04de6e67d5..1236ddc9da 100644 --- a/senlin/templates/configmap-bin.yaml +++ b/senlin/templates/configmap-bin.yaml @@ -45,10 +45,14 @@ data: {{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} senlin-api.sh: | {{ tuple "bin/_senlin-api.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + senlin-conductor.sh: | +{{ tuple "bin/_senlin-conductor.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} senlin-engine.sh: | {{ tuple "bin/_senlin-engine.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} senlin-engine-cleaner.sh: | {{ tuple "bin/_senlin-engine-cleaner.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + senlin-health-manager.sh: | +{{ tuple "bin/_senlin-health-manager.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} rabbit-init.sh: | {{- include "helm-toolkit.scripts.rabbit_init" . | indent 4 }} {{- end }} diff --git a/senlin/templates/deployment-conductor.yaml b/senlin/templates/deployment-conductor.yaml new file mode 100644 index 0000000000..d60ada4937 --- /dev/null +++ b/senlin/templates/deployment-conductor.yaml @@ -0,0 +1,102 @@ +{{/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- if .Values.manifests.deployment_conductor }} +{{- $envAll := . }} + +{{- $mounts_senlin_conductor := .Values.pod.mounts.senlin_conductor.senlin_conductor }} +{{- $mounts_senlin_conductor_init := .Values.pod.mounts.senlin_conductor.init_container }} + +{{- $serviceAccountName := "senlin-conductor" }} +{{ tuple $envAll "conductor" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: senlin-conductor + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} + labels: +{{ tuple $envAll "senlin" "conductor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} +spec: + replicas: {{ .Values.pod.replicas.conductor }} + selector: + matchLabels: +{{ tuple $envAll "senlin" "conductor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} + template: + metadata: + labels: +{{ tuple $envAll "senlin" "conductor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + annotations: +{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} + configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} + spec: + serviceAccountName: {{ $serviceAccountName }} + affinity: +{{ tuple $envAll "senlin" "conductor" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} + nodeSelector: + {{ .Values.labels.conductor.node_selector_key }}: {{ .Values.labels.conductor.node_selector_value }} + initContainers: +{{ tuple $envAll "conductor" $mounts_senlin_conductor_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} + containers: + - name: senlin-conductor +{{ tuple $envAll "senlin_conductor" | include "helm-toolkit.snippets.image" | indent 10 }} +{{ tuple $envAll $envAll.Values.pod.resources.conductor | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} + securityContext: + runAsUser: {{ .Values.pod.user.senlin.uid }} + command: + - /tmp/senlin-conductor.sh + volumeMounts: + - name: pod-tmp + mountPath: /tmp + - name: senlin-bin + mountPath: /tmp/senlin-conductor.sh + subPath: senlin-conductor.sh + readOnly: true + - name: pod-etc-senlin + mountPath: /etc/senlin + - name: senlin-etc + mountPath: /etc/senlin/senlin.conf + subPath: senlin.conf + readOnly: true + {{- if .Values.conf.senlin.DEFAULT.log_config_append }} + - name: senlin-etc + mountPath: {{ .Values.conf.senlin.DEFAULT.log_config_append }} + subPath: {{ base .Values.conf.senlin.DEFAULT.log_config_append }} + readOnly: true + {{- end }} + - name: senlin-etc + mountPath: /etc/senlin/policy.json + subPath: policy.json + readOnly: true +{{ if $mounts_senlin_conductor.volumeMounts }}{{ toYaml $mounts_senlin_conductor.volumeMounts | indent 12 }}{{ end }} + volumes: + - name: pod-tmp + emptyDir: {} + - name: pod-etc-senlin + emptyDir: {} + - name: pod-var-cache-senlin + emptyDir: {} + - name: senlin-bin + configMap: + name: senlin-bin + defaultMode: 0555 + - name: senlin-etc + secret: + secretName: senlin-etc + defaultMode: 0444 +{{ if $mounts_senlin_conductor.volumes }}{{ toYaml $mounts_senlin_conductor.volumes | indent 8 }}{{ end }} +{{- end }} \ No newline at end of file diff --git a/senlin/templates/deployment-health-manager.yaml b/senlin/templates/deployment-health-manager.yaml new file mode 100644 index 0000000000..e081c36544 --- /dev/null +++ b/senlin/templates/deployment-health-manager.yaml @@ -0,0 +1,102 @@ +{{/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- if .Values.manifests.deployment_health_manager }} +{{- $envAll := . }} + +{{- $mounts_senlin_health_manager := .Values.pod.mounts.senlin_health_manager.senlin_health_manager }} +{{- $mounts_senlin_health_manager_init := .Values.pod.mounts.senlin_health_manager.init_container }} + +{{- $serviceAccountName := "senlin-health-manager" }} +{{ tuple $envAll "health_manager" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: senlin-health-manager + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} + labels: +{{ tuple $envAll "senlin" "health_manager" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} +spec: + replicas: {{ .Values.pod.replicas.health_manager }} + selector: + matchLabels: +{{ tuple $envAll "senlin" "health_manager" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} + template: + metadata: + labels: +{{ tuple $envAll "senlin" "health_manager" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + annotations: +{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} + configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} + spec: + serviceAccountName: {{ $serviceAccountName }} + affinity: +{{ tuple $envAll "senlin" "health_manager" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} + nodeSelector: + {{ .Values.labels.health_manager.node_selector_key }}: {{ .Values.labels.health_manager.node_selector_value }} + initContainers: +{{ tuple $envAll "health_manager" $mounts_senlin_health_manager_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} + containers: + - name: senlin-health-manager +{{ tuple $envAll "senlin_health_manager" | include "helm-toolkit.snippets.image" | indent 10 }} +{{ tuple $envAll $envAll.Values.pod.resources.health_manager | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} + securityContext: + runAsUser: {{ .Values.pod.user.senlin.uid }} + command: + - /tmp/senlin-health-manager.sh + volumeMounts: + - name: pod-tmp + mountPath: /tmp + - name: senlin-bin + mountPath: /tmp/senlin-health-manager.sh + subPath: senlin-health-manager.sh + readOnly: true + - name: pod-etc-senlin + mountPath: /etc/senlin + - name: senlin-etc + mountPath: /etc/senlin/senlin.conf + subPath: senlin.conf + readOnly: true + {{- if .Values.conf.senlin.DEFAULT.log_config_append }} + - name: senlin-etc + mountPath: {{ .Values.conf.senlin.DEFAULT.log_config_append }} + subPath: {{ base .Values.conf.senlin.DEFAULT.log_config_append }} + readOnly: true + {{- end }} + - name: senlin-etc + mountPath: /etc/senlin/policy.json + subPath: policy.json + readOnly: true +{{ if $mounts_senlin_health_manager.volumeMounts }}{{ toYaml $mounts_senlin_health_manager.volumeMounts | indent 12 }}{{ end }} + volumes: + - name: pod-tmp + emptyDir: {} + - name: pod-etc-senlin + emptyDir: {} + - name: pod-var-cache-senlin + emptyDir: {} + - name: senlin-bin + configMap: + name: senlin-bin + defaultMode: 0555 + - name: senlin-etc + secret: + secretName: senlin-etc + defaultMode: 0444 +{{ if $mounts_senlin_health_manager.volumes }}{{ toYaml $mounts_senlin_health_manager.volumes | indent 8 }}{{ end }} +{{- end }} \ No newline at end of file diff --git a/senlin/values.yaml b/senlin/values.yaml index 3ad5e5bf5b..b99fe85463 100644 --- a/senlin/values.yaml +++ b/senlin/values.yaml @@ -20,9 +20,15 @@ labels: api: node_selector_key: openstack-control-plane node_selector_value: enabled + conductor: + node_selector_key: openstack-control-plane + node_selector_value: enabled engine: node_selector_key: openstack-control-plane node_selector_value: enabled + health_manager: + node_selector_key: openstack-control-plane + node_selector_value: enabled job: node_selector_key: openstack-control-plane node_selector_value: enabled @@ -44,8 +50,10 @@ images: ks_service: docker.io/openstackhelm/heat:ocata-ubuntu_xenial ks_endpoints: docker.io/openstackhelm/heat:ocata-ubuntu_xenial senlin_api: docker.io/openstackhelm/senlin:ocata-ubuntu_xenial + senlin_conductor: docker.io/openstackhelm/senlin:ocata-ubuntu_xenial senlin_engine: docker.io/openstackhelm/senlin:ocata-ubuntu_xenial senlin_engine_cleaner: docker.io/openstackhelm/senlin:ocata-ubuntu_xenial + senlin_health_manager: docker.io/openstackhelm/senlin:ocata-ubuntu_xenial dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0 image_repo_sync: docker.io/docker:17.07.0 pull_policy: "IfNotPresent" @@ -319,6 +327,28 @@ dependencies: service: oslo_db - endpoint: internal service: identity + conductor: + jobs: + - senlin-db-sync + - senlin-ks-user + - senlin-ks-endpoints + - senlin-rabbit-init + services: + - endpoint: internal + service: oslo_db + - endpoint: internal + service: identity + health_manager: + jobs: + - senlin-db-sync + - senlin-ks-user + - senlin-ks-endpoints + - senlin-rabbit-init + services: + - endpoint: internal + service: oslo_db + - endpoint: internal + service: identity ks_endpoints: jobs: - senlin-ks-service @@ -519,11 +549,21 @@ pod: senlin_api: volumeMounts: volumes: + senlin_conductor: + init_container: null + senlin_conductor: + volumeMounts: + volumes: senlin_engine: init_container: null senlin_engine: volumeMounts: volumes: + senlin_health_manager: + init_container: null + senlin_health_manager: + volumeMounts: + volumes: senlin_bootstrap: init_container: null senlin_bootstrap: @@ -545,7 +585,9 @@ pod: volumes: replicas: api: 1 + conductor: 1 engine: 1 + health_manager: 1 lifecycle: upgrades: deployments: @@ -569,6 +611,13 @@ pod: limits: memory: "1024Mi" cpu: "2000m" + conductor: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" engine: requests: memory: "128Mi" @@ -576,6 +625,13 @@ pod: limits: memory: "1024Mi" cpu: "2000m" + health_manager: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" jobs: bootstrap: requests: @@ -667,7 +723,9 @@ manifests: configmap_etc: true cron_job_engine_cleaner: true deployment_api: true + deployment_conductor: true deployment_engine: true + deployment_health_manager: true ingress_api: true job_bootstrap: true job_db_init: true