From e16ea80d0ebc9ac04179257215821042270db6f7 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Fri, 10 Mar 2017 14:52:32 -0600 Subject: [PATCH] WIP: Consistent Development Mode for Services To remain consistent with OSH's goals for developers, this turns off replicas when a development flag is enabled. This will also include the ability for developers to use a local storage option through hostPaths or emptyDirs instead of PVCs as needed. --- cinder/templates/deployment-api.yaml | 4 ++++ cinder/templates/deployment-scheduler.yaml | 4 ++++ cinder/templates/deployment-volume.yaml | 4 ++++ cinder/values.yaml | 3 +++ heat/templates/deployment-api.yaml | 4 ++++ heat/templates/deployment-cfn.yaml | 4 ++++ heat/templates/deployment-cloudwatch.yaml | 4 ++++ heat/templates/statefulset-engine.yaml | 4 ++++ heat/values.yaml | 2 ++ horizon/templates/deployment.yaml | 4 ++++ horizon/values.yaml | 3 +++ memcached/templates/deployment.yaml | 4 ++++ memcached/values.yaml | 3 +++ nova/templates/deployment-api-metadata.yaml | 6 +++++- nova/templates/deployment-api-osapi.yaml | 6 +++++- nova/templates/deployment-conductor.yaml | 6 +++++- nova/templates/deployment-consoleauth.yaml | 6 +++++- nova/templates/deployment-scheduler.yaml | 6 +++++- nova/values.yaml | 8 ++++++-- 19 files changed, 78 insertions(+), 7 deletions(-) diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 52705f8a..11c9c4c5 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: cinder-api spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas.api }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/cinder/templates/deployment-scheduler.yaml b/cinder/templates/deployment-scheduler.yaml index de5d42c8..ae41e865 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: cinder-scheduler spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas.scheduler }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index bd4517eb..b796b762 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: cinder-volume spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas.volume }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/cinder/values.yaml b/cinder/values.yaml index 22e65603..6322e21e 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -17,6 +17,9 @@ # Declare name/value pairs to be passed into your templates. # name: value +development: + enabled: false + replicas: api: 1 volume: 1 diff --git a/heat/templates/deployment-api.yaml b/heat/templates/deployment-api.yaml index 66e0343a..9758f167 100755 --- a/heat/templates/deployment-api.yaml +++ b/heat/templates/deployment-api.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: heat-api spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas.api }} + {{- end }} template: metadata: labels: diff --git a/heat/templates/deployment-cfn.yaml b/heat/templates/deployment-cfn.yaml index 8bd0fcbd..9071afe4 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: heat-cfn spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas.cfn }} + {{- end }} template: metadata: labels: diff --git a/heat/templates/deployment-cloudwatch.yaml b/heat/templates/deployment-cloudwatch.yaml index 97ccddd4..1d964321 100644 --- a/heat/templates/deployment-cloudwatch.yaml +++ b/heat/templates/deployment-cloudwatch.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: heat-cloudwatch spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas.cloudwatch }} + {{- end }} template: metadata: labels: diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index b92d567b..38c9a0c7 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -20,7 +20,11 @@ metadata: name: heat-engine spec: serviceName: heat-engine + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas.engine }} + {{- end }} template: metadata: labels: diff --git a/heat/values.yaml b/heat/values.yaml index 662b719e..6e1c00e9 100644 --- a/heat/values.yaml +++ b/heat/values.yaml @@ -17,6 +17,8 @@ # Declare name/value pairs to be passed into your templates. # name: value +development: + enabled: false replicas: api: 1 diff --git a/horizon/templates/deployment.yaml b/horizon/templates/deployment.yaml index 20cc8c29..2fa75333 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: horizon spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.replicas }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/horizon/values.yaml b/horizon/values.yaml index af3ee684..c9d01489 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -17,6 +17,9 @@ # Declare name/value pairs to be passed into your templates. # name: value +development: + enabled: false + replicas: 1 images: diff --git a/memcached/templates/deployment.yaml b/memcached/templates/deployment.yaml index f9c755b7..c7729d9c 100644 --- a/memcached/templates/deployment.yaml +++ b/memcached/templates/deployment.yaml @@ -17,7 +17,11 @@ kind: Deployment metadata: name: memcached spec: + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} replicas: {{ .Values.resources.memcached.replicas }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/memcached/values.yaml b/memcached/values.yaml index 4063109a..fde13ce3 100644 --- a/memcached/values.yaml +++ b/memcached/values.yaml @@ -17,6 +17,9 @@ # Declare name/value pairs to be passed into your templates. # name: value +development: + enabled: false + images: memcached: docker.io/memcached:1.4 pull_policy: "IfNotPresent" diff --git a/nova/templates/deployment-api-metadata.yaml b/nova/templates/deployment-api-metadata.yaml index 4f0454bf..7624acf9 100644 --- a/nova/templates/deployment-api-metadata.yaml +++ b/nova/templates/deployment-api-metadata.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: nova-api-metadata spec: - replicas: {{ .Values.control_replicas }} + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} + replicas: {{ .Values.replicas.control }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/nova/templates/deployment-api-osapi.yaml b/nova/templates/deployment-api-osapi.yaml index b025f7e6..d7fa14b8 100644 --- a/nova/templates/deployment-api-osapi.yaml +++ b/nova/templates/deployment-api-osapi.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: nova-api-osapi spec: - replicas: {{ .Values.control_replicas }} + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} + replicas: {{ .Values.replicas.control }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/nova/templates/deployment-conductor.yaml b/nova/templates/deployment-conductor.yaml index 446cc47a..bd5cada2 100644 --- a/nova/templates/deployment-conductor.yaml +++ b/nova/templates/deployment-conductor.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: nova-conductor spec: - replicas: {{ .Values.control_replicas }} + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} + replicas: {{ .Values.replicas.control }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/nova/templates/deployment-consoleauth.yaml b/nova/templates/deployment-consoleauth.yaml index 92d872f6..a3ff6ed6 100644 --- a/nova/templates/deployment-consoleauth.yaml +++ b/nova/templates/deployment-consoleauth.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: nova-consoleauth spec: - replicas: {{ .Values.control_replicas }} + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} + replicas: {{ .Values.replicas.control }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/nova/templates/deployment-scheduler.yaml b/nova/templates/deployment-scheduler.yaml index d69f0344..b02d2373 100644 --- a/nova/templates/deployment-scheduler.yaml +++ b/nova/templates/deployment-scheduler.yaml @@ -19,7 +19,11 @@ kind: Deployment metadata: name: nova-scheduler spec: - replicas: {{ .Values.control_replicas }} + {{- if .Values.development.enabled }} + replicas: 1 + {{- else }} + replicas: {{ .Values.replicas.control }} + {{- end }} revisionHistoryLimit: {{ .Values.upgrades.revision_history }} strategy: type: {{ .Values.upgrades.pod_replacement_strategy }} diff --git a/nova/values.yaml b/nova/values.yaml index 981f114f..78f8e267 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -17,14 +17,18 @@ # Declare name/value pairs to be passed into your templates. # name: value +development: + enabled: false + labels: control_node_selector_key: openstack-control-plane control_node_selector_value: enabled compute_node_selector_key: openstack-compute-node compute_node_selector_value: enabled -control_replicas: 1 -compute_replicas: 1 +replicas: + control: 1 + compute: 1 images: db_init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton