From 3163f1e64cb5edb15692f5876e8d37f1848edb0d Mon Sep 17 00:00:00 2001 From: portdirect Date: Tue, 10 Jan 2017 02:06:56 +0000 Subject: [PATCH] Add configmap hashing and rolling update to cinder This brings Cinder in line with the following PRs: * https://github.com/att-comdev/openstack-helm/pull/98 * https://github.com/att-comdev/openstack-helm/pull/97 --- cinder/templates/deployment-api.yaml | 12 +++++++++++- cinder/templates/deployment-volume.yaml | 12 +++++++++++- cinder/values.yaml | 11 ++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 037fdf91..6abc136d 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -3,12 +3,22 @@ kind: Deployment metadata: name: cinder-api spec: - replicas: {{ .Values.replicas }} + replicas: {{ .Values.replicas.api }} + revisionHistoryLimit: {{ .Values.upgrades.revision_history }} + strategy: + type: {{ .Values.upgrades.pod_replacement_strategy }} + {{ if eq .Values.upgrades.pod_replacement_strategy "RollingUpdate" }} + rollingUpdate: + maxUnavailable: {{ .Values.upgrades.rolling_update.max_unavailable }} + maxSurge: {{ .Values.upgrades.rolling_update.max_surge }} + {{ end }} template: metadata: labels: app: cinder-api annotations: + configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} + configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} pod.beta.kubernetes.io/init-containers: '[ { "name": "init", diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index 24d57636..81922f5a 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -3,12 +3,22 @@ kind: Deployment metadata: name: cinder-volume spec: - replicas: {{ .Values.replicas }} + replicas: {{ .Values.replicas.volume }} + revisionHistoryLimit: {{ .Values.upgrades.revision_history }} + strategy: + type: {{ .Values.upgrades.pod_replacement_strategy }} + {{ if eq .Values.upgrades.pod_replacement_strategy "RollingUpdate" }} + rollingUpdate: + maxUnavailable: {{ .Values.upgrades.rolling_update.max_unavailable }} + maxSurge: {{ .Values.upgrades.rolling_update.max_surge }} + {{ end }} template: metadata: labels: app: cinder-volume annotations: + configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} + configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} pod.beta.kubernetes.io/init-containers: '[ { "name": "init", diff --git a/cinder/values.yaml b/cinder/values.yaml index a08d3923..2da493a3 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -3,7 +3,9 @@ # Declare name/value pairs to be passed into your templates. # name: value -replicas: 1 +replicas: + api: 1 + volume: 1 labels: node_selector_key: openstack-control-plane @@ -20,6 +22,13 @@ images: volume: quay.io/stackanetes/stackanetes-cinder-volume:newton pull_policy: "IfNotPresent" +upgrades: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 + keystone: auth_uri: "http://keystone-api:5000" auth_url: "http://keystone-api:35357"