From ed8bd52b7a0382ba89b78ff0058ad3c013b5907a Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Sat, 3 Mar 2018 16:43:04 +0000 Subject: [PATCH] Neutron: use endpoints section and lookups to set port This PS moves neutron to use the endpoints section and lookups to set the port it serves on. Change-Id: I3a31b55aac62732a12f6c05385dba891ac8cc495 --- neutron/templates/configmap-etc.yaml | 4 ++++ neutron/templates/deployment-server.yaml | 5 +++-- neutron/templates/service-server.yaml | 2 +- neutron/values.yaml | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/neutron/templates/configmap-etc.yaml b/neutron/templates/configmap-etc.yaml index 069599e3a3..9474be967e 100644 --- a/neutron/templates/configmap-etc.yaml +++ b/neutron/templates/configmap-etc.yaml @@ -128,6 +128,10 @@ limitations under the License. {{- end -}} {{- end -}} +{{- if empty .Values.conf.neutron.DEFAULT.bind_port -}} +{{- tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.neutron.DEFAULT "bind_port" | quote | trunc 0 -}} +{{- end -}} + --- apiVersion: v1 kind: ConfigMap diff --git a/neutron/templates/deployment-server.yaml b/neutron/templates/deployment-server.yaml index 76749ba3a7..468cb9ae31 100644 --- a/neutron/templates/deployment-server.yaml +++ b/neutron/templates/deployment-server.yaml @@ -66,10 +66,11 @@ spec: - /tmp/neutron-server.sh - stop ports: - - containerPort: {{ .Values.network.server.port }} + - name: q-api + containerPort: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} readinessProbe: tcpSocket: - port: {{ .Values.network.server.port }} + port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} volumeMounts: - name: neutron-bin mountPath: /tmp/neutron-server.sh diff --git a/neutron/templates/service-server.yaml b/neutron/templates/service-server.yaml index c7287eeb0d..cf346ca21e 100644 --- a/neutron/templates/service-server.yaml +++ b/neutron/templates/service-server.yaml @@ -24,7 +24,7 @@ metadata: spec: ports: - name: q-api - port: {{ .Values.network.server.port }} + port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{ if .Values.network.server.node_port.enabled }} nodePort: {{ .Values.network.server.node_port.port }} {{ end }} diff --git a/neutron/values.yaml b/neutron/values.yaml index 509a4c200c..3ffe65bc4f 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -95,7 +95,6 @@ network: # br0: if0 # br1: iface_two server: - port: 9696 ingress: public: true annotations: @@ -951,6 +950,9 @@ conf: append: neutron: DEFAULT: + #NOTE(portdirect): the bind port should not be defined, and is manipulated + # via the endpoints section. + bind_port: null default_availability_zones: nova api_workers: 4 allow_overlapping_ips: True