From ac06f49849b8c29ed1c2178207895882b5a6b6b8 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Wed, 5 Jul 2017 02:34:12 -0500 Subject: [PATCH] Unify and normalise K8s Resources and Upgrade Strategy This PS unifies and normalises Kubernetes resource allocation and update strategy across all OpenStack-Helm elements. Change-Id: Ia41fc453cb5191fa447ca6e1aa0f5b431c939dc8 --- barbican/templates/configmap-bin.yaml | 2 + barbican/templates/configmap-etc.yaml | 3 + barbican/templates/deployment-api.yaml | 24 +-- barbican/templates/ingress-api.yaml | 2 + barbican/templates/job-db-init.yaml | 11 +- barbican/templates/job-db-sync.yaml | 11 +- barbican/templates/job-ks-endpoints.yaml | 11 +- barbican/templates/job-ks-service.yaml | 11 +- barbican/templates/job-ks-user.yaml | 11 +- barbican/templates/pdb-api.yaml | 1 + barbican/templates/secret-db.yaml | 1 + barbican/templates/secret-keystone.yaml | 1 + barbican/templates/service-api.yaml | 1 + barbican/templates/service-ingress-api.yaml | 2 + barbican/values.yaml | 108 ++++++------ ceph/templates/configmap-etc.yaml | 1 - ceph/templates/pdb-mon.yaml | 14 ++ cinder/templates/configmap-bin.yaml | 2 + cinder/templates/configmap-etc.yaml | 3 + cinder/templates/deployment-api.yaml | 24 +-- cinder/templates/deployment-backup.yaml | 24 +-- cinder/templates/deployment-scheduler.yaml | 24 +-- cinder/templates/deployment-volume.yaml | 24 +-- cinder/templates/ingress-api.yaml | 2 + cinder/templates/job-bootstrap.yaml | 13 +- cinder/templates/job-db-init.yaml | 11 +- cinder/templates/job-db-sync.yaml | 11 +- cinder/templates/job-ks-endpoints.yaml | 11 +- cinder/templates/job-ks-service.yaml | 11 +- cinder/templates/job-ks-user.yaml | 11 +- cinder/templates/pdb-api.yaml | 1 + cinder/templates/pod-rally-test.yaml | 16 +- cinder/templates/secret-db.yaml | 1 + cinder/templates/secret-keystone.yaml | 1 + cinder/templates/service-api.yaml | 1 + cinder/templates/service-ingress-api.yaml | 2 + cinder/values.yaml | 155 +++++++++--------- glance/templates/configmap-bin.yaml | 2 + glance/templates/configmap-etc.yaml | 5 +- glance/templates/deployment-api.yaml | 33 +--- glance/templates/deployment-registry.yaml | 15 +- glance/templates/ingress-api.yaml | 2 + glance/templates/ingress-registry.yaml | 2 + glance/templates/job-bootstrap.yaml | 10 +- glance/templates/job-db-init.yaml | 11 +- glance/templates/job-db-sync.yaml | 11 +- glance/templates/job-ks-endpoints.yaml | 11 +- glance/templates/job-ks-service.yaml | 11 +- glance/templates/job-ks-user.yaml | 11 +- glance/templates/pdb-api.yaml | 1 + glance/templates/pdb-registry.yaml | 1 + glance/templates/pod-rally-test.yaml | 16 +- glance/templates/pvc-images.yaml | 2 + glance/templates/secret-db.yaml | 1 + glance/templates/secret-keystone.yaml | 1 + glance/templates/service-api.yaml | 1 + glance/templates/service-ingress-api.yaml | 2 + .../templates/service-ingress-registry.yaml | 2 + glance/templates/service-registry.yaml | 1 + glance/values.yaml | 65 +++++--- heat/templates/configmap-bin.yaml | 2 + heat/templates/configmap-etc.yaml | 3 + heat/templates/deployment-api.yaml | 23 +-- heat/templates/deployment-cfn.yaml | 23 +-- heat/templates/deployment-cloudwatch.yaml | 23 +-- heat/templates/ingress-api.yaml | 2 + heat/templates/ingress-cfn.yaml | 2 + heat/templates/ingress-cloudwatch.yaml | 2 + heat/templates/job-db-init.yaml | 11 +- heat/templates/job-db-sync.yaml | 11 +- heat/templates/job-ks-endpoints.yaml | 11 +- heat/templates/job-ks-service.yaml | 11 +- heat/templates/job-ks-user.yaml | 12 +- heat/templates/pdb-api.yaml | 1 + heat/templates/pdb-cfn.yaml | 1 + heat/templates/pdb-cloudwatch.yaml | 1 + heat/templates/secret-db.yaml | 1 + heat/templates/secret-keystone.yaml | 1 + heat/templates/service-api.yaml | 1 + heat/templates/service-cfn.yaml | 1 + heat/templates/service-cloudwatch.yaml | 1 + heat/templates/service-ingress-api.yaml | 2 + heat/templates/service-ingress-cfn.yaml | 2 + .../templates/service-ingress-cloudwatch.yaml | 2 + heat/templates/statefulset-engine.yaml | 14 +- heat/values.yaml | 112 +++++++------ ...enrc.tpl => _keystone_openrc_env_vars.tpl} | 0 ...tpl => _keystone_user_create_env_vars.tpl} | 0 ..._kubernetes_entrypoint_init_container.tpl} | 0 ...ls.tpl => _kubernetes_metadata_labels.tpl} | 0 ....tpl => _kubernetes_pod_anti_affinity.tpl} | 0 .../snippets/_kubernetes_resources.tpl | 27 +++ .../_kubernetes_upgrades_daemonset.tpl | 32 ++++ .../_kubernetes_upgrades_deployment.tpl | 27 +++ horizon/templates/configmap-bin.yaml | 2 + horizon/templates/configmap-etc.yaml | 2 + horizon/templates/deployment.yaml | 23 +-- horizon/templates/ingress-api.yaml | 2 + horizon/templates/pdb.yaml | 1 + horizon/templates/service-ingress.yaml | 2 + horizon/templates/service.yaml | 1 + horizon/values.yaml | 21 +-- ingress/templates/configmap-etc.yaml | 1 + ingress/templates/deployment-error.yaml | 21 +-- ingress/templates/deployment-ingress.yaml | 22 +-- ingress/templates/service-error.yaml | 2 + ingress/templates/service-ingress.yaml | 2 + ingress/values.yaml | 35 ++-- keystone/templates/configmap-bin.yaml | 2 + keystone/templates/configmap-etc.yaml | 3 + keystone/templates/deployment.yaml | 24 +-- keystone/templates/ingress.yaml | 2 + keystone/templates/job-bootstrap.yaml | 18 +- keystone/templates/job-db-init.yaml | 16 +- keystone/templates/job-db-sync.yaml | 15 +- keystone/templates/pdb.yaml | 1 + keystone/templates/pod-rally-test.yaml | 18 +- keystone/templates/secret-db.yaml | 1 + keystone/templates/secret-keystone.yaml | 1 + keystone/templates/service-ingress.yaml | 2 + keystone/templates/service.yaml | 1 + keystone/values.yaml | 43 ++--- magnum/templates/configmap-bin.yaml | 2 + magnum/templates/configmap-etc.yaml | 3 + magnum/templates/deployment-api.yaml | 23 +-- magnum/templates/ingress-api.yaml | 2 + magnum/templates/job-db-init.yaml | 11 +- magnum/templates/job-db-sync.yaml | 11 +- magnum/templates/job-ks-endpoints.yaml | 11 +- magnum/templates/job-ks-service.yaml | 11 +- magnum/templates/job-ks-user.yaml | 11 +- magnum/templates/pdb-api.yaml | 1 + magnum/templates/secret-db.yaml | 1 + magnum/templates/secret-keystone.yaml | 1 + magnum/templates/service-api.yaml | 1 + magnum/templates/service-ingress-api.yaml | 2 + magnum/templates/statefulset-conductor.yaml | 14 +- magnum/values.yaml | 104 +++++++----- mariadb/templates/configmap-bin.yaml | 2 + mariadb/templates/configmap-etc.yaml | 2 + mariadb/templates/pdb-mariadb.yaml | 1 + .../templates/secret-db-root-password.yaml | 16 ++ mariadb/templates/service-discovery.yaml | 1 + mariadb/templates/service.yaml | 1 + mariadb/templates/statefulset.yaml | 11 +- mariadb/values.yaml | 10 ++ mistral/templates/configmap-bin.yaml | 2 + mistral/templates/configmap-etc.yaml | 3 + mistral/templates/deployment-api.yaml | 24 +-- mistral/templates/deployment-executor.yaml | 24 +-- mistral/templates/ingress-api.yaml | 2 + mistral/templates/job-db-init.yaml | 11 +- mistral/templates/job-db-sync.yaml | 10 +- mistral/templates/job-ks-endpoints.yaml | 11 +- mistral/templates/job-ks-service.yaml | 11 +- mistral/templates/job-ks-user.yaml | 11 +- mistral/templates/pdb-api.yaml | 1 + mistral/templates/secret-db.yaml | 1 + mistral/templates/secret-keystone.yaml | 1 + mistral/templates/service-api.yaml | 1 + mistral/templates/service-ingress-api.yaml | 2 + mistral/templates/statefulset-engine.yaml | 17 +- .../templates/statefulset-event-engine.yaml | 15 +- mistral/values.yaml | 104 +++++++----- neutron/templates/configmap-bin.yaml | 2 + neutron/templates/configmap-etc.yaml | 3 + neutron/templates/daemonset-dhcp-agent.yaml | 24 +-- neutron/templates/daemonset-l3-agent.yaml | 24 +-- .../templates/daemonset-metadata-agent.yaml | 24 +-- neutron/templates/daemonset-ovs-agent.yaml | 36 +--- neutron/templates/daemonset-ovs-db.yaml | 21 +-- neutron/templates/daemonset-ovs-vswitchd.yaml | 21 +-- neutron/templates/deployment-server.yaml | 23 +-- neutron/templates/ingress.yaml | 2 + neutron/templates/job-db-init.yaml | 2 + neutron/templates/job-db-sync.yaml | 2 + neutron/templates/job-ks-endpoints.yaml | 11 +- neutron/templates/job-ks-service.yaml | 11 +- neutron/templates/job-ks-user.yaml | 11 +- neutron/templates/pdb-server.yaml | 1 + neutron/templates/pod-rally-test.yaml | 8 +- neutron/templates/secret-db.yaml | 1 + neutron/templates/secret-keystone.yaml | 1 + .../templates/service-ingress-neutron.yaml | 2 + neutron/templates/service.yaml | 1 + neutron/values.yaml | 114 ++++++++----- nova/templates/configmap-bin.yaml | 2 +- nova/templates/configmap-etc.yaml | 1 + nova/templates/daemonset-compute.yaml | 34 +--- nova/templates/daemonset-libvirt.yaml | 24 +-- nova/templates/deployment-api-metadata.yaml | 23 +-- nova/templates/deployment-api-osapi.yaml | 23 +-- nova/templates/deployment-conductor.yaml | 23 +-- nova/templates/deployment-consoleauth.yaml | 23 +-- nova/templates/deployment-novncproxy.yaml | 35 +--- nova/templates/deployment-scheduler.yaml | 23 +-- nova/templates/ingress-metadata.yaml | 1 + nova/templates/ingress-osapi.yaml | 1 + nova/templates/job-bootstrap.yaml | 15 +- nova/templates/job-db-init.yaml | 21 +-- nova/templates/job-db-sync.yaml | 11 +- nova/templates/job-ks-endpoints.yaml | 11 +- nova/templates/job-ks-service.yaml | 11 +- nova/templates/job-ks-user.yaml | 11 +- nova/templates/pod-rally-test.yaml | 6 +- nova/templates/service-ingress-metadata.yaml | 1 + nova/templates/service-ingress-osapi.yaml | 1 + nova/templates/service-novncproxy.yaml | 2 +- nova/values.yaml | 110 ++++++++----- senlin/templates/configmap-bin.yaml | 2 + senlin/templates/configmap-etc.yaml | 3 + senlin/templates/deployment-api.yaml | 24 +-- senlin/templates/ingress-api.yaml | 2 + senlin/templates/job-db-init.yaml | 11 +- senlin/templates/job-db-sync.yaml | 11 +- senlin/templates/job-ks-endpoints.yaml | 11 +- senlin/templates/job-ks-service.yaml | 11 +- senlin/templates/job-ks-user.yaml | 11 +- senlin/templates/pdb-api.yaml | 1 + senlin/templates/secret-db.yaml | 1 + senlin/templates/secret-keystone.yaml | 1 + senlin/templates/service-api.yaml | 1 + senlin/templates/service-ingress-api.yaml | 2 + senlin/templates/statefulset-engine.yaml | 14 +- senlin/values.yaml | 104 +++++++----- 225 files changed, 1199 insertions(+), 1699 deletions(-) rename helm-toolkit/templates/snippets/{_ks_env_openrc.tpl => _keystone_openrc_env_vars.tpl} (100%) rename helm-toolkit/templates/snippets/{_ks_env_user_create_openrc.tpl => _keystone_user_create_env_vars.tpl} (100%) rename helm-toolkit/templates/snippets/{_k8s_init_dep_check.tpl => _kubernetes_entrypoint_init_container.tpl} (100%) rename helm-toolkit/templates/snippets/{_k8s_metadata_labels.tpl => _kubernetes_metadata_labels.tpl} (100%) rename helm-toolkit/templates/snippets/{_k8s_pod_antiaffinity.tpl => _kubernetes_pod_anti_affinity.tpl} (100%) create mode 100644 helm-toolkit/templates/snippets/_kubernetes_resources.tpl create mode 100644 helm-toolkit/templates/snippets/_kubernetes_upgrades_daemonset.tpl create mode 100644 helm-toolkit/templates/snippets/_kubernetes_upgrades_deployment.tpl diff --git a/barbican/templates/configmap-bin.yaml b/barbican/templates/configmap-bin.yaml index 1772a4d256..4d2f2c2ac0 100644 --- a/barbican/templates/configmap-bin.yaml +++ b/barbican/templates/configmap-bin.yaml @@ -10,6 +10,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/barbican/templates/configmap-etc.yaml b/barbican/templates/configmap-etc.yaml index 27654c7c19..e6c4de2386 100644 --- a/barbican/templates/configmap-etc.yaml +++ b/barbican/templates/configmap-etc.yaml @@ -10,6 +10,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "barbican.conf.barbican_values_skeleton" .Values.conf.barbican | trunc 0 -}} {{- if empty .Values.conf.barbican.keystone_authtoken.keystonemiddleware.auth_token.auth_uri -}} @@ -55,6 +57,7 @@ {{- tuple "key-manager" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.barbican.default.barbican.common.config "host_href" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/barbican/templates/deployment-api.yaml b/barbican/templates/deployment-api.yaml index ccf434ba76..11e2000691 100644 --- a/barbican/templates/deployment-api.yaml +++ b/barbican/templates/deployment-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.api }} {{- $mounts_barbican_api := .Values.mounts.barbican_api.barbican_api }} @@ -22,14 +23,7 @@ metadata: name: barbican-api spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -48,15 +42,7 @@ spec: - name: barbican-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.api.limits.cpu | quote }} - memory: {{ .Values.resources.api.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.api.requests.cpu | quote }} - memory: {{ .Values.resources.api.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/barbican.sh - start @@ -98,7 +84,7 @@ spec: mountPath: /tmp/barbican.sh subPath: barbican.sh readOnly: true -{{ if $mounts_barbican_api.volumeMounts }}{{ toYaml $mounts_barbican_api.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_barbican_api.volumeMounts }}{{ toYaml $mounts_barbican_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: etcbarbican emptyDir: {} @@ -109,4 +95,4 @@ spec: configMap: name: barbican-bin defaultMode: 0555 -{{ if $mounts_barbican_api.volumes }}{{ toYaml $mounts_barbican_api.volumes | indent 8 }}{{ end }} +{{- if $mounts_barbican_api.volumes }}{{ toYaml $mounts_barbican_api.volumes | indent 8 }}{{ end }} diff --git a/barbican/templates/ingress-api.yaml b/barbican/templates/ingress-api.yaml index c3e2f69b52..146a1908b0 100644 --- a/barbican/templates/ingress-api.yaml +++ b/barbican/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/barbican/templates/job-db-init.yaml b/barbican/templates/job-db-init.yaml index fd8d901a78..e23f0fed0d 100644 --- a/barbican/templates/job-db-init.yaml +++ b/barbican/templates/job-db-init.yaml @@ -12,6 +12,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -28,15 +29,7 @@ spec: - name: barbican-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.db_init.limits.cpu | quote }} - memory: {{ .Values.resources.db_init.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.db_init.requests.cpu | quote }} - memory: {{ .Values.resources.db_init.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/barbican/templates/job-db-sync.yaml b/barbican/templates/job-db-sync.yaml index aab76b5d99..1cb7a85070 100644 --- a/barbican/templates/job-db-sync.yaml +++ b/barbican/templates/job-db-sync.yaml @@ -12,6 +12,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -28,15 +29,7 @@ spec: - name: barbican-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.db_sync.limits.cpu | quote }} - memory: {{ .Values.resources.jobs.db.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.db_sync.requests.cpu | quote }} - memory: {{ .Values.resources.jobs.db.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/barbican/templates/job-ks-endpoints.yaml b/barbican/templates/job-ks-endpoints.yaml index 86789f3ee7..27a63dfcd0 100644 --- a/barbican/templates/job-ks-endpoints.yaml +++ b/barbican/templates/job-ks-endpoints.yaml @@ -12,6 +12,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/barbican/templates/job-ks-service.yaml b/barbican/templates/job-ks-service.yaml index 2f6b2cad45..bc3c3d317a 100644 --- a/barbican/templates/job-ks-service.yaml +++ b/barbican/templates/job-ks-service.yaml @@ -12,6 +12,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -29,15 +30,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/barbican/templates/job-ks-user.yaml b/barbican/templates/job-ks-user.yaml index 72956095d3..7401e467e4 100644 --- a/barbican/templates/job-ks-user.yaml +++ b/barbican/templates/job-ks-user.yaml @@ -12,6 +12,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -28,15 +29,7 @@ spec: - name: barbican-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/barbican/templates/pdb-api.yaml b/barbican/templates/pdb-api.yaml index 5691b6ab24..61240de25b 100644 --- a/barbican/templates/pdb-api.yaml +++ b/barbican/templates/pdb-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/barbican/templates/secret-db.yaml b/barbican/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/barbican/templates/secret-db.yaml +++ b/barbican/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/barbican/templates/secret-keystone.yaml b/barbican/templates/secret-keystone.yaml index 2507c3b3b8..0f963b248f 100644 --- a/barbican/templates/secret-keystone.yaml +++ b/barbican/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/barbican/templates/service-api.yaml b/barbican/templates/service-api.yaml index 094da7a21b..8c1cb73c02 100644 --- a/barbican/templates/service-api.yaml +++ b/barbican/templates/service-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/barbican/templates/service-ingress-api.yaml b/barbican/templates/service-ingress-api.yaml index 94d3334d58..7573e4c1e4 100644 --- a/barbican/templates/service-ingress-api.yaml +++ b/barbican/templates/service-ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/barbican/values.yaml b/barbican/values.yaml index 02aa941339..0e0cc30654 100644 --- a/barbican/values.yaml +++ b/barbican/values.yaml @@ -27,11 +27,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -200,48 +201,63 @@ endpoints: resources: enabled: false - db_init: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - db_sync: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - ks_endpoints: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - ks_service: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - ks_user: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" api: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_service: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" mounts: barbican_api: diff --git a/ceph/templates/configmap-etc.yaml b/ceph/templates/configmap-etc.yaml index e7152c4428..f76f740dbb 100644 --- a/ceph/templates/configmap-etc.yaml +++ b/ceph/templates/configmap-etc.yaml @@ -18,7 +18,6 @@ {{- $monHostURI := cat $monHost "." $monHostDomain | nospace -}} {{- $monHostURI | set .Values.conf.ceph.config.global "mon_host" | quote | trunc 0 -}} {{- end -}} - --- apiVersion: v1 kind: ConfigMap diff --git a/ceph/templates/pdb-mon.yaml b/ceph/templates/pdb-mon.yaml index e357496855..71b5c9b199 100644 --- a/ceph/templates/pdb-mon.yaml +++ b/ceph/templates/pdb-mon.yaml @@ -1,4 +1,18 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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_enabled.deployment }} +--- apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: diff --git a/cinder/templates/configmap-bin.yaml b/cinder/templates/configmap-bin.yaml index cd05f3843c..dceb3fb037 100644 --- a/cinder/templates/configmap-bin.yaml +++ b/cinder/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/cinder/templates/configmap-etc.yaml b/cinder/templates/configmap-etc.yaml index b4217edb26..232514d881 100644 --- a/cinder/templates/configmap-etc.yaml +++ b/cinder/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "cinder.conf.cinder_values_skeleton" .Values.conf.cinder | trunc 0 -}} {{- if empty .Values.conf.cinder.keystone_authtoken.keystonemiddleware.auth_token.auth_uri -}} @@ -58,6 +60,7 @@ {{- tuple "image" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.cinder.default.cinder "glance_api_servers" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 8bd784223b..9c4125832f 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.api }} {{- $mounts_cinder_api := .Values.mounts.cinder_api.cinder_api }} @@ -22,14 +23,7 @@ metadata: name: cinder-api spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -49,15 +43,7 @@ spec: - name: cinder-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.cinder_api.requests.memory | quote }} - cpu: {{ .Values.resources.cinder_api.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.cinder_api.limits.memory | quote }} - cpu: {{ .Values.resources.cinder_api.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/cinder-api.sh - start @@ -90,7 +76,7 @@ spec: mountPath: /etc/cinder/policy.json subPath: policy.json readOnly: true -{{ if $mounts_cinder_api.volumeMounts }}{{ toYaml $mounts_cinder_api.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_cinder_api.volumeMounts }}{{ toYaml $mounts_cinder_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: cinder-bin configMap: @@ -99,4 +85,4 @@ spec: - name: cinder-etc configMap: name: cinder-etc -{{ if $mounts_cinder_api.volumes }}{{ toYaml $mounts_cinder_api.volumes | indent 8 }}{{ end }} +{{- if $mounts_cinder_api.volumes }}{{ toYaml $mounts_cinder_api.volumes | indent 8 }}{{ end }} diff --git a/cinder/templates/deployment-backup.yaml b/cinder/templates/deployment-backup.yaml index 8ca1178f2c..a95dd68614 100644 --- a/cinder/templates/deployment-backup.yaml +++ b/cinder/templates/deployment-backup.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.backup }} {{- $mounts_cinder_backup := .Values.mounts.cinder_backup.cinder_backup }} @@ -22,14 +23,7 @@ metadata: name: cinder-backup spec: replicas: {{ .Values.replicas.backup }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -65,15 +59,7 @@ spec: - name: cinder-backup image: {{ .Values.images.backup }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.cinder_backup.requests.memory | quote }} - cpu: {{ .Values.resources.cinder_backup.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.cinder_backup.limits.memory | quote }} - cpu: {{ .Values.resources.cinder_backup.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.backup | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/cinder-backup.sh volumeMounts: @@ -97,7 +83,7 @@ spec: subPath: key readOnly: true {{- end -}} -{{ if $mounts_cinder_backup.volumeMounts }}{{ toYaml $mounts_cinder_backup.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_cinder_backup.volumeMounts }}{{ toYaml $mounts_cinder_backup.volumeMounts | indent 12 }}{{ end }} volumes: - name: cinder-etc configMap: @@ -116,4 +102,4 @@ spec: secret: secretName: pvc-ceph-client-key {{ end }} -{{ if $mounts_cinder_backup.volumes }}{{ toYaml $mounts_cinder_backup.volumes | indent 8 }}{{ end }} +{{- if $mounts_cinder_backup.volumes }}{{ toYaml $mounts_cinder_backup.volumes | indent 8 }}{{ end }} diff --git a/cinder/templates/deployment-scheduler.yaml b/cinder/templates/deployment-scheduler.yaml index dd98365e16..7449f4de2e 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.scheduler }} {{- $mounts_cinder_scheduler := .Values.mounts.cinder_scheduler.cinder_scheduler }} @@ -22,14 +23,7 @@ metadata: name: cinder-scheduler spec: replicas: {{ .Values.replicas.scheduler }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -48,15 +42,7 @@ spec: - name: cinder-scheduler image: {{ .Values.images.scheduler }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.cinder_scheduler.requests.memory | quote }} - cpu: {{ .Values.resources.cinder_scheduler.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.cinder_scheduler.limits.memory | quote }} - cpu: {{ .Values.resources.cinder_scheduler.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.scheduler | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/cinder-scheduler.sh volumeMounts: @@ -76,7 +62,7 @@ spec: mountPath: /etc/cinder/policy.json subPath: policy.json readOnly: true -{{ if $mounts_cinder_scheduler.volumeMounts }}{{ toYaml $mounts_cinder_scheduler.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_cinder_scheduler.volumeMounts }}{{ toYaml $mounts_cinder_scheduler.volumeMounts | indent 12 }}{{ end }} volumes: - name: cinder-bin configMap: @@ -85,4 +71,4 @@ spec: - name: cinder-etc configMap: name: cinder-etc -{{ if $mounts_cinder_scheduler.volumes }}{{ toYaml $mounts_cinder_scheduler.volumes | indent 8 }}{{ end }} +{{- if $mounts_cinder_scheduler.volumes }}{{ toYaml $mounts_cinder_scheduler.volumes | indent 8 }}{{ end }} diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index 0376fa9c07..85a3f449aa 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.volume }} {{- $mounts_cinder_volume := .Values.mounts.cinder_volume.cinder_volume }} @@ -22,14 +23,7 @@ metadata: name: cinder-volume spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -65,15 +59,7 @@ spec: - name: cinder-volume image: {{ .Values.images.volume }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.cinder_volume.requests.memory | quote }} - cpu: {{ .Values.resources.cinder_volume.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.cinder_volume.limits.memory | quote }} - cpu: {{ .Values.resources.cinder_volume.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.volume | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/cinder-volume.sh volumeMounts: @@ -101,7 +87,7 @@ spec: subPath: key readOnly: true {{- end }} -{{ if $mounts_cinder_volume.volumeMounts }}{{ toYaml $mounts_cinder_volume.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_cinder_volume.volumeMounts }}{{ toYaml $mounts_cinder_volume.volumeMounts | indent 12 }}{{ end }} volumes: - name: cinder-bin configMap: @@ -120,4 +106,4 @@ spec: secret: secretName: pvc-ceph-client-key {{ end }} -{{ if $mounts_cinder_volume.volumes }}{{ toYaml $mounts_cinder_volume.volumes | indent 8 }}{{ end }} +{{- if $mounts_cinder_volume.volumes }}{{ toYaml $mounts_cinder_volume.volumes | indent 8 }}{{ end }} diff --git a/cinder/templates/ingress-api.yaml b/cinder/templates/ingress-api.yaml index 40f7c7bee3..6387db00ac 100644 --- a/cinder/templates/ingress-api.yaml +++ b/cinder/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/cinder/templates/job-bootstrap.yaml b/cinder/templates/job-bootstrap.yaml index 584616d95e..34cd1d4ea8 100644 --- a/cinder/templates/job-bootstrap.yaml +++ b/cinder/templates/job-bootstrap.yaml @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- if .Values.bootstrap.enabled }} {{- $envAll := . }} +{{- if .Values.bootstrap.enabled }} {{- $dependencies := .Values.dependencies.bootstrap }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: cinder-bootstrap image: {{ .Values.images.bootstrap }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.bootstrap.requests.memory | quote }} - cpu: {{ .Values.resources.bootstrap.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.bootstrap.limits.memory | quote }} - cpu: {{ .Values.resources.bootstrap.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.bootstrap | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/bootstrap.sh env: diff --git a/cinder/templates/job-db-init.yaml b/cinder/templates/job-db-init.yaml index 37a00751e0..b51bc929b9 100644 --- a/cinder/templates/job-db-init.yaml +++ b/cinder/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: cinder-db-init image: {{ .Values.images.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.cinder_db_init.requests.memory | quote }} - cpu: {{ .Values.resources.cinder_db_init.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.cinder_db_init.limits.memory | quote }} - cpu: {{ .Values.resources.cinder_db_init.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/cinder/templates/job-db-sync.yaml b/cinder/templates/job-db-sync.yaml index 4e40e96589..7a8eaa4c91 100644 --- a/cinder/templates/job-db-sync.yaml +++ b/cinder/templates/job-db-sync.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: cinder-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.cinder_db_sync.requests.memory | quote }} - cpu: {{ .Values.resources.cinder_db_sync.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.cinder_db_sync.limits.memory | quote }} - cpu: {{ .Values.resources.cinder_db_sync.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/cinder/templates/job-ks-endpoints.yaml b/cinder/templates/job-ks-endpoints.yaml index b10d4ee835..9830f36196 100644 --- a/cinder/templates/job-ks-endpoints.yaml +++ b/cinder/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.cinder_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.cinder_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.cinder_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.cinder_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/cinder/templates/job-ks-service.yaml b/cinder/templates/job-ks-service.yaml index 2e4e0c2f3b..3278fd78b5 100644 --- a/cinder/templates/job-ks-service.yaml +++ b/cinder/templates/job-ks-service.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.cinder_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.cinder_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.cinder_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.cinder_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/cinder/templates/job-ks-user.yaml b/cinder/templates/job-ks-user.yaml index ea884376ba..4b70078e79 100644 --- a/cinder/templates/job-ks-user.yaml +++ b/cinder/templates/job-ks-user.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: cinder-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.cinder_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.cinder_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.cinder_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.cinder_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/cinder/templates/pdb-api.yaml b/cinder/templates/pdb-api.yaml index 3fe5928278..aed09b4ab1 100644 --- a/cinder/templates/pdb-api.yaml +++ b/cinder/templates/pdb-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/cinder/templates/pod-rally-test.yaml b/cinder/templates/pod-rally-test.yaml index 80caaaf399..3ba86e1560 100644 --- a/cinder/templates/pod-rally-test.yaml +++ b/cinder/templates/pod-rally-test.yaml @@ -16,7 +16,7 @@ {{- $dependencies := .Values.dependencies.tests }} {{- $mounts_cinder_tests := .Values.mounts.cinder_tests.cinder_tests }} {{- $mounts_cinder_tests_init := .Values.mounts.cinder_tests.init_container }} - +--- apiVersion: v1 kind: Pod metadata: @@ -31,15 +31,7 @@ spec: - name: {{.Release.Name}}-token-issue-test image: {{ .Values.images.test }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.tests.limits.cpu | quote }} - memory: {{ .Values.resources.tests.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.tests.requests.cpu | quote }} - memory: {{ .Values.resources.tests.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} env: {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }} @@ -60,7 +52,7 @@ spec: readOnly: true - name: rally-db mountPath: /var/lib/rally -{{ if $mounts_cinder_tests.volumeMounts }}{{ toYaml $mounts_cinder_tests.volumeMounts | indent 8 }}{{ end }} +{{- if $mounts_cinder_tests.volumeMounts }}{{ toYaml $mounts_cinder_tests.volumeMounts | indent 8 }}{{ end }} volumes: - name: cinder-etc configMap: @@ -70,4 +62,4 @@ spec: name: cinder-bin - name: rally-db emptyDir: {} -{{ if $mounts_cinder_tests.volumes }}{{ toYaml $mounts_cinder_tests.volumes | indent 4 }}{{ end }} +{{- if $mounts_cinder_tests.volumes }}{{ toYaml $mounts_cinder_tests.volumes | indent 4 }}{{ end }} diff --git a/cinder/templates/secret-db.yaml b/cinder/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/cinder/templates/secret-db.yaml +++ b/cinder/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/cinder/templates/secret-keystone.yaml b/cinder/templates/secret-keystone.yaml index 2507c3b3b8..0f963b248f 100644 --- a/cinder/templates/secret-keystone.yaml +++ b/cinder/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/cinder/templates/service-api.yaml b/cinder/templates/service-api.yaml index a45eecc9ec..45dd1d965c 100644 --- a/cinder/templates/service-api.yaml +++ b/cinder/templates/service-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/cinder/templates/service-ingress-api.yaml b/cinder/templates/service-ingress-api.yaml index 927371d331..63b4b7c85a 100644 --- a/cinder/templates/service-ingress-api.yaml +++ b/cinder/templates/service-ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/cinder/values.yaml b/cinder/values.yaml index d8b25798b1..518027c1c0 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -45,11 +45,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -367,83 +368,77 @@ endpoints: resources: enabled: false - cinder_api: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_bootstrap: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_scheduler: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_volume: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_backup: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_db_init: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_db_sync: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_ks_endpoints: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_ks_service: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - cinder_ks_user: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - tests: - limits: - memory: "128Mi" - cpu: "500m" + api: requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + scheduler: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + volume: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_service: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" mounts: cinder_api: diff --git a/glance/templates/configmap-bin.yaml b/glance/templates/configmap-bin.yaml index b104293f73..5eed50e1bf 100644 --- a/glance/templates/configmap-bin.yaml +++ b/glance/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/glance/templates/configmap-etc.yaml b/glance/templates/configmap-etc.yaml index f4e1a2764f..5d0568a0b6 100644 --- a/glance/templates/configmap-etc.yaml +++ b/glance/templates/configmap-etc.yaml @@ -11,6 +11,9 @@ # 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. + +{{- $envAll := . }} + {{- include "glance.conf.glance_values_skeleton" .Values.conf.glance | trunc 0 -}} {{- include "glance.conf.glance_registry_values_skeleton" .Values.conf.glance_registry | trunc 0 -}} @@ -104,7 +107,7 @@ {{- tuple "image" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.glance.default.glance.api "public_endpoint" | quote | trunc 0 -}} {{- end -}} - +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/glance/templates/deployment-api.yaml b/glance/templates/deployment-api.yaml index 072bbb65bd..5e0ffa72f2 100644 --- a/glance/templates/deployment-api.yaml +++ b/glance/templates/deployment-api.yaml @@ -23,14 +23,7 @@ metadata: name: glance-api spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -52,15 +45,7 @@ spec: imagePullPolicy: {{ .Values.images.pull_policy }} securityContext: runAsUser: 0 - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.api.limits.cpu | quote }} - memory: {{ .Values.resources.api.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.api.requests.cpu | quote }} - memory: {{ .Values.resources.api.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - chown - -R @@ -91,15 +76,7 @@ spec: - name: glance-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.api.limits.cpu | quote }} - memory: {{ .Values.resources.api.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.api.requests.cpu | quote }} - memory: {{ .Values.resources.api.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/glance-api.sh - start @@ -148,7 +125,7 @@ spec: subPath: key readOnly: true {{- end }} -{{ if $mounts_glance_api.volumeMounts }}{{ toYaml $mounts_glance_api.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_glance_api.volumeMounts }}{{ toYaml $mounts_glance_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: etcglance emptyDir: {} @@ -173,4 +150,4 @@ spec: secret: secretName: pvc-ceph-client-key {{- end }} -{{ if $mounts_glance_api.volumes }}{{ toYaml $mounts_glance_api.volumes | indent 8 }}{{ end }} +{{- if $mounts_glance_api.volumes }}{{ toYaml $mounts_glance_api.volumes | indent 8 }}{{ end }} diff --git a/glance/templates/deployment-registry.yaml b/glance/templates/deployment-registry.yaml index 895799b2ff..d32016c131 100644 --- a/glance/templates/deployment-registry.yaml +++ b/glance/templates/deployment-registry.yaml @@ -23,6 +23,7 @@ metadata: name: glance-registry spec: replicas: {{ .Values.replicas.registry }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -42,15 +43,7 @@ spec: - name: glance-registry image: {{ .Values.images.registry }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.registry.limits.cpu | quote }} - memory: {{ .Values.resources.registry.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.registry.requests.cpu | quote }} - memory: {{ .Values.resources.registry.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.registry | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/glance-registry.sh - start @@ -84,7 +77,7 @@ spec: mountPath: /etc/glance/policy.json subPath: policy.json readOnly: true -{{ if $mounts_glance_registry.volumeMounts }}{{ toYaml $mounts_glance_registry.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_glance_registry.volumeMounts }}{{ toYaml $mounts_glance_registry.volumeMounts | indent 12 }}{{ end }} volumes: - name: etcglance emptyDir: {} @@ -95,4 +88,4 @@ spec: - name: glance-etc configMap: name: glance-etc -{{ if $mounts_glance_registry.volumes }}{{ toYaml $mounts_glance_registry.volumes | indent 8 }}{{ end }} +{{- if $mounts_glance_registry.volumes }}{{ toYaml $mounts_glance_registry.volumes | indent 8 }}{{ end }} diff --git a/glance/templates/ingress-api.yaml b/glance/templates/ingress-api.yaml index 57855a87ef..e2c1917723 100644 --- a/glance/templates/ingress-api.yaml +++ b/glance/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/glance/templates/ingress-registry.yaml b/glance/templates/ingress-registry.yaml index f0a88f5fe4..2f55c0fdba 100644 --- a/glance/templates/ingress-registry.yaml +++ b/glance/templates/ingress-registry.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.registry.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/glance/templates/job-bootstrap.yaml b/glance/templates/job-bootstrap.yaml index eb52825dc7..5a70663b6f 100644 --- a/glance/templates/job-bootstrap.yaml +++ b/glance/templates/job-bootstrap.yaml @@ -31,15 +31,7 @@ spec: - name: glance-bootstrap image: {{ .Values.images.bootstrap }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.jobs.bootstrap.limits.cpu | quote }} - memory: {{ .Values.resources.jobs.bootstrap.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.jobs.bootstrap.requests.cpu | quote }} - memory: {{ .Values.resources.jobs.bootstrap.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.bootstrap | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }} diff --git a/glance/templates/job-db-init.yaml b/glance/templates/job-db-init.yaml index 11518c854d..88426e5871 100644 --- a/glance/templates/job-db-init.yaml +++ b/glance/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: glance-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.jobs.init.limits.cpu | quote }} - memory: {{ .Values.resources.jobs.init.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.jobs.init.requests.cpu | quote }} - memory: {{ .Values.resources.jobs.init.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/glance/templates/job-db-sync.yaml b/glance/templates/job-db-sync.yaml index 1f3e1f38db..c94ba6e249 100644 --- a/glance/templates/job-db-sync.yaml +++ b/glance/templates/job-db-sync.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: glance-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.jobs.db.limits.cpu | quote }} - memory: {{ .Values.resources.jobs.db.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.jobs.db.requests.cpu | quote }} - memory: {{ .Values.resources.jobs.db.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/glance/templates/job-ks-endpoints.yaml b/glance/templates/job-ks-endpoints.yaml index 401a3d0f47..e168a37b6e 100644 --- a/glance/templates/job-ks-endpoints.yaml +++ b/glance/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.glance_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.glance_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.glance_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.glance_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/glance/templates/job-ks-service.yaml b/glance/templates/job-ks-service.yaml index 0b22ad26e7..140ac5be57 100644 --- a/glance/templates/job-ks-service.yaml +++ b/glance/templates/job-ks-service.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} --- @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.glance_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.glance_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.glance_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.glance_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/glance/templates/job-ks-user.yaml b/glance/templates/job-ks-user.yaml index f9aa6224f5..766ad6af8f 100644 --- a/glance/templates/job-ks-user.yaml +++ b/glance/templates/job-ks-user.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} --- @@ -30,15 +31,7 @@ spec: - name: glance-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.glance_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.glance_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.glance_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.glance_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/glance/templates/pdb-api.yaml b/glance/templates/pdb-api.yaml index 6d60c714ee..784f0b9de0 100644 --- a/glance/templates/pdb-api.yaml +++ b/glance/templates/pdb-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/glance/templates/pdb-registry.yaml b/glance/templates/pdb-registry.yaml index fd487aa343..26d5f7778b 100644 --- a/glance/templates/pdb-registry.yaml +++ b/glance/templates/pdb-registry.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/glance/templates/pod-rally-test.yaml b/glance/templates/pod-rally-test.yaml index 3e48c5c230..ee7c6ca6bd 100644 --- a/glance/templates/pod-rally-test.yaml +++ b/glance/templates/pod-rally-test.yaml @@ -16,7 +16,7 @@ {{- $dependencies := .Values.dependencies.tests }} {{- $mounts_glance_tests := .Values.mounts.glance_tests.glance_tests }} {{- $mounts_glance_tests_init := .Values.mounts.glance_tests.init_container }} - +--- apiVersion: v1 kind: Pod metadata: @@ -31,15 +31,7 @@ spec: - name: {{.Release.Name}}-token-issue-test image: {{ .Values.images.test }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.tests.limits.cpu | quote }} - memory: {{ .Values.resources.tests.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.tests.requests.cpu | quote }} - memory: {{ .Values.resources.tests.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} env: {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }} @@ -60,7 +52,7 @@ spec: readOnly: true - name: rally-db mountPath: /var/lib/rally -{{ if $mounts_glance_tests.volumeMounts }}{{ toYaml $mounts_glance_tests.volumeMounts | indent 8 }}{{ end }} +{{- if $mounts_glance_tests.volumeMounts }}{{ toYaml $mounts_glance_tests.volumeMounts | indent 8 }}{{ end }} volumes: - name: glance-etc configMap: @@ -70,4 +62,4 @@ spec: name: glance-bin - name: rally-db emptyDir: {} -{{ if $mounts_glance_tests.volumes }}{{ toYaml $mounts_glance_tests.volumes | indent 4 }}{{ end }} +{{- if $mounts_glance_tests.volumes }}{{ toYaml $mounts_glance_tests.volumes | indent 4 }}{{ end }} diff --git a/glance/templates/pvc-images.yaml b/glance/templates/pvc-images.yaml index 3a346283a1..1533544be2 100644 --- a/glance/templates/pvc-images.yaml +++ b/glance/templates/pvc-images.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if eq .Values.storage "pvc" }} +--- kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/glance/templates/secret-db.yaml b/glance/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/glance/templates/secret-db.yaml +++ b/glance/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/glance/templates/secret-keystone.yaml b/glance/templates/secret-keystone.yaml index 2507c3b3b8..0f963b248f 100644 --- a/glance/templates/secret-keystone.yaml +++ b/glance/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/glance/templates/service-api.yaml b/glance/templates/service-api.yaml index 6b1991ff97..cb2cc17e65 100644 --- a/glance/templates/service-api.yaml +++ b/glance/templates/service-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/glance/templates/service-ingress-api.yaml b/glance/templates/service-ingress-api.yaml index 6adec249fd..57674db1bb 100644 --- a/glance/templates/service-ingress-api.yaml +++ b/glance/templates/service-ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/glance/templates/service-ingress-registry.yaml b/glance/templates/service-ingress-registry.yaml index c4a4dfea44..5bada412d4 100644 --- a/glance/templates/service-ingress-registry.yaml +++ b/glance/templates/service-ingress-registry.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.registry.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/glance/templates/service-registry.yaml b/glance/templates/service-registry.yaml index 11ba2f85fa..444db61379 100644 --- a/glance/templates/service-registry.yaml +++ b/glance/templates/service-registry.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/glance/values.yaml b/glance/values.yaml index c5ba55dc68..ca0f8c4431 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -42,11 +42,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -158,55 +159,69 @@ volume: resources: enabled: false api: + requests: + memory: "128Mi" + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - requests: - memory: "128Mi" - cpu: "500m" registry: + requests: + memory: "128Mi" + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - requests: - memory: "128Mi" - cpu: "500m" jobs: - db: + db_sync: + requests: + memory: "128Mi" + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + db_init: requests: memory: "128Mi" - cpu: "500m" - init: + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + ks_user: requests: memory: "128Mi" - cpu: "500m" - post: + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + ks_service: requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" bootstrap: + requests: + memory: "128Mi" + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + tests: requests: memory: "128Mi" - cpu: "500m" - tests: - limits: - memory: "1024Mi" - cpu: "2000m" - requests: - memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" dependencies: db_init: diff --git a/heat/templates/configmap-bin.yaml b/heat/templates/configmap-bin.yaml index 3b0487ffaa..3d8cc3e642 100644 --- a/heat/templates/configmap-bin.yaml +++ b/heat/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/heat/templates/configmap-etc.yaml b/heat/templates/configmap-etc.yaml index 27dd71cd8e..e12f5c23f5 100644 --- a/heat/templates/configmap-etc.yaml +++ b/heat/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "heat.conf.heat_values_skeleton" .Values.conf.heat | trunc 0 -}} {{- if empty .Values.conf.heat.keystone_authtoken.keystonemiddleware.auth_token.auth_uri -}} @@ -103,6 +105,7 @@ {{- tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | trimSuffix .Values.endpoints.identity.path.default | set .Values.conf.heat.trustee.heat.common.context "auth_url" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/heat/templates/deployment-api.yaml b/heat/templates/deployment-api.yaml index c2036f3cd2..9120e95ec9 100644 --- a/heat/templates/deployment-api.yaml +++ b/heat/templates/deployment-api.yaml @@ -23,14 +23,7 @@ metadata: name: heat-api spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: heat-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.heat_api.requests.memory | quote }} - cpu: {{ .Values.resources.heat_api.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.heat_api.limits.memory | quote }} - cpu: {{ .Values.resources.heat_api.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/heat-api.sh - start @@ -94,7 +79,7 @@ spec: mountPath: /etc/heat/policy.json subPath: policy.json readOnly: true -{{ if $mounts_heat_api.volumeMounts }}{{ toYaml $mounts_heat_api.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_heat_api.volumeMounts }}{{ toYaml $mounts_heat_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-heat emptyDir: {} @@ -107,4 +92,4 @@ spec: - name: heat-etc configMap: name: heat-etc -{{ if $mounts_heat_api.volumes }}{{ toYaml $mounts_heat_api.volumes | indent 8 }}{{ end }} +{{- if $mounts_heat_api.volumes }}{{ toYaml $mounts_heat_api.volumes | indent 8 }}{{ end }} diff --git a/heat/templates/deployment-cfn.yaml b/heat/templates/deployment-cfn.yaml index 66d03c0d13..69907d4265 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -23,14 +23,7 @@ metadata: name: heat-cfn spec: replicas: {{ .Values.replicas.cfn }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: heat-cfn image: {{ .Values.images.cfn }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.heat_cfn.requests.memory | quote }} - cpu: {{ .Values.resources.heat_cfn.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.heat_cfn.limits.memory | quote }} - cpu: {{ .Values.resources.heat_cfn.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.cfn | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/heat-cfn.sh - start @@ -94,7 +79,7 @@ spec: mountPath: /etc/heat/policy.json subPath: policy.json readOnly: true -{{ if $mounts_heat_cfn.volumeMounts }}{{ toYaml $mounts_heat_cfn.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_heat_cfn.volumeMounts }}{{ toYaml $mounts_heat_cfn.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-heat emptyDir: {} @@ -107,4 +92,4 @@ spec: - name: heat-etc configMap: name: heat-etc -{{ if $mounts_heat_cfn.volumes }}{{ toYaml $mounts_heat_cfn.volumes | indent 8 }}{{ end }} +{{- if $mounts_heat_cfn.volumes }}{{ toYaml $mounts_heat_cfn.volumes | indent 8 }}{{ end }} diff --git a/heat/templates/deployment-cloudwatch.yaml b/heat/templates/deployment-cloudwatch.yaml index 6b8a94d2f9..9ff4b65fc7 100644 --- a/heat/templates/deployment-cloudwatch.yaml +++ b/heat/templates/deployment-cloudwatch.yaml @@ -23,14 +23,7 @@ metadata: name: heat-cloudwatch spec: replicas: {{ .Values.replicas.cloudwatch }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: heat-cloudwatch image: {{ .Values.images.cloudwatch }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.heat_cloudwatch.requests.memory | quote }} - cpu: {{ .Values.resources.heat_cloudwatch.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.heat_cloudwatch.limits.memory | quote }} - cpu: {{ .Values.resources.heat_cloudwatch.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.cloudwatch | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/heat-cloudwatch.sh - start @@ -94,7 +79,7 @@ spec: mountPath: /etc/heat/policy.json subPath: policy.json readOnly: true -{{ if $mounts_heat_cloudwatch.volumeMounts }}{{ toYaml $mounts_heat_cloudwatch.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_heat_cloudwatch.volumeMounts }}{{ toYaml $mounts_heat_cloudwatch.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-heat emptyDir: {} @@ -107,4 +92,4 @@ spec: - name: heat-etc configMap: name: heat-etc -{{ if $mounts_heat_cloudwatch.volumes }}{{ toYaml $mounts_heat_cloudwatch.volumes | indent 8 }}{{ end }} +{{- if $mounts_heat_cloudwatch.volumes }}{{ toYaml $mounts_heat_cloudwatch.volumes | indent 8 }}{{ end }} diff --git a/heat/templates/ingress-api.yaml b/heat/templates/ingress-api.yaml index fdc1983af5..2f63865853 100644 --- a/heat/templates/ingress-api.yaml +++ b/heat/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/heat/templates/ingress-cfn.yaml b/heat/templates/ingress-cfn.yaml index b23f847d00..2fd0cfbf68 100644 --- a/heat/templates/ingress-cfn.yaml +++ b/heat/templates/ingress-cfn.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.cfn.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/heat/templates/ingress-cloudwatch.yaml b/heat/templates/ingress-cloudwatch.yaml index c5680ec352..ccc7ec93f8 100644 --- a/heat/templates/ingress-cloudwatch.yaml +++ b/heat/templates/ingress-cloudwatch.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.cloudwatch.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/heat/templates/job-db-init.yaml b/heat/templates/job-db-init.yaml index 76162596b3..4d4b075413 100644 --- a/heat/templates/job-db-init.yaml +++ b/heat/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: heat-db-init image: {{ .Values.images.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.heat_db_init.requests.memory | quote }} - cpu: {{ .Values.resources.heat_db_init.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.heat_db_init.limits.memory | quote }} - cpu: {{ .Values.resources.heat_db_init.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/heat/templates/job-db-sync.yaml b/heat/templates/job-db-sync.yaml index cb4e594096..c3939235d2 100644 --- a/heat/templates/job-db-sync.yaml +++ b/heat/templates/job-db-sync.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: heat-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.heat_db_sync.requests.memory | quote }} - cpu: {{ .Values.resources.heat_db_sync.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.heat_db_sync.limits.memory | quote }} - cpu: {{ .Values.resources.heat_db_sync.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/heat/templates/job-ks-endpoints.yaml b/heat/templates/job-ks-endpoints.yaml index 32892f4993..03fced795f 100644 --- a/heat/templates/job-ks-endpoints.yaml +++ b/heat/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.heat_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.heat_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.heat_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.heat_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/heat/templates/job-ks-service.yaml b/heat/templates/job-ks-service.yaml index b3e59fe8e2..c8b1670368 100644 --- a/heat/templates/job-ks-service.yaml +++ b/heat/templates/job-ks-service.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.heat_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.heat_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.heat_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.heat_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/heat/templates/job-ks-user.yaml b/heat/templates/job-ks-user.yaml index 99f02a9c97..8e9e97fa1e 100644 --- a/heat/templates/job-ks-user.yaml +++ b/heat/templates/job-ks-user.yaml @@ -14,7 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} -# The heat user management job is a bit different from other services as it also needs to create a stack domain and trusts user +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +31,7 @@ spec: - name: heat-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.heat_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.heat_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.heat_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.heat_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/heat/templates/pdb-api.yaml b/heat/templates/pdb-api.yaml index f3797af0df..f103416cef 100644 --- a/heat/templates/pdb-api.yaml +++ b/heat/templates/pdb-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/heat/templates/pdb-cfn.yaml b/heat/templates/pdb-cfn.yaml index 1c07f47282..e72bb106d0 100644 --- a/heat/templates/pdb-cfn.yaml +++ b/heat/templates/pdb-cfn.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/heat/templates/pdb-cloudwatch.yaml b/heat/templates/pdb-cloudwatch.yaml index 9cf374ea5a..c5ca967f64 100644 --- a/heat/templates/pdb-cloudwatch.yaml +++ b/heat/templates/pdb-cloudwatch.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/heat/templates/secret-db.yaml b/heat/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/heat/templates/secret-db.yaml +++ b/heat/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/heat/templates/secret-keystone.yaml b/heat/templates/secret-keystone.yaml index 8be0183661..f9ee15f9bc 100644 --- a/heat/templates/secret-keystone.yaml +++ b/heat/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" "trustee" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/heat/templates/service-api.yaml b/heat/templates/service-api.yaml index 87d1f367f1..d8333accb9 100644 --- a/heat/templates/service-api.yaml +++ b/heat/templates/service-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/heat/templates/service-cfn.yaml b/heat/templates/service-cfn.yaml index ff539b7059..acee8674b6 100644 --- a/heat/templates/service-cfn.yaml +++ b/heat/templates/service-cfn.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/heat/templates/service-cloudwatch.yaml b/heat/templates/service-cloudwatch.yaml index 2107c67844..794d5ec3aa 100644 --- a/heat/templates/service-cloudwatch.yaml +++ b/heat/templates/service-cloudwatch.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/heat/templates/service-ingress-api.yaml b/heat/templates/service-ingress-api.yaml index f46060d74d..e4aba46247 100644 --- a/heat/templates/service-ingress-api.yaml +++ b/heat/templates/service-ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/heat/templates/service-ingress-cfn.yaml b/heat/templates/service-ingress-cfn.yaml index 881619ca02..347753ae21 100644 --- a/heat/templates/service-ingress-cfn.yaml +++ b/heat/templates/service-ingress-cfn.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.cfn.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/heat/templates/service-ingress-cloudwatch.yaml b/heat/templates/service-ingress-cloudwatch.yaml index 94a203752b..4261b171a9 100644 --- a/heat/templates/service-ingress-cloudwatch.yaml +++ b/heat/templates/service-ingress-cloudwatch.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.cloudwatch.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index 3c47167f9b..ecb3b5ea01 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -39,15 +39,7 @@ spec: - name: heat-engine image: {{ .Values.images.engine }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.heat_engine.requests.memory | quote }} - cpu: {{ .Values.resources.heat_engine.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.heat_engine.limits.memory | quote }} - cpu: {{ .Values.resources.heat_engine.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.engine | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/heat-engine.sh volumeMounts: @@ -67,7 +59,7 @@ spec: mountPath: /etc/heat/policy.json subPath: policy.json readOnly: true -{{ if $mounts_heat_engine.volumeMounts }}{{ toYaml $mounts_heat_engine.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_heat_engine.volumeMounts }}{{ toYaml $mounts_heat_engine.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-heat emptyDir: {} @@ -80,4 +72,4 @@ spec: - name: heat-etc configMap: name: heat-etc -{{ if $mounts_heat_engine.volumes }}{{ toYaml $mounts_heat_engine.volumes | indent 8 }}{{ end }} +{{- if $mounts_heat_engine.volumes }}{{ toYaml $mounts_heat_engine.volumes | indent 8 }}{{ end }} diff --git a/heat/values.yaml b/heat/values.yaml index a031425b41..c6b38bc44b 100644 --- a/heat/values.yaml +++ b/heat/values.yaml @@ -42,11 +42,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -350,69 +351,84 @@ endpoints: resources: enabled: false - heat_api: + api: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - heat_cfn: + cfn: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - heat_cloudwatch: + cloudwatch: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - heat_db_init: + engine: requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - heat_db_sync: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - heat_ks_endpoints: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - heat_ks_service: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - heat_ks_user: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - heat_engine: - requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_service: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" mounts: heat_api: diff --git a/helm-toolkit/templates/snippets/_ks_env_openrc.tpl b/helm-toolkit/templates/snippets/_keystone_openrc_env_vars.tpl similarity index 100% rename from helm-toolkit/templates/snippets/_ks_env_openrc.tpl rename to helm-toolkit/templates/snippets/_keystone_openrc_env_vars.tpl diff --git a/helm-toolkit/templates/snippets/_ks_env_user_create_openrc.tpl b/helm-toolkit/templates/snippets/_keystone_user_create_env_vars.tpl similarity index 100% rename from helm-toolkit/templates/snippets/_ks_env_user_create_openrc.tpl rename to helm-toolkit/templates/snippets/_keystone_user_create_env_vars.tpl diff --git a/helm-toolkit/templates/snippets/_k8s_init_dep_check.tpl b/helm-toolkit/templates/snippets/_kubernetes_entrypoint_init_container.tpl similarity index 100% rename from helm-toolkit/templates/snippets/_k8s_init_dep_check.tpl rename to helm-toolkit/templates/snippets/_kubernetes_entrypoint_init_container.tpl diff --git a/helm-toolkit/templates/snippets/_k8s_metadata_labels.tpl b/helm-toolkit/templates/snippets/_kubernetes_metadata_labels.tpl similarity index 100% rename from helm-toolkit/templates/snippets/_k8s_metadata_labels.tpl rename to helm-toolkit/templates/snippets/_kubernetes_metadata_labels.tpl diff --git a/helm-toolkit/templates/snippets/_k8s_pod_antiaffinity.tpl b/helm-toolkit/templates/snippets/_kubernetes_pod_anti_affinity.tpl similarity index 100% rename from helm-toolkit/templates/snippets/_k8s_pod_antiaffinity.tpl rename to helm-toolkit/templates/snippets/_kubernetes_pod_anti_affinity.tpl diff --git a/helm-toolkit/templates/snippets/_kubernetes_resources.tpl b/helm-toolkit/templates/snippets/_kubernetes_resources.tpl new file mode 100644 index 0000000000..e0fde71f8b --- /dev/null +++ b/helm-toolkit/templates/snippets/_kubernetes_resources.tpl @@ -0,0 +1,27 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. + +{{- define "helm-toolkit.snippets.kubernetes_resources" -}} +{{- $envAll := index . 0 -}} +{{- $component := index . 1 -}} +{{- if $envAll.Values.resources.enabled -}} +resources: + limits: + cpu: {{ $component.limits.cpu | quote }} + memory: {{ $component.limits.memory | quote }} + requests: + cpu: {{ $component.requests.cpu | quote }} + memory: {{ $component.requests.memory | quote }} +{{- end -}} +{{- end -}} diff --git a/helm-toolkit/templates/snippets/_kubernetes_upgrades_daemonset.tpl b/helm-toolkit/templates/snippets/_kubernetes_upgrades_daemonset.tpl new file mode 100644 index 0000000000..682e1584ae --- /dev/null +++ b/helm-toolkit/templates/snippets/_kubernetes_upgrades_daemonset.tpl @@ -0,0 +1,32 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. + +{{- define "helm-toolkit.snippets.kubernetes_upgrades_daemonset" -}} +{{- $envAll := index . 0 -}} +{{- $component := index . 1 -}} +{{- $upgradeMap := index $envAll.Values.upgrades.daemonsets $component }} +{{- with $upgradeMap -}} +{{- if .enabled }} +minReadySeconds: {{ .min_ready_seconds }} +updateStrategy: + type: {{ .pod_replacement_strategy }} + {{- if .pod_replacement_strategy }} + {{- if eq .pod_replacement_strategy "RollingUpdate" }} + rollingUpdate: + maxUnavailable: {{ .max_unavailable }} + {{- end }} + {{- end }} +{{- end }} +{{- end -}} +{{- end -}} diff --git a/helm-toolkit/templates/snippets/_kubernetes_upgrades_deployment.tpl b/helm-toolkit/templates/snippets/_kubernetes_upgrades_deployment.tpl new file mode 100644 index 0000000000..fc6c3e6545 --- /dev/null +++ b/helm-toolkit/templates/snippets/_kubernetes_upgrades_deployment.tpl @@ -0,0 +1,27 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. + +{{- define "helm-toolkit.snippets.kubernetes_upgrades_deployment" -}} +{{- $envAll := index . 0 -}} +{{- with $envAll.Values.upgrades.deployments -}} +revisionHistoryLimit: {{ .revision_history }} +strategy: + type: {{ .pod_replacement_strategy }} + {{- if eq .pod_replacement_strategy "RollingUpdate" }} + rollingUpdate: + maxUnavailable: {{ .rolling_update.max_unavailable }} + maxSurge: {{ .rolling_update.max_surge }} + {{- end }} +{{- end -}} +{{- end -}} diff --git a/horizon/templates/configmap-bin.yaml b/horizon/templates/configmap-bin.yaml index 3d6bf285ed..c3df219b4d 100644 --- a/horizon/templates/configmap-bin.yaml +++ b/horizon/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/horizon/templates/configmap-etc.yaml b/horizon/templates/configmap-etc.yaml index 165502e52f..c278962c36 100644 --- a/horizon/templates/configmap-etc.yaml +++ b/horizon/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/horizon/templates/deployment.yaml b/horizon/templates/deployment.yaml index f5380b199f..a70b26a545 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -23,14 +23,7 @@ metadata: name: horizon spec: replicas: {{ .Values.replicas }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: horizon image: {{ .Values.images.horizon }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.dashboard.limits.cpu | quote }} - memory: {{ .Values.resources.dashboard.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.dashboard.requests.cpu | quote }} - memory: {{ .Values.resources.dashboard.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/horizon.sh - start @@ -86,7 +71,7 @@ spec: mountPath: /etc/openstack-dashboard/local_settings subPath: local_settings readOnly: true -{{ if $mounts_horizon.volumeMounts }}{{ toYaml $mounts_horizon.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_horizon.volumeMounts }}{{ toYaml $mounts_horizon.volumeMounts | indent 12 }}{{ end }} securityContext: runAsUser: 0 volumes: @@ -97,4 +82,4 @@ spec: - name: horizon-etc configMap: name: horizon-etc -{{ if $mounts_horizon.volumes }}{{ toYaml $mounts_horizon.volumes | indent 8 }}{{ end }} +{{- if $mounts_horizon.volumes }}{{ toYaml $mounts_horizon.volumes | indent 8 }}{{ end }} diff --git a/horizon/templates/ingress-api.yaml b/horizon/templates/ingress-api.yaml index ff6792f73d..0367920456 100644 --- a/horizon/templates/ingress-api.yaml +++ b/horizon/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/horizon/templates/pdb.yaml b/horizon/templates/pdb.yaml index 3ee602dd8b..baf12a4df0 100644 --- a/horizon/templates/pdb.yaml +++ b/horizon/templates/pdb.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/horizon/templates/service-ingress.yaml b/horizon/templates/service-ingress.yaml index 6535f45186..810ae88942 100644 --- a/horizon/templates/service-ingress.yaml +++ b/horizon/templates/service-ingress.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/horizon/templates/service.yaml b/horizon/templates/service.yaml index f2c2607c03..7a15183c11 100644 --- a/horizon/templates/service.yaml +++ b/horizon/templates/service.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/horizon/values.yaml b/horizon/values.yaml index d0ca2fb76b..c33a012210 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -25,11 +25,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: horizon: @@ -64,13 +65,13 @@ dependencies: resources: enabled: false - dashboard: - limits: - memory: "128Mi" - cpu: "500m" + server: requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1204Mi" + cpu: "2000m" # typically overriden by environmental # values, but should include all endpoints diff --git a/ingress/templates/configmap-etc.yaml b/ingress/templates/configmap-etc.yaml index 801da0f50d..96c423ad29 100644 --- a/ingress/templates/configmap-etc.yaml +++ b/ingress/templates/configmap-etc.yaml @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.host_namespace }} --- apiVersion: v1 diff --git a/ingress/templates/deployment-error.yaml b/ingress/templates/deployment-error.yaml index ff0866cf41..4cfab7e529 100644 --- a/ingress/templates/deployment-error.yaml +++ b/ingress/templates/deployment-error.yaml @@ -12,20 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: apps/v1beta1 kind: Deployment metadata: name: ingress-error-pages spec: replicas: {{ .Values.replicas.error_page }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: annotations: @@ -40,15 +35,7 @@ spec: - name: ingress-error-pages image: {{ .Values.images.error_pages }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.error_pages.limits.cpu | quote }} - memory: {{ .Values.resources.error_pages.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.error_pages.requests.cpu | quote }} - memory: {{ .Values.resources.error_pages.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.ingress | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} livenessProbe: httpGet: path: /healthz diff --git a/ingress/templates/deployment-ingress.yaml b/ingress/templates/deployment-ingress.yaml index 574a7a1eaa..7189296acb 100644 --- a/ingress/templates/deployment-ingress.yaml +++ b/ingress/templates/deployment-ingress.yaml @@ -12,21 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: apps/v1beta1 kind: {{ .Values.deployment_type }} metadata: name: ingress-api spec: {{- if eq .Values.deployment_type "Deployment" }} - replicas: {{ .Values.replicas.ingress }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} {{- end }} template: metadata: @@ -45,15 +39,7 @@ spec: - name: ingress-api image: {{ .Values.images.ingress }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.ingress.limits.cpu | quote }} - memory: {{ .Values.resources.ingress.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.ingress.requests.cpu | quote }} - memory: {{ .Values.resources.ingress.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.error_pages | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} readinessProbe: httpGet: path: /healthz diff --git a/ingress/templates/service-error.yaml b/ingress/templates/service-error.yaml index 02c4766cdb..76bf235988 100644 --- a/ingress/templates/service-error.yaml +++ b/ingress/templates/service-error.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: Service metadata: diff --git a/ingress/templates/service-ingress.yaml b/ingress/templates/service-ingress.yaml index 7c29946ae2..5f2bb53def 100644 --- a/ingress/templates/service-ingress.yaml +++ b/ingress/templates/service-ingress.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: Service metadata: diff --git a/ingress/values.yaml b/ingress/values.yaml index 0fc204c5f3..73b4335c75 100644 --- a/ingress/values.yaml +++ b/ingress/values.yaml @@ -29,11 +29,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 labels: node_selector_key: openstack-control-plane @@ -59,18 +60,18 @@ endpoints: deployment_type: Deployment resources: - enabled: false - error_pages: - limits: - memory: "128Mi" - cpu: "500m" - requests: - memory: "128Mi" - cpu: "500m" + enabled: true ingress: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + error_pages: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" diff --git a/keystone/templates/configmap-bin.yaml b/keystone/templates/configmap-bin.yaml index f12e697224..f4a6324b54 100644 --- a/keystone/templates/configmap-bin.yaml +++ b/keystone/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/keystone/templates/configmap-etc.yaml b/keystone/templates/configmap-etc.yaml index a144a7ca3b..c5203781cb 100644 --- a/keystone/templates/configmap-etc.yaml +++ b/keystone/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "keystone.conf.keystone_values_skeleton" .Values.conf.keystone | trunc 0 -}} {{- if empty .Values.conf.keystone.database.oslo.db.connection -}} @@ -26,6 +28,7 @@ {{- tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.keystone.cache.oslo.cache "memcache_servers" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/keystone/templates/deployment.yaml b/keystone/templates/deployment.yaml index 49c4c865ed..e8661f2635 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.api }} {{- $mounts_keystone_api := .Values.mounts.keystone_api.keystone_api }} @@ -22,14 +23,7 @@ metadata: name: keystone-api spec: replicas: {{ .Values.replicas }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -49,15 +43,7 @@ spec: - name: keystone-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.api.limits.cpu | quote }} - memory: {{ .Values.resources.api.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.api.requests.cpu | quote }} - memory: {{ .Values.resources.api.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/keystone-api.sh - start @@ -108,7 +94,7 @@ spec: mountPath: /tmp/keystone-api.sh subPath: keystone-api.sh readOnly: true -{{ if $mounts_keystone_api.volumeMounts }}{{ toYaml $mounts_keystone_api.volumeMounts | indent 10 }}{{ end }} +{{- if $mounts_keystone_api.volumeMounts }}{{ toYaml $mounts_keystone_api.volumeMounts | indent 10 }}{{ end }} volumes: - name: etckeystone emptyDir: {} @@ -121,4 +107,4 @@ spec: configMap: name: keystone-bin defaultMode: 0555 -{{ if $mounts_keystone_api.volumes }}{{ toYaml $mounts_keystone_api.volumes | indent 6 }}{{ end }} +{{- if $mounts_keystone_api.volumes }}{{ toYaml $mounts_keystone_api.volumes | indent 6 }}{{ end }} diff --git a/keystone/templates/ingress.yaml b/keystone/templates/ingress.yaml index 118de4d9cc..c56b601a7d 100644 --- a/keystone/templates/ingress.yaml +++ b/keystone/templates/ingress.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/keystone/templates/job-bootstrap.yaml b/keystone/templates/job-bootstrap.yaml index 09da695d85..4cde8c9223 100644 --- a/keystone/templates/job-bootstrap.yaml +++ b/keystone/templates/job-bootstrap.yaml @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- if .Values.bootstrap.enabled }} {{- $envAll := . }} +{{- if .Values.bootstrap.enabled }} {{- $dependencies := .Values.dependencies.bootstrap }} {{- $mounts_keystone_bootstrap := .Values.mounts.keystone_bootstrap.keystone_bootstrap }} {{- $mounts_keystone_bootstrap_init := .Values.mounts.keystone_bootstrap.init_container }} - +--- apiVersion: batch/v1 kind: Job metadata: @@ -34,15 +34,7 @@ spec: - name: keystone-bootstrap image: {{ .Values.images.bootstrap }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.jobs.bootstrap.limits.cpu | quote }} - memory: {{ .Values.resources.jobs.bootstrap.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.jobs.bootstrap.requests.cpu | quote }} - memory: {{ .Values.resources.jobs.bootstrap.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.bootstrap | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }} @@ -53,11 +45,11 @@ spec: - name: keystone-bin mountPath: /tmp/bootstrap.sh subPath: bootstrap.sh -{{ if $mounts_keystone_bootstrap.volumeMounts }}{{ toYaml $mounts_keystone_bootstrap.volumeMounts | indent 10 }}{{ end }} +{{- if $mounts_keystone_bootstrap.volumeMounts }}{{ toYaml $mounts_keystone_bootstrap.volumeMounts | indent 10 }}{{ end }} volumes: - name: keystone-bin configMap: name: keystone-bin defaultMode: 0555 -{{ if $mounts_keystone_bootstrap.volumes }}{{ toYaml $mounts_keystone_bootstrap.volumes | indent 6 }}{{ end }} +{{- if $mounts_keystone_bootstrap.volumes }}{{ toYaml $mounts_keystone_bootstrap.volumes | indent 6 }}{{ end }} {{- end }} diff --git a/keystone/templates/job-db-init.yaml b/keystone/templates/job-db-init.yaml index 626954146b..19fafa6fa7 100644 --- a/keystone/templates/job-db-init.yaml +++ b/keystone/templates/job-db-init.yaml @@ -16,7 +16,7 @@ {{- $dependencies := .Values.dependencies.db_init }} {{- $mounts_keystone_db_init := .Values.mounts.keystone_db_init.keystone_db_init }} {{- $mounts_keystone_db_init_init := .Values.mounts.keystone_db_init.init_container }} - +--- apiVersion: batch/v1 kind: Job metadata: @@ -34,15 +34,7 @@ spec: - name: keystone-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.jobs.init.limits.cpu | quote }} - memory: {{ .Values.resources.jobs.init.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.jobs.init.requests.cpu | quote }} - memory: {{ .Values.resources.jobs.init.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: @@ -68,7 +60,7 @@ spec: mountPath: /tmp/db-init.py subPath: db-init.py readOnly: true -{{ if $mounts_keystone_db_init.volumeMounts }}{{ toYaml $mounts_keystone_db_init.volumeMounts | indent 10 }}{{ end }} +{{- if $mounts_keystone_db_init.volumeMounts }}{{ toYaml $mounts_keystone_db_init.volumeMounts | indent 10 }}{{ end }} volumes: - name: etckeystone emptyDir: {} @@ -79,4 +71,4 @@ spec: configMap: name: keystone-bin defaultMode: 0555 -{{ if $mounts_keystone_db_init.volumes }}{{ toYaml $mounts_keystone_db_init.volumes | indent 6 }}{{ end }} +{{- if $mounts_keystone_db_init.volumes }}{{ toYaml $mounts_keystone_db_init.volumes | indent 6 }}{{ end }} diff --git a/keystone/templates/job-db-sync.yaml b/keystone/templates/job-db-sync.yaml index 8300dc7f14..fb64370f9a 100644 --- a/keystone/templates/job-db-sync.yaml +++ b/keystone/templates/job-db-sync.yaml @@ -16,6 +16,7 @@ {{- $dependencies := .Values.dependencies.db_sync }} {{- $mounts_keystone_db_sync := .Values.mounts.keystone_db_sync.keystone_db_sync }} {{- $mounts_keystone_db_sync_init := .Values.mounts.keystone_db_sync.init_container }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -34,15 +35,7 @@ spec: - name: keystone-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.jobs.db_sync.limits.cpu | quote }} - memory: {{ .Values.resources.jobs.db_sync.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.jobs.db_sync.requests.cpu | quote }} - memory: {{ .Values.resources.jobs.db_sync.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: OS_BOOTSTRAP_ADMIN_URL value: {{ tuple "identity" "admin" "admin" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} @@ -66,7 +59,7 @@ spec: mountPath: /tmp/db-sync.sh subPath: db-sync.sh readOnly: true -{{ if $mounts_keystone_db_sync.volumeMounts }}{{ toYaml $mounts_keystone_db_sync.volumeMounts | indent 10 }}{{ end }} +{{- if $mounts_keystone_db_sync.volumeMounts }}{{ toYaml $mounts_keystone_db_sync.volumeMounts | indent 10 }}{{ end }} volumes: - name: etckeystone emptyDir: {} @@ -77,4 +70,4 @@ spec: configMap: name: keystone-bin defaultMode: 0555 -{{ if $mounts_keystone_db_sync.volumes }}{{ toYaml $mounts_keystone_db_sync.volumes | indent 6 }}{{ end }} +{{- if $mounts_keystone_db_sync.volumes }}{{ toYaml $mounts_keystone_db_sync.volumes | indent 6 }}{{ end }} diff --git a/keystone/templates/pdb.yaml b/keystone/templates/pdb.yaml index 498cb7c4bf..722521ee40 100644 --- a/keystone/templates/pdb.yaml +++ b/keystone/templates/pdb.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/keystone/templates/pod-rally-test.yaml b/keystone/templates/pod-rally-test.yaml index 01340ef82a..b66ac731e9 100644 --- a/keystone/templates/pod-rally-test.yaml +++ b/keystone/templates/pod-rally-test.yaml @@ -16,7 +16,7 @@ {{- $dependencies := .Values.dependencies.tests }} {{- $mounts_keystone_tests := .Values.mounts.keystone_tests.keystone_tests }} {{- $mounts_keystone_tests_init := .Values.mounts.keystone_tests.init_container }} - +--- apiVersion: v1 kind: Pod metadata: @@ -31,15 +31,7 @@ spec: - name: {{.Release.Name}}-token-issue-test image: {{ .Values.images.test }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.tests.limits.cpu | quote }} - memory: {{ .Values.resources.tests.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.tests.requests.cpu | quote }} - memory: {{ .Values.resources.tests.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} env: {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }} @@ -47,7 +39,6 @@ spec: - name: RALLY_ENV_NAME value: {{.Release.Name}} command: - - bash - /tmp/rally-test.sh volumeMounts: - name: keystone-etc @@ -60,7 +51,7 @@ spec: readOnly: true - name: rally-db mountPath: /var/lib/rally -{{ if $mounts_keystone_tests.volumeMounts }}{{ toYaml $mounts_keystone_tests.volumeMounts | indent 8 }}{{ end }} +{{- if $mounts_keystone_tests.volumeMounts }}{{ toYaml $mounts_keystone_tests.volumeMounts | indent 8 }}{{ end }} volumes: - name: keystone-etc configMap: @@ -68,6 +59,7 @@ spec: - name: keystone-bin configMap: name: keystone-bin + defaultMode: 0555 - name: rally-db emptyDir: {} -{{ if $mounts_keystone_tests.volumes }}{{ toYaml $mounts_keystone_tests.volumes | indent 4 }}{{ end }} +{{- if $mounts_keystone_tests.volumes }}{{ toYaml $mounts_keystone_tests.volumes | indent 4 }}{{ end }} diff --git a/keystone/templates/secret-db.yaml b/keystone/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/keystone/templates/secret-db.yaml +++ b/keystone/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/keystone/templates/secret-keystone.yaml b/keystone/templates/secret-keystone.yaml index 032eec642c..97d5a9f0fb 100644 --- a/keystone/templates/secret-keystone.yaml +++ b/keystone/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/keystone/templates/service-ingress.yaml b/keystone/templates/service-ingress.yaml index d0bf5284c0..e1d75bc8d3 100644 --- a/keystone/templates/service-ingress.yaml +++ b/keystone/templates/service-ingress.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/keystone/templates/service.yaml b/keystone/templates/service.yaml index bea03cab52..019e8fbf52 100644 --- a/keystone/templates/service.yaml +++ b/keystone/templates/service.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/keystone/values.yaml b/keystone/values.yaml index 205a2bee98..eca697cb55 100644 --- a/keystone/values.yaml +++ b/keystone/values.yaml @@ -33,11 +33,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -105,41 +106,41 @@ dependencies: resources: enabled: false api: + requests: + memory: "128Mi" + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - requests: - memory: "128Mi" - cpu: "500m" jobs: bootstrap: + requests: + memory: "128Mi" + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + db_init: requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" db_sync: + requests: + memory: "128Mi" + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + tests: requests: memory: "128Mi" - cpu: "500m" - init: + cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - requests: - memory: "128Mi" - cpu: "500m" - tests: - limits: - memory: "1024Mi" - cpu: "2000m" - requests: - memory: "128Mi" - cpu: "500m" mounts: keystone_db_init: diff --git a/magnum/templates/configmap-bin.yaml b/magnum/templates/configmap-bin.yaml index 66d42524cf..1551a8b7ea 100644 --- a/magnum/templates/configmap-bin.yaml +++ b/magnum/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/magnum/templates/configmap-etc.yaml b/magnum/templates/configmap-etc.yaml index 61bfa6c4a8..0b2f88c7c8 100644 --- a/magnum/templates/configmap-etc.yaml +++ b/magnum/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "magnum.conf.magnum_values_skeleton" .Values.conf.magnum | trunc 0 -}} {{- if empty .Values.conf.magnum.keystone_authtoken.keystonemiddleware.auth_token.auth_uri -}} @@ -54,6 +56,7 @@ {{- tuple "oslo_messaging" "internal" "user" "amqp" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | set .Values.conf.magnum.default.oslo.messaging "transport_url" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/magnum/templates/deployment-api.yaml b/magnum/templates/deployment-api.yaml index 672547d13f..be40df7871 100644 --- a/magnum/templates/deployment-api.yaml +++ b/magnum/templates/deployment-api.yaml @@ -23,14 +23,7 @@ metadata: name: magnum-api spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: magnum-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.magnum_api.requests.memory | quote }} - cpu: {{ .Values.resources.magnum_api.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.magnum_api.limits.memory | quote }} - cpu: {{ .Values.resources.magnum_api.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/magnum-api.sh - start @@ -94,7 +79,7 @@ spec: mountPath: /etc/magnum/policy.json subPath: policy.json readOnly: true -{{ if $mounts_magnum_api.volumeMounts }}{{ toYaml $mounts_magnum_api.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_magnum_api.volumeMounts }}{{ toYaml $mounts_magnum_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-magnum emptyDir: {} @@ -107,4 +92,4 @@ spec: - name: magnum-etc configMap: name: magnum-etc -{{ if $mounts_magnum_api.volumes }}{{ toYaml $mounts_magnum_api.volumes | indent 8 }}{{ end }} +{{- if $mounts_magnum_api.volumes }}{{ toYaml $mounts_magnum_api.volumes | indent 8 }}{{ end }} diff --git a/magnum/templates/ingress-api.yaml b/magnum/templates/ingress-api.yaml index c3eb789095..18b2dc7800 100644 --- a/magnum/templates/ingress-api.yaml +++ b/magnum/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/magnum/templates/job-db-init.yaml b/magnum/templates/job-db-init.yaml index 29603a7fd3..9add5dc24f 100644 --- a/magnum/templates/job-db-init.yaml +++ b/magnum/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: magnum-db-init image: {{ .Values.images.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.magnum_db_init.requests.memory | quote }} - cpu: {{ .Values.resources.magnum_db_init.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.magnum_db_init.limits.memory | quote }} - cpu: {{ .Values.resources.magnum_db_init.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/magnum/templates/job-db-sync.yaml b/magnum/templates/job-db-sync.yaml index 2e78bd8a7d..2fcc44d88b 100644 --- a/magnum/templates/job-db-sync.yaml +++ b/magnum/templates/job-db-sync.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: magnum-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.magnum_db_sync.requests.memory | quote }} - cpu: {{ .Values.resources.magnum_db_sync.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.magnum_db_sync.limits.memory | quote }} - cpu: {{ .Values.resources.magnum_db_sync.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/magnum/templates/job-ks-endpoints.yaml b/magnum/templates/job-ks-endpoints.yaml index ed14f505e4..af254a9e47 100644 --- a/magnum/templates/job-ks-endpoints.yaml +++ b/magnum/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.magnum_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.magnum_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.magnum_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.magnum_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/magnum/templates/job-ks-service.yaml b/magnum/templates/job-ks-service.yaml index 153645bf6b..731a9c9ffc 100644 --- a/magnum/templates/job-ks-service.yaml +++ b/magnum/templates/job-ks-service.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.magnum_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.magnum_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.magnum_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.magnum_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/magnum/templates/job-ks-user.yaml b/magnum/templates/job-ks-user.yaml index 4c7fae4092..17b026e692 100644 --- a/magnum/templates/job-ks-user.yaml +++ b/magnum/templates/job-ks-user.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: magnum-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.magnum_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.magnum_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.magnum_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.magnum_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/magnum/templates/pdb-api.yaml b/magnum/templates/pdb-api.yaml index 62b1d77496..8cf956be50 100644 --- a/magnum/templates/pdb-api.yaml +++ b/magnum/templates/pdb-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/magnum/templates/secret-db.yaml b/magnum/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/magnum/templates/secret-db.yaml +++ b/magnum/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/magnum/templates/secret-keystone.yaml b/magnum/templates/secret-keystone.yaml index 2507c3b3b8..0f963b248f 100644 --- a/magnum/templates/secret-keystone.yaml +++ b/magnum/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/magnum/templates/service-api.yaml b/magnum/templates/service-api.yaml index 639fba236b..2d8a6027d9 100644 --- a/magnum/templates/service-api.yaml +++ b/magnum/templates/service-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/magnum/templates/service-ingress-api.yaml b/magnum/templates/service-ingress-api.yaml index a773b776b4..784940b534 100644 --- a/magnum/templates/service-ingress-api.yaml +++ b/magnum/templates/service-ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/magnum/templates/statefulset-conductor.yaml b/magnum/templates/statefulset-conductor.yaml index ae7c6cbf9a..6089ca9c4f 100644 --- a/magnum/templates/statefulset-conductor.yaml +++ b/magnum/templates/statefulset-conductor.yaml @@ -39,15 +39,7 @@ spec: - name: magnum-conductor image: {{ .Values.images.conductor }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.magnum_conductor.requests.memory | quote }} - cpu: {{ .Values.resources.magnum_conductor.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.magnum_conductor.limits.memory | quote }} - cpu: {{ .Values.resources.magnum_conductor.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.conductor | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/magnum-conductor.sh volumeMounts: @@ -67,7 +59,7 @@ spec: mountPath: /etc/magnum/policy.json subPath: policy.json readOnly: true -{{ if $mounts_magnum_conductor.volumeMounts }}{{ toYaml $mounts_magnum_conductor.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_magnum_conductor.volumeMounts }}{{ toYaml $mounts_magnum_conductor.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-magnum emptyDir: {} @@ -80,4 +72,4 @@ spec: - name: magnum-etc configMap: name: magnum-etc -{{ if $mounts_magnum_conductor.volumes }}{{ toYaml $mounts_magnum_conductor.volumes | indent 8 }}{{ end }} +{{- if $mounts_magnum_conductor.volumes }}{{ toYaml $mounts_magnum_conductor.volumes | indent 8 }}{{ end }} diff --git a/magnum/values.yaml b/magnum/values.yaml index 1d7e69a6f0..21548cd8af 100644 --- a/magnum/values.yaml +++ b/magnum/values.yaml @@ -37,11 +37,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -226,55 +227,70 @@ endpoints: resources: enabled: false - magnum_api: + api: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - magnum_db_init: + conductor: requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - magnum_db_sync: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - magnum_ks_endpoints: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - magnum_ks_service: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - magnum_ks_user: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - magnum_conductor: - requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_service: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" mounts: magnum_api: diff --git a/mariadb/templates/configmap-bin.yaml b/mariadb/templates/configmap-bin.yaml index 5a04afcff0..2daa64ea51 100644 --- a/mariadb/templates/configmap-bin.yaml +++ b/mariadb/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/mariadb/templates/configmap-etc.yaml b/mariadb/templates/configmap-etc.yaml index b42ce327bd..b3dbab4105 100644 --- a/mariadb/templates/configmap-etc.yaml +++ b/mariadb/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/mariadb/templates/pdb-mariadb.yaml b/mariadb/templates/pdb-mariadb.yaml index 8506a0b6fc..409e6f92f2 100644 --- a/mariadb/templates/pdb-mariadb.yaml +++ b/mariadb/templates/pdb-mariadb.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/mariadb/templates/secret-db-root-password.yaml b/mariadb/templates/secret-db-root-password.yaml index 62d029e398..2cb4df4c9d 100644 --- a/mariadb/templates/secret-db-root-password.yaml +++ b/mariadb/templates/secret-db-root-password.yaml @@ -1,3 +1,19 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. + +{{- $envAll := . }} +--- apiVersion: v1 kind: Secret metadata: diff --git a/mariadb/templates/service-discovery.yaml b/mariadb/templates/service-discovery.yaml index e1dc356f7d..67f90f0431 100644 --- a/mariadb/templates/service-discovery.yaml +++ b/mariadb/templates/service-discovery.yaml @@ -14,6 +14,7 @@ # This service could be used for cluster pod discovery, though instead it's # primarily here to allow DNS lookups of cluster pods. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/mariadb/templates/service.yaml b/mariadb/templates/service.yaml index 836e2a47b1..a050988315 100644 --- a/mariadb/templates/service.yaml +++ b/mariadb/templates/service.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/mariadb/templates/statefulset.yaml b/mariadb/templates/statefulset.yaml index c1c63fcdb4..3b318acd3e 100644 --- a/mariadb/templates/statefulset.yaml +++ b/mariadb/templates/statefulset.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: apps/v1beta1 @@ -33,15 +34,7 @@ spec: - name: mariadb image: {{ .Values.images.mariadb }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.api.limits.cpu | quote }} - memory: {{ .Values.resources.api.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.api.requests.cpu | quote }} - memory: {{ .Values.resources.api.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/start.sh env: diff --git a/mariadb/values.yaml b/mariadb/values.yaml index 83e32ebb43..3f8647fcba 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -50,6 +50,16 @@ database: # [mysqld] # wsrep_slave_threads=1 +resources: + enabled: false + server: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + # typically overriden by environmental # values, but should include all endpoints # required by this chart diff --git a/mistral/templates/configmap-bin.yaml b/mistral/templates/configmap-bin.yaml index 658fcad181..66d6804647 100644 --- a/mistral/templates/configmap-bin.yaml +++ b/mistral/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/mistral/templates/configmap-etc.yaml b/mistral/templates/configmap-etc.yaml index 95ee7cbbb6..a73ba97eb7 100644 --- a/mistral/templates/configmap-etc.yaml +++ b/mistral/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "mistral.conf.mistral_values_skeleton" .Values.conf.mistral | trunc 0 -}} {{- if empty .Values.conf.mistral.keystone_authtoken.keystonemiddleware.auth_token.auth_uri -}} @@ -53,6 +55,7 @@ {{- tuple "oslo_messaging" "internal" "user" "amqp" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | set .Values.conf.mistral.default.oslo.messaging "transport_url" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/mistral/templates/deployment-api.yaml b/mistral/templates/deployment-api.yaml index 245c58e7fb..8abaa7f7f5 100644 --- a/mistral/templates/deployment-api.yaml +++ b/mistral/templates/deployment-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.api }} {{- $mounts_mistral_api := .Values.mounts.mistral_api.mistral_api }} @@ -22,14 +23,7 @@ metadata: name: mistral-api spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -49,15 +43,7 @@ spec: - name: mistral-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.api.limits.cpu | quote }} - memory: {{ .Values.resources.api.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.api.requests.cpu | quote }} - memory: {{ .Values.resources.api.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/mistral-api.sh - start @@ -88,7 +74,7 @@ spec: mountPath: /etc/mistral/policy.json subPath: policy.json readOnly: true -{{ if $mounts_mistral_api.volumeMounts }}{{ toYaml $mounts_mistral_api.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_mistral_api.volumeMounts }}{{ toYaml $mounts_mistral_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-mistral emptyDir: {} @@ -99,4 +85,4 @@ spec: - name: mistral-etc configMap: name: mistral-etc -{{ if $mounts_mistral_api.volumes }}{{ toYaml $mounts_mistral_api.volumes | indent 8 }}{{ end }} +{{- if $mounts_mistral_api.volumes }}{{ toYaml $mounts_mistral_api.volumes | indent 8 }}{{ end }} diff --git a/mistral/templates/deployment-executor.yaml b/mistral/templates/deployment-executor.yaml index 705fe2ed4d..c10fb14cd8 100644 --- a/mistral/templates/deployment-executor.yaml +++ b/mistral/templates/deployment-executor.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.executor }} {{- $mounts_mistral_executor := .Values.mounts.mistral_executor.mistral_executor }} @@ -22,14 +23,7 @@ metadata: name: mistral-executor spec: replicas: {{ .Values.replicas.executor }} - 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -48,15 +42,7 @@ spec: - name: mistral-executor image: {{ .Values.images.executor }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.executor.limits.cpu | quote }} - memory: {{ .Values.resources.executor.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.executor.requests.cpu | quote }} - memory: {{ .Values.resources.executor.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.executor | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/mistral-executor.sh volumeMounts: @@ -70,7 +56,7 @@ spec: mountPath: /etc/mistral/mistral.conf subPath: mistral.conf readOnly: true -{{ if $mounts_mistral_executor.volumeMounts }}{{ toYaml $mounts_mistral_executor.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_mistral_executor.volumeMounts }}{{ toYaml $mounts_mistral_executor.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-mistral emptyDir: {} @@ -81,4 +67,4 @@ spec: - name: mistral-etc configMap: name: mistral-etc -{{ if $mounts_mistral_executor.volumes }}{{ toYaml $mounts_mistral_executor.volumes | indent 8 }}{{ end }} +{{- if $mounts_mistral_executor.volumes }}{{ toYaml $mounts_mistral_executor.volumes | indent 8 }}{{ end }} diff --git a/mistral/templates/ingress-api.yaml b/mistral/templates/ingress-api.yaml index 26eece5476..585c781c52 100644 --- a/mistral/templates/ingress-api.yaml +++ b/mistral/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/mistral/templates/job-db-init.yaml b/mistral/templates/job-db-init.yaml index a150192009..0352c8e976 100644 --- a/mistral/templates/job-db-init.yaml +++ b/mistral/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: mistral-db-init image: {{ .Values.images.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.mistral_db_init.requests.memory | quote }} - cpu: {{ .Values.resources.mistral_db_init.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.mistral_db_init.limits.memory | quote }} - cpu: {{ .Values.resources.mistral_db_init.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/mistral/templates/job-db-sync.yaml b/mistral/templates/job-db-sync.yaml index 72839c7f16..c09e5bd572 100644 --- a/mistral/templates/job-db-sync.yaml +++ b/mistral/templates/job-db-sync.yaml @@ -31,15 +31,7 @@ spec: - name: mistral-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.mistral_db_sync.requests.memory | quote }} - cpu: {{ .Values.resources.mistral_db_sync.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.mistral_db_sync.limits.memory | quote }} - cpu: {{ .Values.resources.mistral_db_sync.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/mistral/templates/job-ks-endpoints.yaml b/mistral/templates/job-ks-endpoints.yaml index 3595c53550..80cb353398 100644 --- a/mistral/templates/job-ks-endpoints.yaml +++ b/mistral/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.mistral_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.mistral_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.mistral_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.mistral_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/mistral/templates/job-ks-service.yaml b/mistral/templates/job-ks-service.yaml index 8c14c3746c..cd6a32de1a 100644 --- a/mistral/templates/job-ks-service.yaml +++ b/mistral/templates/job-ks-service.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.mistral_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.mistral_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.mistral_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.mistral_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/mistral/templates/job-ks-user.yaml b/mistral/templates/job-ks-user.yaml index d8759d9ee0..8723ee51f2 100644 --- a/mistral/templates/job-ks-user.yaml +++ b/mistral/templates/job-ks-user.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: mistral-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.mistral_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.mistral_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.mistral_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.mistral_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/mistral/templates/pdb-api.yaml b/mistral/templates/pdb-api.yaml index 20052cc6bc..475e0daca9 100644 --- a/mistral/templates/pdb-api.yaml +++ b/mistral/templates/pdb-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/mistral/templates/secret-db.yaml b/mistral/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/mistral/templates/secret-db.yaml +++ b/mistral/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/mistral/templates/secret-keystone.yaml b/mistral/templates/secret-keystone.yaml index 2507c3b3b8..0f963b248f 100644 --- a/mistral/templates/secret-keystone.yaml +++ b/mistral/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/mistral/templates/service-api.yaml b/mistral/templates/service-api.yaml index 180b9ab8d3..b4f2269f8e 100644 --- a/mistral/templates/service-api.yaml +++ b/mistral/templates/service-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/mistral/templates/service-ingress-api.yaml b/mistral/templates/service-ingress-api.yaml index 1ed8f5d17b..e62cf490ad 100644 --- a/mistral/templates/service-ingress-api.yaml +++ b/mistral/templates/service-ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/mistral/templates/statefulset-engine.yaml b/mistral/templates/statefulset-engine.yaml index fa5c321e8b..76a853f5ff 100644 --- a/mistral/templates/statefulset-engine.yaml +++ b/mistral/templates/statefulset-engine.yaml @@ -11,11 +11,12 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.engine }} {{- $mounts_mistral_engine := .Values.mounts.mistral_engine.mistral_engine }} {{- $mounts_mistral_engine_init := .Values.mounts.mistral_engine.init_container }} - +--- apiVersion: apps/v1beta1 kind: StatefulSet metadata: @@ -36,15 +37,7 @@ spec: - name: mistral-engine image: {{ .Values.images.engine }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.engine.limits.cpu | quote }} - memory: {{ .Values.resources.engine.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.engine.requests.cpu | quote }} - memory: {{ .Values.resources.engine.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.engine | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/mistral-engine.sh volumeMounts: @@ -58,7 +51,7 @@ spec: mountPath: /etc/mistral/mistral.conf subPath: mistral.conf readOnly: true -{{ if $mounts_mistral_engine.volumeMounts }}{{ toYaml $mounts_mistral_engine.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_mistral_engine.volumeMounts }}{{ toYaml $mounts_mistral_engine.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-mistral emptyDir: {} @@ -69,4 +62,4 @@ spec: - name: mistral-etc configMap: name: mistral-etc -{{ if $mounts_mistral_engine.volumes }}{{ toYaml $mounts_mistral_engine.volumes | indent 8 }}{{ end }} +{{- if $mounts_mistral_engine.volumes }}{{ toYaml $mounts_mistral_engine.volumes | indent 8 }}{{ end }} diff --git a/mistral/templates/statefulset-event-engine.yaml b/mistral/templates/statefulset-event-engine.yaml index 62faf97f84..09e41d0fc8 100644 --- a/mistral/templates/statefulset-event-engine.yaml +++ b/mistral/templates/statefulset-event-engine.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.event_engine }} {{- $mounts_mistral_event_engine := .Values.mounts.mistral_event_engine.mistral_event_engine }} @@ -38,15 +39,7 @@ spec: - name: mistral-event-engine image: {{ .Values.images.event_engine }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.event_engine.limits.cpu | quote }} - memory: {{ .Values.resources.event_engine.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.event_engine.requests.cpu | quote }} - memory: {{ .Values.resources.event_engine.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.event_engine | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/mistral-event-engine.sh volumeMounts: @@ -60,7 +53,7 @@ spec: mountPath: /etc/mistral/mistral.conf subPath: mistral.conf readOnly: true -{{ if $mounts_mistral_event_engine.volumeMounts }}{{ toYaml $mounts_mistral_event_engine.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_mistral_event_engine.volumeMounts }}{{ toYaml $mounts_mistral_event_engine.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-mistral emptyDir: {} @@ -71,4 +64,4 @@ spec: - name: mistral-etc configMap: name: mistral-etc -{{ if $mounts_mistral_event_engine.volumes }}{{ toYaml $mounts_mistral_event_engine.volumes | indent 8 }}{{ end }} +{{- if $mounts_mistral_event_engine.volumes }}{{ toYaml $mounts_mistral_event_engine.volumes | indent 8 }}{{ end }} diff --git a/mistral/values.yaml b/mistral/values.yaml index 63faa4da97..e8cdf9c051 100644 --- a/mistral/values.yaml +++ b/mistral/values.yaml @@ -41,11 +41,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -275,64 +276,79 @@ resources: enabled: false api: requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - mistral_db_init: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - mistral_db_sync: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - mistral_ks_endpoints: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - mistral_ks_service: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - mistral_ks_user: - requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" engine: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" event_engine: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" executor: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_service: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" diff --git a/neutron/templates/configmap-bin.yaml b/neutron/templates/configmap-bin.yaml index c95dd77f67..bd72ea3670 100644 --- a/neutron/templates/configmap-bin.yaml +++ b/neutron/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/neutron/templates/configmap-etc.yaml b/neutron/templates/configmap-etc.yaml index 772c2f3d68..8409b94e4f 100644 --- a/neutron/templates/configmap-etc.yaml +++ b/neutron/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "neutron.conf.neutron_values_skeleton" .Values.conf.neutron | trunc 0 -}} {{- include "neutron.conf.dhcp_agent_values_skeleton" .Values.conf.dhcp_agent | trunc 0 -}} {{- include "neutron.conf.l3_agent_values_skeleton" .Values.conf.l3_agent | trunc 0 -}} @@ -72,6 +74,7 @@ {{- tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.metadata_agent.cache.oslo.cache "memcache_servers" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/neutron/templates/daemonset-dhcp-agent.yaml b/neutron/templates/daemonset-dhcp-agent.yaml index cba0f25abf..e29adcc4ff 100644 --- a/neutron/templates/daemonset-dhcp-agent.yaml +++ b/neutron/templates/daemonset-dhcp-agent.yaml @@ -22,15 +22,7 @@ kind: DaemonSet metadata: name: neutron-dhcp-agent spec: - {{ if .Values.upgrades.daemonsets.dhcp_agent.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.dhcp_agent.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.dhcp_agent.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "dhcp_agent" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -51,15 +43,7 @@ spec: - name: neutron-dhcp-agent image: {{ .Values.images.dhcp }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.agent.dhcp.limits.cpu | quote }} - memory: {{ .Values.resources.agent.dhcp.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.agent.dhcp.requests.cpu | quote }} - memory: {{ .Values.resources.agent.dhcp.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.agent.dhcp | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true command: @@ -97,7 +81,7 @@ spec: mountPath: /run/openvswitch - name: socket mountPath: /var/lib/neutron/openstack-helm -{{ if $mounts_neutron_dhcp_agent.volumeMounts }}{{ toYaml $mounts_neutron_dhcp_agent.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_neutron_dhcp_agent.volumeMounts }}{{ toYaml $mounts_neutron_dhcp_agent.volumeMounts | indent 12 }}{{ end }} volumes: - name: neutron-bin configMap: @@ -112,4 +96,4 @@ spec: - name: socket hostPath: path: /var/lib/neutron/openstack-helm -{{ if $mounts_neutron_dhcp_agent.volumes }}{{ toYaml $mounts_neutron_dhcp_agent.volumes | indent 8 }}{{ end }} +{{- if $mounts_neutron_dhcp_agent.volumes }}{{ toYaml $mounts_neutron_dhcp_agent.volumes | indent 8 }}{{ end }} diff --git a/neutron/templates/daemonset-l3-agent.yaml b/neutron/templates/daemonset-l3-agent.yaml index 1a6752c7b4..9832cc6f3c 100644 --- a/neutron/templates/daemonset-l3-agent.yaml +++ b/neutron/templates/daemonset-l3-agent.yaml @@ -22,15 +22,7 @@ kind: DaemonSet metadata: name: neutron-l3-agent spec: - {{ if .Values.upgrades.daemonsets.l3_agent.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.l3_agent.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.l3_agent.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "l3_agent" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -51,15 +43,7 @@ spec: - name: neutron-l3-agent image: {{ .Values.images.l3 }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.agent.l3.limits.cpu | quote }} - memory: {{ .Values.resources.agent.l3.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.agent.l3.requests.cpu | quote }} - memory: {{ .Values.resources.agent.l3.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.agent.l3 | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true command: @@ -96,7 +80,7 @@ spec: readOnly: true - name: socket mountPath: /var/lib/neutron/stackanetes -{{ if $mounts_neutron_l3_agent.volumeMounts }}{{ toYaml $mounts_neutron_l3_agent.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_neutron_l3_agent.volumeMounts }}{{ toYaml $mounts_neutron_l3_agent.volumeMounts | indent 12 }}{{ end }} volumes: - name: neutron-bin configMap: @@ -114,4 +98,4 @@ spec: - name: socket hostPath: path: /var/lib/neutron/stackanetes -{{ if $mounts_neutron_l3_agent.volumes }}{{ toYaml $mounts_neutron_l3_agent.volumes | indent 8 }}{{ end }} +{{- if $mounts_neutron_l3_agent.volumes }}{{ toYaml $mounts_neutron_l3_agent.volumes | indent 8 }}{{ end }} diff --git a/neutron/templates/daemonset-metadata-agent.yaml b/neutron/templates/daemonset-metadata-agent.yaml index 04cc56a43b..d29cac2583 100644 --- a/neutron/templates/daemonset-metadata-agent.yaml +++ b/neutron/templates/daemonset-metadata-agent.yaml @@ -22,15 +22,7 @@ kind: DaemonSet metadata: name: neutron-metadata-agent spec: - {{ if .Values.upgrades.daemonsets.metadata_agent.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.metadata_agent.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.metadata_agent.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "metadata_agent" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -51,15 +43,7 @@ spec: - name: neutron-metadata-agent image: {{ .Values.images.metadata }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.agent.metadata.limits.cpu | quote }} - memory: {{ .Values.resources.agent.metadata.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.agent.metadata.requests.cpu | quote }} - memory: {{ .Values.resources.agent.metadata.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.agent.metadata | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true ports: @@ -95,7 +79,7 @@ spec: mountPath: /run/openvswitch - name: socket mountPath: /var/lib/neutron/stackanetes -{{ if $mounts_neutron_metadata_agent.volumeMounts }}{{ toYaml $mounts_neutron_metadata_agent.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_neutron_metadata_agent.volumeMounts }}{{ toYaml $mounts_neutron_metadata_agent.volumeMounts | indent 12 }}{{ end }} volumes: - name: neutron-bin configMap: @@ -110,4 +94,4 @@ spec: - name: socket hostPath: path: /var/lib/neutron/openstack-helm -{{ if $mounts_neutron_metadata_agent.volumes }}{{ toYaml $mounts_neutron_metadata_agent.volumes | indent 8 }}{{ end }} +{{- if $mounts_neutron_metadata_agent.volumes }}{{ toYaml $mounts_neutron_metadata_agent.volumes | indent 8 }}{{ end }} diff --git a/neutron/templates/daemonset-ovs-agent.yaml b/neutron/templates/daemonset-ovs-agent.yaml index 1aaea7dc31..cb0fd4f9e3 100644 --- a/neutron/templates/daemonset-ovs-agent.yaml +++ b/neutron/templates/daemonset-ovs-agent.yaml @@ -22,15 +22,7 @@ kind: DaemonSet metadata: name: ovs-agent spec: - {{ if .Values.upgrades.daemonsets.ovs_agent.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.ovs_agent.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.ovs_agent.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "ovs_agent" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -48,15 +40,7 @@ spec: - name: ovs-agent-init image: {{ .Values.images.neutron_openvswitch_agent }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.ovs.agent.limits.cpu | quote }} - memory: {{ .Values.resources.ovs.agent.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.ovs.agent.requests.cpu | quote }} - memory: {{ .Values.resources.ovs.agent.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.agent.ovs | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true runAsUser: 0 @@ -89,20 +73,12 @@ spec: - name: neutron-etc mountPath: /etc/resolv.conf subPath: resolv.conf -{{ if $mounts_neutron_ovs_agent.volumeMounts }}{{ toYaml $mounts_neutron_ovs_agent.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_neutron_ovs_agent.volumeMounts }}{{ toYaml $mounts_neutron_ovs_agent.volumeMounts | indent 12 }}{{ end }} containers: - name: ovs-agent image: {{ .Values.images.neutron_openvswitch_agent }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.ovs.agent.limits.cpu | quote }} - memory: {{ .Values.resources.ovs.agent.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.ovs.agent.requests.cpu | quote }} - memory: {{ .Values.resources.ovs.agent.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.agent.ovs | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true command: @@ -142,7 +118,7 @@ spec: - name: neutron-etc mountPath: /etc/resolv.conf subPath: resolv.conf -{{ if $mounts_neutron_ovs_agent.volumeMounts }}{{ toYaml $mounts_neutron_ovs_agent.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_neutron_ovs_agent.volumeMounts }}{{ toYaml $mounts_neutron_ovs_agent.volumeMounts | indent 12 }}{{ end }} volumes: - name: varlibopenvswitch emptyDir: {} @@ -161,4 +137,4 @@ spec: - name: run hostPath: path: /run -{{ if $mounts_neutron_ovs_agent.volumes }}{{ toYaml $mounts_neutron_ovs_agent.volumes | indent 8 }}{{ end }} +{{- if $mounts_neutron_ovs_agent.volumes }}{{ toYaml $mounts_neutron_ovs_agent.volumes | indent 8 }}{{ end }} diff --git a/neutron/templates/daemonset-ovs-db.yaml b/neutron/templates/daemonset-ovs-db.yaml index 20e3ca9c2f..e3764fe69b 100644 --- a/neutron/templates/daemonset-ovs-db.yaml +++ b/neutron/templates/daemonset-ovs-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: extensions/v1beta1 @@ -18,15 +19,7 @@ kind: DaemonSet metadata: name: ovs-db spec: - {{ if .Values.upgrades.daemonsets.ovs_db.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.ovs_db.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.ovs_db.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "ovs_db" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -45,15 +38,7 @@ spec: - name: ovs-db image: {{ .Values.images.openvswitch_db_server }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.ovs.db.limits.cpu | quote }} - memory: {{ .Values.resources.ovs.db.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.ovs.db.requests.cpu | quote }} - memory: {{ .Values.resources.ovs.db.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.ovs.db | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true command: diff --git a/neutron/templates/daemonset-ovs-vswitchd.yaml b/neutron/templates/daemonset-ovs-vswitchd.yaml index b6dd720902..0adb097c86 100644 --- a/neutron/templates/daemonset-ovs-vswitchd.yaml +++ b/neutron/templates/daemonset-ovs-vswitchd.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: extensions/v1beta1 @@ -18,15 +19,7 @@ kind: DaemonSet metadata: name: ovs-vswitchd spec: - {{ if .Values.upgrades.daemonsets.ovs_vswitchd.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.ovs_vswitchd.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.ovs_vswitchd.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "ovs_vswitchd" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -45,15 +38,7 @@ spec: - name: ovs-vswitchd image: {{ .Values.images.openvswitch_vswitchd }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.ovs.vswitchd.limits.cpu | quote }} - memory: {{ .Values.resources.ovs.vswitchd.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.ovs.vswitchd.requests.cpu | quote }} - memory: {{ .Values.resources.ovs.vswitchd.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.ovs.vswitchd | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true # ensures this container can speak to the ovs database diff --git a/neutron/templates/deployment-server.yaml b/neutron/templates/deployment-server.yaml index 16141959d4..ccdc33a767 100644 --- a/neutron/templates/deployment-server.yaml +++ b/neutron/templates/deployment-server.yaml @@ -23,14 +23,7 @@ metadata: name: neutron-server spec: replicas: {{ .Values.replicas.server }} - revisionHistoryLimit: {{ .Values.upgrades.deployments.revision_history }} - strategy: - type: {{ .Values.upgrades.deployments.pod_replacement_strategy }} - {{ if eq .Values.upgrades.deployments.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.deployments.rolling_update.max_unavailable }} - maxSurge: {{ .Values.upgrades.deployments.rolling_update.max_surge }} - {{ end }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: neutron-server image: {{ .Values.images.server }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - limits: - cpu: {{ .Values.resources.server.limits.cpu | quote }} - memory: {{ .Values.resources.server.limits.memory | quote }} - requests: - cpu: {{ .Values.resources.server.requests.cpu | quote }} - memory: {{ .Values.resources.server.requests.memory | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/neutron-server.sh - start @@ -94,7 +79,7 @@ spec: mountPath: /etc/neutron/policy.json subPath: policy.json readOnly: true -{{ if $mounts_neutron_server.volumeMounts }}{{ toYaml $mounts_neutron_server.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_neutron_server.volumeMounts }}{{ toYaml $mounts_neutron_server.volumeMounts | indent 12 }}{{ end }} volumes: - name: neutron-bin configMap: @@ -103,4 +88,4 @@ spec: - name: neutron-etc configMap: name: neutron-etc -{{ if $mounts_neutron_server.volumes }}{{ toYaml $mounts_neutron_server.volumes | indent 8 }}{{ end }} +{{- if $mounts_neutron_server.volumes }}{{ toYaml $mounts_neutron_server.volumes | indent 8 }}{{ end }} diff --git a/neutron/templates/ingress.yaml b/neutron/templates/ingress.yaml index 42eb8ad5c4..53a977bd48 100644 --- a/neutron/templates/ingress.yaml +++ b/neutron/templates/ingress.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.server.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/neutron/templates/job-db-init.yaml b/neutron/templates/job-db-init.yaml index b17261ab08..cbc4cb4c50 100644 --- a/neutron/templates/job-db-init.yaml +++ b/neutron/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,6 +31,7 @@ spec: - name: neutron-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/neutron/templates/job-db-sync.yaml b/neutron/templates/job-db-sync.yaml index 4c746370b8..a7d57ff348 100644 --- a/neutron/templates/job-db-sync.yaml +++ b/neutron/templates/job-db-sync.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,6 +31,7 @@ spec: - name: neutron-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - neutron-db-manage - --config-file diff --git a/neutron/templates/job-ks-endpoints.yaml b/neutron/templates/job-ks-endpoints.yaml index e64583f5ec..78cd8ed988 100644 --- a/neutron/templates/job-ks-endpoints.yaml +++ b/neutron/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.neutron_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.neutron_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.neutron_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.neutron_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/neutron/templates/job-ks-service.yaml b/neutron/templates/job-ks-service.yaml index 0479b807b6..e507b76019 100644 --- a/neutron/templates/job-ks-service.yaml +++ b/neutron/templates/job-ks-service.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.neutron_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.neutron_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.neutron_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.neutron_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/neutron/templates/job-ks-user.yaml b/neutron/templates/job-ks-user.yaml index 7dd56e0463..713fbd15a2 100644 --- a/neutron/templates/job-ks-user.yaml +++ b/neutron/templates/job-ks-user.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: neutron-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.neutron_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.neutron_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.neutron_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.neutron_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/neutron/templates/pdb-server.yaml b/neutron/templates/pdb-server.yaml index 741138f13b..ce8e75e5ee 100644 --- a/neutron/templates/pdb-server.yaml +++ b/neutron/templates/pdb-server.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/neutron/templates/pod-rally-test.yaml b/neutron/templates/pod-rally-test.yaml index 4a9070141c..7316ed2692 100644 --- a/neutron/templates/pod-rally-test.yaml +++ b/neutron/templates/pod-rally-test.yaml @@ -16,7 +16,7 @@ {{- $dependencies := .Values.dependencies.tests }} {{- $mounts_neutron_tests := .Values.mounts.neutron_tests.neutron_tests }} {{- $mounts_neutron_tests_init := .Values.mounts.neutron_tests.init_container }} - +--- apiVersion: v1 kind: Pod metadata: @@ -30,6 +30,8 @@ spec: containers: - name: {{.Release.Name}}-token-issue-test image: {{ .Values.images.test }} + imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple $envAll $envAll.Values.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} env: {{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 8 }} @@ -49,7 +51,7 @@ spec: readOnly: true - name: rally-db mountPath: /var/lib/rally -{{ if $mounts_neutron_tests.volumeMounts }}{{ toYaml $mounts_neutron_tests.volumeMounts | indent 8 }}{{ end }} +{{- if $mounts_neutron_tests.volumeMounts }}{{ toYaml $mounts_neutron_tests.volumeMounts | indent 8 }}{{ end }} volumes: - name: neutron-etc configMap: @@ -60,4 +62,4 @@ spec: defaultMode: 0555 - name: rally-db emptyDir: {} -{{ if $mounts_neutron_tests.volumes }}{{ toYaml $mounts_neutron_tests.volumes | indent 4 }}{{ end }} +{{- if $mounts_neutron_tests.volumes }}{{ toYaml $mounts_neutron_tests.volumes | indent 4 }}{{ end }} diff --git a/neutron/templates/secret-db.yaml b/neutron/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/neutron/templates/secret-db.yaml +++ b/neutron/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/neutron/templates/secret-keystone.yaml b/neutron/templates/secret-keystone.yaml index 2507c3b3b8..0f963b248f 100644 --- a/neutron/templates/secret-keystone.yaml +++ b/neutron/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/neutron/templates/service-ingress-neutron.yaml b/neutron/templates/service-ingress-neutron.yaml index 693a08de52..ea5dec0602 100644 --- a/neutron/templates/service-ingress-neutron.yaml +++ b/neutron/templates/service-ingress-neutron.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.server.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/neutron/templates/service.yaml b/neutron/templates/service.yaml index 2daa258e96..e65c7326a8 100644 --- a/neutron/templates/service.yaml +++ b/neutron/templates/service.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/neutron/values.yaml b/neutron/values.yaml index ba00367cbb..12387e7764 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -223,77 +223,105 @@ resources: enabled: false agent: dhcp: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" l3: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" metadata: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ovs: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" ovs: - agent: - limits: - memory: "128Mi" - cpu: "500m" - requests: - memory: "128Mi" - cpu: "500m" db: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" vswitchd: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" server: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" db_sync: - limits: - memory: "128Mi" - cpu: "500m" requests: memory: "128Mi" - cpu: "500m" - init: + cpu: "100m" limits: - memory: "128Mi" - cpu: "500m" + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: requests: memory: "128Mi" - cpu: "500m" - post: + cpu: "100m" limits: - memory: "128Mi" - cpu: "500m" + memory: "1024Mi" + cpu: "2000m" + ks_service: requests: memory: "128Mi" - cpu: "500m" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" conf: paste: diff --git a/nova/templates/configmap-bin.yaml b/nova/templates/configmap-bin.yaml index d0d5a830d8..1193ee16c8 100644 --- a/nova/templates/configmap-bin.yaml +++ b/nova/templates/configmap-bin.yaml @@ -11,7 +11,7 @@ # 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. - +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/nova/templates/configmap-etc.yaml b/nova/templates/configmap-etc.yaml index 18d7a7a06d..9927443bf8 100644 --- a/nova/templates/configmap-etc.yaml +++ b/nova/templates/configmap-etc.yaml @@ -82,6 +82,7 @@ {{- tuple "compute_metadata" "public" "metadata" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.nova.default.nova.conf "metadata_port" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/nova/templates/daemonset-compute.yaml b/nova/templates/daemonset-compute.yaml index 32d00b9eb1..1240788458 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -22,15 +22,7 @@ kind: DaemonSet metadata: name: nova-compute spec: - {{ if .Values.upgrades.daemonsets.compute.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.compute.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.compute.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "compute" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -68,15 +60,7 @@ spec: - name: nova-compute-init image: {{ .Values.images.compute }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_compute.requests.memory | quote }} - cpu: {{ .Values.resources.nova_compute.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_compute.limits.memory | quote }} - cpu: {{ .Values.resources.nova_compute.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.compute | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true command: @@ -123,15 +107,7 @@ spec: - name: nova-compute image: {{ .Values.images.compute }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_compute.requests.memory | quote }} - cpu: {{ .Values.resources.nova_compute.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_compute.limits.memory | quote }} - cpu: {{ .Values.resources.nova_compute.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.compute | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true command: @@ -182,7 +158,7 @@ spec: mountPath: /sys/fs/cgroup - name: pod-shared mountPath: /tmp/pod-shared -{{ if $mounts_nova_compute.volumeMounts }}{{ toYaml $mounts_nova_compute.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_compute.volumeMounts }}{{ toYaml $mounts_nova_compute.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -218,4 +194,4 @@ spec: path: /sys/fs/cgroup - name: pod-shared emptyDir: {} -{{ if $mounts_nova_compute.volumes }}{{ toYaml $mounts_nova_compute.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_compute.volumes }}{{ toYaml $mounts_nova_compute.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/daemonset-libvirt.yaml b/nova/templates/daemonset-libvirt.yaml index 6d81d9a2b8..eb93cbc5ee 100644 --- a/nova/templates/daemonset-libvirt.yaml +++ b/nova/templates/daemonset-libvirt.yaml @@ -22,15 +22,7 @@ kind: DaemonSet metadata: name: nova-libvirt spec: - {{ if .Values.upgrades.daemonsets.libvirt.enabled }} - minReadySeconds: {{ .Values.upgrades.daemonsets.libvirt.min_ready_seconds }} - updateStrategy: - type: {{ .Values.upgrades.daemonsets.pod_replacement_strategy }} - {{ if eq .Values.upgrades.daemonsets.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.daemonsets.libvirt.max_unavailable }} - {{ end }} - {{ end }} +{{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: @@ -76,15 +68,7 @@ spec: command: - /tmp/ceph-secret-define.sh {{- end }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_libvirt.requests.memory | quote }} - cpu: {{ .Values.resources.nova_libvirt.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_libvirt.limits.memory | quote }} - cpu: {{ .Values.resources.nova_libvirt.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.libvirt | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} securityContext: privileged: true command: @@ -143,7 +127,7 @@ spec: subPath: ceph-secret-define.sh readOnly: true {{- end }} -{{ if $mounts_nova_libvirt.volumeMounts }}{{ toYaml $mounts_nova_libvirt.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_libvirt.volumeMounts }}{{ toYaml $mounts_nova_libvirt.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -180,4 +164,4 @@ spec: - name: cgroup hostPath: path: /sys/fs/cgroup -{{ if $mounts_nova_libvirt.volumes }}{{ toYaml $mounts_nova_libvirt.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_libvirt.volumes }}{{ toYaml $mounts_nova_libvirt.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/deployment-api-metadata.yaml b/nova/templates/deployment-api-metadata.yaml index 2aef9834c0..9c0779bf3f 100644 --- a/nova/templates/deployment-api-metadata.yaml +++ b/nova/templates/deployment-api-metadata.yaml @@ -23,14 +23,7 @@ metadata: name: nova-api-metadata spec: replicas: {{ .Values.replicas.api_metadata }} - revisionHistoryLimit: {{ .Values.upgrades.deployments.revision_history }} - strategy: - type: {{ .Values.upgrades.deployments.pod_replacement_strategy }} - {{ if eq .Values.upgrades.deployments.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.deployments.rolling_update.max_unavailable }} - maxSurge: {{ .Values.upgrades.deployments.rolling_update.max_surge }} - {{ end }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: nova-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_api_metadata.requests.memory | quote }} - cpu: {{ .Values.resources.nova_api_metadata.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_api_metadata.limits.memory | quote }} - cpu: {{ .Values.resources.nova_api_metadata.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api_metadata | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/nova-api-metadata.sh - start @@ -102,7 +87,7 @@ spec: mountPath: /etc/nova/policy.yaml subPath: policy.yaml readOnly: true -{{ if $mounts_nova_api_metadata.volumeMounts }}{{ toYaml $mounts_nova_api_metadata.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_api_metadata.volumeMounts }}{{ toYaml $mounts_nova_api_metadata.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -111,4 +96,4 @@ spec: - name: nova-etc configMap: name: nova-etc -{{ if $mounts_nova_api_metadata.volumes }}{{ toYaml $mounts_nova_api_metadata.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_api_metadata.volumes }}{{ toYaml $mounts_nova_api_metadata.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/deployment-api-osapi.yaml b/nova/templates/deployment-api-osapi.yaml index f176c147cf..99f1c6479b 100644 --- a/nova/templates/deployment-api-osapi.yaml +++ b/nova/templates/deployment-api-osapi.yaml @@ -23,14 +23,7 @@ metadata: name: nova-api-osapi spec: replicas: {{ .Values.replicas.osapi }} - revisionHistoryLimit: {{ .Values.upgrades.deployments.revision_history }} - strategy: - type: {{ .Values.upgrades.deployments.pod_replacement_strategy }} - {{ if eq .Values.upgrades.deployments.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.deployments.rolling_update.max_unavailable }} - maxSurge: {{ .Values.upgrades.deployments.rolling_update.max_surge }} - {{ end }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -50,15 +43,7 @@ spec: - name: nova-osapi image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_osapi.requests.memory | quote }} - cpu: {{ .Values.resources.nova_osapi.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_osapi.limits.memory | quote }} - cpu: {{ .Values.resources.nova_osapi.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/nova-api.sh - start @@ -90,7 +75,7 @@ spec: mountPath: /etc/nova/policy.yaml subPath: policy.yaml readOnly: true -{{ if $mounts_nova_api_osapi.volumeMounts }}{{ toYaml $mounts_nova_api_osapi.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_api_osapi.volumeMounts }}{{ toYaml $mounts_nova_api_osapi.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -99,4 +84,4 @@ spec: - name: nova-etc configMap: name: nova-etc -{{ if $mounts_nova_api_osapi.volumes}}{{ toYaml $mounts_nova_api_osapi.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_api_osapi.volumes}}{{ toYaml $mounts_nova_api_osapi.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/deployment-conductor.yaml b/nova/templates/deployment-conductor.yaml index 3e8dfddc51..2c344e614a 100644 --- a/nova/templates/deployment-conductor.yaml +++ b/nova/templates/deployment-conductor.yaml @@ -23,14 +23,7 @@ metadata: name: nova-conductor spec: replicas: {{ .Values.replicas.conductor }} - revisionHistoryLimit: {{ .Values.upgrades.deployments.revision_history }} - strategy: - type: {{ .Values.upgrades.deployments.pod_replacement_strategy }} - {{ if eq .Values.upgrades.deployments.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.deployments.rolling_update.max_unavailable }} - maxSurge: {{ .Values.upgrades.deployments.rolling_update.max_surge }} - {{ end }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -49,15 +42,7 @@ spec: - name: nova-conductor image: {{ .Values.images.conductor }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_conductor.requests.memory | quote }} - cpu: {{ .Values.resources.nova_conductor.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_conductor.limits.memory | quote }} - cpu: {{ .Values.resources.nova_conductor.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.conductor | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/nova-conductor.sh volumeMounts: @@ -73,7 +58,7 @@ spec: mountPath: /etc/nova/policy.yaml subPath: policy.yaml readOnly: true -{{ if $mounts_nova_conductor.volumeMounts }}{{ toYaml $mounts_nova_conductor.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_conductor.volumeMounts }}{{ toYaml $mounts_nova_conductor.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -82,4 +67,4 @@ spec: - name: nova-etc configMap: name: nova-etc -{{ if $mounts_nova_conductor.volumes }}{{ toYaml $mounts_nova_conductor.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_conductor.volumes }}{{ toYaml $mounts_nova_conductor.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/deployment-consoleauth.yaml b/nova/templates/deployment-consoleauth.yaml index 86e5297492..ed2f72a60f 100644 --- a/nova/templates/deployment-consoleauth.yaml +++ b/nova/templates/deployment-consoleauth.yaml @@ -23,14 +23,7 @@ metadata: name: nova-consoleauth spec: replicas: {{ .Values.replicas.consoleauth }} - revisionHistoryLimit: {{ .Values.upgrades.deployments.revision_history }} - strategy: - type: {{ .Values.upgrades.deployments.pod_replacement_strategy }} - {{ if eq .Values.upgrades.deployments.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.deployments.rolling_update.max_unavailable }} - maxSurge: {{ .Values.upgrades.deployments.rolling_update.max_surge }} - {{ end }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -49,15 +42,7 @@ spec: - name: nova-consoleauth image: {{ .Values.images.consoleauth }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_consoleauth.requests.memory | quote }} - cpu: {{ .Values.resources.nova_consoleauth.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_consoleauth.limits.memory | quote }} - cpu: {{ .Values.resources.nova_consoleauth.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.consoleauth | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/nova-consoleauth.sh volumeMounts: @@ -73,7 +58,7 @@ spec: mountPath: /etc/nova/policy.yaml subPath: policy.yaml readOnly: true -{{ if $mounts_nova_consoleauth.volumeMounts }}{{ toYaml $mounts_nova_consoleauth.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_consoleauth.volumeMounts }}{{ toYaml $mounts_nova_consoleauth.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -82,4 +67,4 @@ spec: - name: nova-etc configMap: name: nova-etc -{{ if $mounts_nova_consoleauth.volumes }}{{ toYaml $mounts_nova_consoleauth.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_consoleauth.volumes }}{{ toYaml $mounts_nova_consoleauth.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/deployment-novncproxy.yaml b/nova/templates/deployment-novncproxy.yaml index 961641a813..452364dfe0 100644 --- a/nova/templates/deployment-novncproxy.yaml +++ b/nova/templates/deployment-novncproxy.yaml @@ -17,21 +17,14 @@ {{- $dependencies := .Values.dependencies.novncproxy }} {{- $mounts_nova_novncproxy := .Values.mounts.nova_novncproxy.nova_novncproxy }} {{- $mounts_nova_novncproxy_init := .Values.mounts.nova_novncproxy.init_novncproxy }} - +--- apiVersion: apps/v1beta1 kind: Deployment metadata: name: nova-novncproxy spec: replicas: {{ .Values.replicas.novncproxy }} - revisionHistoryLimit: {{ .Values.upgrades.deployments.revision_history }} - strategy: - type: {{ .Values.upgrades.deployments.pod_replacement_strategy }} - {{ if eq .Values.upgrades.deployments.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.deployments.rolling_update.max_unavailable }} - maxSurge: {{ .Values.upgrades.deployments.rolling_update.max_surge }} - {{ end }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -52,15 +45,7 @@ spec: - name: nova-novncproxy-init image: {{ .Values.images.novncproxy }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_novncproxy.requests.memory | quote }} - cpu: {{ .Values.resources.nova_novncproxy.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_novncproxy.limits.memory | quote }} - cpu: {{ .Values.resources.nova_novncproxy.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.novncproxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/nova-vnc-proxy-init.sh volumeMounts: @@ -78,15 +63,7 @@ spec: - name: nova-novncproxy image: {{ .Values.images.novncproxy }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_novncproxy.requests.memory | quote }} - cpu: {{ .Values.resources.nova_novncproxy.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_novncproxy.limits.memory | quote }} - cpu: {{ .Values.resources.nova_novncproxy.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.novncproxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/nova-novncproxy.sh volumeMounts: @@ -104,7 +81,7 @@ spec: readOnly: true - name: pod-shared mountPath: /tmp/pod-shared -{{ if $mounts_nova_novncproxy.volumeMounts }}{{ toYaml $mounts_nova_novncproxy.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_novncproxy.volumeMounts }}{{ toYaml $mounts_nova_novncproxy.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -115,5 +92,5 @@ spec: name: nova-etc - name: pod-shared emptyDir: {} -{{ if $mounts_nova_novncproxy.volumes }}{{ toYaml $mounts_nova_novncproxy.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_novncproxy.volumes }}{{ toYaml $mounts_nova_novncproxy.volumes | indent 8 }}{{ end }} {{ end }} diff --git a/nova/templates/deployment-scheduler.yaml b/nova/templates/deployment-scheduler.yaml index 26345a3c73..4fc7c0defe 100644 --- a/nova/templates/deployment-scheduler.yaml +++ b/nova/templates/deployment-scheduler.yaml @@ -23,14 +23,7 @@ metadata: name: nova-scheduler spec: replicas: {{ .Values.replicas.scheduler }} - revisionHistoryLimit: {{ .Values.upgrades.deployments.revision_history }} - strategy: - type: {{ .Values.upgrades.deployments.pod_replacement_strategy }} - {{ if eq .Values.upgrades.deployments.pod_replacement_strategy "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.upgrades.deployments.rolling_update.max_unavailable }} - maxSurge: {{ .Values.upgrades.deployments.rolling_update.max_surge }} - {{ end }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -49,15 +42,7 @@ spec: - name: nova-scheduler image: {{ .Values.images.scheduler }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_scheduler.requests.memory | quote }} - cpu: {{ .Values.resources.nova_scheduler.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_scheduler.limits.memory | quote }} - cpu: {{ .Values.resources.nova_scheduler.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.scheduler | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/nova-scheduler.sh volumeMounts: @@ -73,7 +58,7 @@ spec: mountPath: /etc/nova/policy.yaml subPath: policy.yaml readOnly: true -{{ if $mounts_nova_scheduler.volumeMounts }}{{ toYaml $mounts_nova_scheduler.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_scheduler.volumeMounts }}{{ toYaml $mounts_nova_scheduler.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-bin configMap: @@ -82,4 +67,4 @@ spec: - name: nova-etc configMap: name: nova-etc -{{ if $mounts_nova_scheduler.volumes }}{{ toYaml $mounts_nova_scheduler.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_scheduler.volumes }}{{ toYaml $mounts_nova_scheduler.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/ingress-metadata.yaml b/nova/templates/ingress-metadata.yaml index 87c0474b72..da258e3e1a 100644 --- a/nova/templates/ingress-metadata.yaml +++ b/nova/templates/ingress-metadata.yaml @@ -13,6 +13,7 @@ # limitations under the License. {{- if .Values.network.metadata.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/nova/templates/ingress-osapi.yaml b/nova/templates/ingress-osapi.yaml index fd71963db4..7b5f1ec06d 100644 --- a/nova/templates/ingress-osapi.yaml +++ b/nova/templates/ingress-osapi.yaml @@ -13,6 +13,7 @@ # limitations under the License. {{- if .Values.network.osapi.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/nova/templates/job-bootstrap.yaml b/nova/templates/job-bootstrap.yaml index a915711b76..7185980914 100644 --- a/nova/templates/job-bootstrap.yaml +++ b/nova/templates/job-bootstrap.yaml @@ -16,6 +16,7 @@ {{- $dependencies := .Values.dependencies.bootstrap }} {{- $mounts_nova_bootstrap := .Values.mounts.nova_bootstrap.nova_bootstrap }} {{- $mounts_nova_bootstrap_init := .Values.mounts.nova_bootstrap.init_container }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: nova-bootstrap image: {{ .Values.images.bootstrap }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.bootstrap.requests.memory | quote }} - cpu: {{ .Values.resources.bootstrap.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.bootstrap.limits.memory | quote }} - cpu: {{ .Values.resources.bootstrap.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.bootstrap | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/bootstrap.sh env: @@ -56,7 +49,7 @@ spec: mountPath: /etc/nova/nova.conf subPath: nova.conf readOnly: true -{{ if $mounts_nova_bootstrap.volumeMounts }}{{ toYaml $mounts_nova_bootstrap.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_nova_bootstrap.volumeMounts }}{{ toYaml $mounts_nova_bootstrap.volumeMounts | indent 12 }}{{ end }} volumes: - name: nova-etc configMap: @@ -65,4 +58,4 @@ spec: configMap: name: nova-bin defaultMode: 0555 -{{ if $mounts_nova_bootstrap.volumes }}{{ toYaml $mounts_nova_bootstrap.volumes | indent 8 }}{{ end }} +{{- if $mounts_nova_bootstrap.volumes }}{{ toYaml $mounts_nova_bootstrap.volumes | indent 8 }}{{ end }} diff --git a/nova/templates/job-db-init.yaml b/nova/templates/job-db-init.yaml index 999ca334c8..eb648cce16 100644 --- a/nova/templates/job-db-init.yaml +++ b/nova/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: nova-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_init.requests.memory | quote }} - cpu: {{ .Values.resources.nova_init.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_init.limits.memory | quote }} - cpu: {{ .Values.resources.nova_init.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: @@ -67,15 +60,7 @@ spec: - name: nova-db-init-api image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_init.requests.memory | quote }} - cpu: {{ .Values.resources.nova_init.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_init.limits.memory | quote }} - cpu: {{ .Values.resources.nova_init.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/nova/templates/job-db-sync.yaml b/nova/templates/job-db-sync.yaml index ca1ac4b10e..c00fef5b1b 100644 --- a/nova/templates/job-db-sync.yaml +++ b/nova/templates/job-db-sync.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: nova-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_db_sync.requests.memory | quote }} - cpu: {{ .Values.resources.nova_db_sync.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_db_sync.limits.memory | quote }} - cpu: {{ .Values.resources.nova_db_sync.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/nova/templates/job-ks-endpoints.yaml b/nova/templates/job-ks-endpoints.yaml index 5d02a01cd5..88821e6043 100644 --- a/nova/templates/job-ks-endpoints.yaml +++ b/nova/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.nova_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.nova_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.nova_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.nova_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/nova/templates/job-ks-service.yaml b/nova/templates/job-ks-service.yaml index 4bf0662899..35a676f3f0 100644 --- a/nova/templates/job-ks-service.yaml +++ b/nova/templates/job-ks-service.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.nova_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.nova_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.nova_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.nova_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/nova/templates/job-ks-user.yaml b/nova/templates/job-ks-user.yaml index 0e17dbcaaf..6fa8231fc7 100644 --- a/nova/templates/job-ks-user.yaml +++ b/nova/templates/job-ks-user.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: nova-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.nova_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.nova_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.nova_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.nova_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/nova/templates/pod-rally-test.yaml b/nova/templates/pod-rally-test.yaml index 7ab4094525..13e10088ad 100644 --- a/nova/templates/pod-rally-test.yaml +++ b/nova/templates/pod-rally-test.yaml @@ -16,7 +16,7 @@ {{- $dependencies := .Values.dependencies.tests }} {{- $mounts_nova_tests := .Values.mounts.nova_tests.nova_tests }} {{- $mounts_nova_tests_init := .Values.mounts.nova_tests.init_container }} - +--- apiVersion: v1 kind: Pod metadata: @@ -49,7 +49,7 @@ spec: readOnly: true - name: rally-db mountPath: /var/lib/rally -{{ if $mounts_nova_tests.volumeMounts }}{{ toYaml $mounts_nova_tests.volumeMounts | indent 8 }}{{ end }} +{{- if $mounts_nova_tests.volumeMounts }}{{ toYaml $mounts_nova_tests.volumeMounts | indent 8 }}{{ end }} volumes: - name: nova-etc configMap: @@ -60,4 +60,4 @@ spec: defaultMode: 0555 - name: rally-db emptyDir: {} -{{ if $mounts_nova_tests.volumes }}{{ toYaml $mounts_nova_tests.volumes | indent 4 }}{{ end }} +{{- if $mounts_nova_tests.volumes }}{{ toYaml $mounts_nova_tests.volumes | indent 4 }}{{ end }} diff --git a/nova/templates/service-ingress-metadata.yaml b/nova/templates/service-ingress-metadata.yaml index df3994d130..71b218c539 100644 --- a/nova/templates/service-ingress-metadata.yaml +++ b/nova/templates/service-ingress-metadata.yaml @@ -13,6 +13,7 @@ # limitations under the License. {{- if .Values.network.metadata.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/nova/templates/service-ingress-osapi.yaml b/nova/templates/service-ingress-osapi.yaml index fba905eaa7..13df74cbad 100644 --- a/nova/templates/service-ingress-osapi.yaml +++ b/nova/templates/service-ingress-osapi.yaml @@ -13,6 +13,7 @@ # limitations under the License. {{- if .Values.network.osapi.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/nova/templates/service-novncproxy.yaml b/nova/templates/service-novncproxy.yaml index ad19a70fcf..2c9c9725ec 100644 --- a/nova/templates/service-novncproxy.yaml +++ b/nova/templates/service-novncproxy.yaml @@ -13,6 +13,7 @@ # limitations under the License. {{ if eq .Values.console.console_kind "novnc" }} +--- apiVersion: v1 kind: Service metadata: @@ -32,4 +33,3 @@ spec: type: NodePort {{ end }} {{ end }} - diff --git a/nova/values.yaml b/nova/values.yaml index 51ec66e5df..45cbde680b 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -588,87 +588,109 @@ endpoints: resources: enabled: false - nova_compute: + compute: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - nova_libvirt: + libvirt: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - nova_api_metadata: + api_metadata: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - nova_osapi: + api: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - nova_conductor: + conductor: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - nova_consoleauth: + consoleauth: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - nova_scheduler: + scheduler: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - nova_db_sync: + novncproxy: requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - nova_init: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - nova_post: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - bootstrap: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - nova_novncproxy: - requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_service: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" diff --git a/senlin/templates/configmap-bin.yaml b/senlin/templates/configmap-bin.yaml index 0f49d113be..18626df0bf 100644 --- a/senlin/templates/configmap-bin.yaml +++ b/senlin/templates/configmap-bin.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/senlin/templates/configmap-etc.yaml b/senlin/templates/configmap-etc.yaml index 4a3482a116..97c01c5c75 100644 --- a/senlin/templates/configmap-etc.yaml +++ b/senlin/templates/configmap-etc.yaml @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} + {{- include "senlin.conf.senlin_values_skeleton" .Values.conf.senlin | trunc 0 -}} {{- if empty .Values.conf.senlin.keystone_authtoken.keystonemiddleware.auth_token.auth_uri -}} @@ -54,6 +56,7 @@ {{- tuple "oslo_messaging" "internal" "user" "amqp" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | set .Values.conf.senlin.default.oslo.messaging "transport_url" | quote | trunc 0 -}} {{- end -}} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/senlin/templates/deployment-api.yaml b/senlin/templates/deployment-api.yaml index ba28f0846b..dfac5c5930 100644 --- a/senlin/templates/deployment-api.yaml +++ b/senlin/templates/deployment-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- $dependencies := .Values.dependencies.api }} {{- $mounts_senlin_api := .Values.mounts.senlin_api.senlin_api }} @@ -22,14 +23,7 @@ metadata: name: senlin-api spec: 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 }} +{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: @@ -49,15 +43,7 @@ spec: - name: senlin-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.senlin_api.requests.memory | quote }} - cpu: {{ .Values.resources.senlin_api.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.senlin_api.limits.memory | quote }} - cpu: {{ .Values.resources.senlin_api.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/senlin-api.sh - start @@ -93,7 +79,7 @@ spec: mountPath: /etc/senlin/policy.json subPath: policy.json readOnly: true -{{ if $mounts_senlin_api.volumeMounts }}{{ toYaml $mounts_senlin_api.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_senlin_api.volumeMounts }}{{ toYaml $mounts_senlin_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-senlin emptyDir: {} @@ -106,4 +92,4 @@ spec: - name: senlin-etc configMap: name: senlin-etc -{{ if $mounts_senlin_api.volumes }}{{ toYaml $mounts_senlin_api.volumes | indent 8 }}{{ end }} +{{- if $mounts_senlin_api.volumes }}{{ toYaml $mounts_senlin_api.volumes | indent 8 }}{{ end }} diff --git a/senlin/templates/ingress-api.yaml b/senlin/templates/ingress-api.yaml index f3362ca1f3..e61fef41ef 100644 --- a/senlin/templates/ingress-api.yaml +++ b/senlin/templates/ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/senlin/templates/job-db-init.yaml b/senlin/templates/job-db-init.yaml index a1cdfcd576..c35d5c5a78 100644 --- a/senlin/templates/job-db-init.yaml +++ b/senlin/templates/job-db-init.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_init }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: senlin-db-init image: {{ .Values.images.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.senlin_db_init.requests.memory | quote }} - cpu: {{ .Values.resources.senlin_db_init.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.senlin_db_init.limits.memory | quote }} - cpu: {{ .Values.resources.senlin_db_init.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} env: - name: ROOT_DB_CONNECTION valueFrom: diff --git a/senlin/templates/job-db-sync.yaml b/senlin/templates/job-db-sync.yaml index ee5261827c..c6b6d961c8 100644 --- a/senlin/templates/job-db-sync.yaml +++ b/senlin/templates/job-db-sync.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.db_sync }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: senlin-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.senlin_db_sync.requests.memory | quote }} - cpu: {{ .Values.resources.senlin_db_sync.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.senlin_db_sync.limits.memory | quote }} - cpu: {{ .Values.resources.senlin_db_sync.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/db-sync.sh volumeMounts: diff --git a/senlin/templates/job-ks-endpoints.yaml b/senlin/templates/job-ks-endpoints.yaml index bafe2d6057..cb7f681997 100644 --- a/senlin/templates/job-ks-endpoints.yaml +++ b/senlin/templates/job-ks-endpoints.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_endpoints }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -32,15 +33,7 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.senlin_ks_endpoints.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.senlin_ks_endpoints.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.senlin_ks_endpoints.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.senlin_ks_endpoints.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-endpoints.sh volumeMounts: diff --git a/senlin/templates/job-ks-service.yaml b/senlin/templates/job-ks-service.yaml index 016d026ef3..aac6ea8984 100644 --- a/senlin/templates/job-ks-service.yaml +++ b/senlin/templates/job-ks-service.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_service }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -31,15 +32,7 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} - {{- if $envAll.Values.resources.enabled }} - resources: - requests: - memory: {{ $envAll.Values.resources.senlin_ks_service.requests.memory | quote }} - cpu: {{ $envAll.Values.resources.senlin_ks_service.requests.cpu | quote }} - limits: - memory: {{ $envAll.Values.resources.senlin_ks_service.limits.memory | quote }} - cpu: {{ $envAll.Values.resources.senlin_ks_service.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-service.sh volumeMounts: diff --git a/senlin/templates/job-ks-user.yaml b/senlin/templates/job-ks-user.yaml index 2f2be1d690..c925f347f8 100644 --- a/senlin/templates/job-ks-user.yaml +++ b/senlin/templates/job-ks-user.yaml @@ -14,6 +14,7 @@ {{- $envAll := . }} {{- $dependencies := .Values.dependencies.ks_user }} +--- apiVersion: batch/v1 kind: Job metadata: @@ -30,15 +31,7 @@ spec: - name: senlin-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.senlin_ks_user.requests.memory | quote }} - cpu: {{ .Values.resources.senlin_ks_user.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.senlin_ks_user.limits.memory | quote }} - cpu: {{ .Values.resources.senlin_ks_user.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/ks-user.sh volumeMounts: diff --git a/senlin/templates/pdb-api.yaml b/senlin/templates/pdb-api.yaml index 85030c40fd..6b2c8708d0 100644 --- a/senlin/templates/pdb-api.yaml +++ b/senlin/templates/pdb-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: policy/v1beta1 diff --git a/senlin/templates/secret-db.yaml b/senlin/templates/secret-db.yaml index f8c9dffe58..4b0456f499 100644 --- a/senlin/templates/secret-db.yaml +++ b/senlin/templates/secret-db.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.oslo_db $userClass }} diff --git a/senlin/templates/secret-keystone.yaml b/senlin/templates/secret-keystone.yaml index 2507c3b3b8..0f963b248f 100644 --- a/senlin/templates/secret-keystone.yaml +++ b/senlin/templates/secret-keystone.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} {{- range $key1, $userClass := tuple "admin" "user" }} {{- $secretName := index $envAll.Values.secrets.identity $userClass }} diff --git a/senlin/templates/service-api.yaml b/senlin/templates/service-api.yaml index bfb2578aaf..b09da9d926 100644 --- a/senlin/templates/service-api.yaml +++ b/senlin/templates/service-api.yaml @@ -11,6 +11,7 @@ # 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. + {{- $envAll := . }} --- apiVersion: v1 diff --git a/senlin/templates/service-ingress-api.yaml b/senlin/templates/service-ingress-api.yaml index bcacfa88c9..da71fb5181 100644 --- a/senlin/templates/service-ingress-api.yaml +++ b/senlin/templates/service-ingress-api.yaml @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $envAll := . }} {{- if .Values.network.api.ingress.public }} +--- apiVersion: v1 kind: Service metadata: diff --git a/senlin/templates/statefulset-engine.yaml b/senlin/templates/statefulset-engine.yaml index 5c20f22a18..144cce0cca 100644 --- a/senlin/templates/statefulset-engine.yaml +++ b/senlin/templates/statefulset-engine.yaml @@ -39,15 +39,7 @@ spec: - name: senlin-engine image: {{ .Values.images.engine }} imagePullPolicy: {{ .Values.images.pull_policy }} - {{- if .Values.resources.enabled }} - resources: - requests: - memory: {{ .Values.resources.senlin_engine.requests.memory | quote }} - cpu: {{ .Values.resources.senlin_engine.requests.cpu | quote }} - limits: - memory: {{ .Values.resources.senlin_engine.limits.memory | quote }} - cpu: {{ .Values.resources.senlin_engine.limits.cpu | quote }} - {{- end }} +{{ tuple $envAll $envAll.Values.resources.engine | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} command: - /tmp/senlin-engine.sh volumeMounts: @@ -67,7 +59,7 @@ spec: mountPath: /etc/senlin/policy.json subPath: policy.json readOnly: true -{{ if $mounts_senlin_engine.volumeMounts }}{{ toYaml $mounts_senlin_engine.volumeMounts | indent 12 }}{{ end }} +{{- if $mounts_senlin_engine.volumeMounts }}{{ toYaml $mounts_senlin_engine.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-etc-senlin emptyDir: {} @@ -80,4 +72,4 @@ spec: - name: senlin-etc configMap: name: senlin-etc -{{ if $mounts_senlin_engine.volumes }}{{ toYaml $mounts_senlin_engine.volumes | indent 8 }}{{ end }} +{{- if $mounts_senlin_engine.volumes }}{{ toYaml $mounts_senlin_engine.volumes | indent 8 }}{{ end }} diff --git a/senlin/values.yaml b/senlin/values.yaml index 1bdcf0c497..6995d1e301 100644 --- a/senlin/values.yaml +++ b/senlin/values.yaml @@ -37,11 +37,12 @@ images: pull_policy: "IfNotPresent" upgrades: - revision_history: 3 - pod_replacement_strategy: RollingUpdate - rolling_update: - max_unavailable: 1 - max_surge: 3 + deployments: + revision_history: 3 + pod_replacement_strategy: RollingUpdate + rolling_update: + max_unavailable: 1 + max_surge: 3 pod_disruption_budget: api: @@ -220,55 +221,70 @@ endpoints: resources: enabled: false - senlin_api: + api: requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" - senlin_db_init: + engine: requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - senlin_db_sync: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - senlin_ks_endpoints: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - senlin_ks_service: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - senlin_ks_user: - requests: - memory: "124Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - senlin_engine: - requests: - memory: "124Mi" + memory: "128Mi" cpu: "100m" limits: memory: "1024Mi" cpu: "2000m" + jobs: + bootstrap: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_init: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + db_sync: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_endpoints: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_service: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + ks_user: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + tests: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" mounts: senlin_api: