From af92423d60116e518af4b72249961dc57bf113c5 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Sat, 3 Mar 2018 15:50:37 +0000 Subject: [PATCH] Cinder: use endpoints section and lookups to set port This PS moves cinder to use the endpoints section and lookups to set the port it serves on. Change-Id: Ib95c89f1ff4d20eb3bb57aad325ae31f0ec52532 --- cinder/templates/configmap-etc.yaml | 3 +++ cinder/templates/deployment-api.yaml | 4 ++-- cinder/templates/service-api.yaml | 2 +- cinder/values.yaml | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cinder/templates/configmap-etc.yaml b/cinder/templates/configmap-etc.yaml index 1dc3144225..63ea5ed167 100644 --- a/cinder/templates/configmap-etc.yaml +++ b/cinder/templates/configmap-etc.yaml @@ -92,6 +92,9 @@ limitations under the License. {{- end -}} {{- end -}} +{{- if empty .Values.conf.cinder.DEFAULT.osapi_volume_listen_port -}} +{{- tuple "volume" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.cinder.DEFAULT "osapi_volume_listen_port" | quote | trunc 0 -}} +{{- end -}} --- apiVersion: v1 kind: ConfigMap diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 820daea953..9daadc3c12 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -80,10 +80,10 @@ spec: - stop ports: - name: c-api - containerPort: {{ .Values.conf.cinder.DEFAULT.osapi_volume_listen_port }} + containerPort: {{ tuple "volume" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} readinessProbe: tcpSocket: - port: {{ .Values.conf.cinder.DEFAULT.osapi_volume_listen_port }} + port: {{ tuple "volume" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} volumeMounts: - name: cinder-bin mountPath: /tmp/cinder-api.sh diff --git a/cinder/templates/service-api.yaml b/cinder/templates/service-api.yaml index a009e764ff..d52697a71b 100644 --- a/cinder/templates/service-api.yaml +++ b/cinder/templates/service-api.yaml @@ -24,7 +24,7 @@ metadata: spec: ports: - name: c-api - port: {{ .Values.conf.cinder.DEFAULT.osapi_volume_listen_port }} + port: {{ tuple "volume" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{ if .Values.network.api.node_port.enabled }} nodePort: {{ .Values.network.api.node_port.port }} {{ end }} diff --git a/cinder/values.yaml b/cinder/values.yaml index 70fca277ad..2377c7016a 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -447,7 +447,9 @@ conf: glance_api_version: 2 os_region_name: RegionOne host: cinder-volume-worker - osapi_volume_listen_port: 8776 + #NOTE(portdirect): the bind port should not be defined, and is manipulated + # via the endpoints section. + osapi_volume_listen_port: null enabled_backends: "rbd1" # NOTE(portdirect): "cinder.backup.drivers.swift" and # "cinder.backup.drivers.posix" also supported