From 52bdfae2bf64c9a5791e0515d99f9f46859130d7 Mon Sep 17 00:00:00 2001 From: josebb Date: Thu, 2 Dec 2021 17:22:28 +0200 Subject: [PATCH] Distinguish between port number of internal endpoint and binding port number in neutron Now binding ports of service and pod spec are configured using internal endpoint values. To support reverse proxy for internalUrl, need to distinguish between binding ports and internal endpoint ports. I added `service` section in endpoint items apart from admin,public ,internal and default. Change-Id: I38dca50a8462faa4e9a7eeed56839b1b996eae06 --- neutron/Chart.yaml | 2 +- neutron/templates/configmap-etc.yaml | 2 +- neutron/templates/daemonset-bagpipe-bgp.yaml | 4 ++-- neutron/templates/deployment-server.yaml | 20 ++++++++++---------- neutron/templates/service-server.yaml | 2 +- neutron/values.yaml | 2 ++ releasenotes/notes/neutron.yaml | 1 + 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/neutron/Chart.yaml b/neutron/Chart.yaml index ca01a6666a..1ed50d8611 100644 --- a/neutron/Chart.yaml +++ b/neutron/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Neutron name: neutron -version: 0.2.26 +version: 0.2.27 home: https://docs.openstack.org/neutron/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png sources: diff --git a/neutron/templates/configmap-etc.yaml b/neutron/templates/configmap-etc.yaml index 17765c2dcc..36af849163 100644 --- a/neutron/templates/configmap-etc.yaml +++ b/neutron/templates/configmap-etc.yaml @@ -161,7 +161,7 @@ just set it along with nova_metadata_host. {{- 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" -}} +{{- $_ := tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.neutron.DEFAULT "bind_port" -}} {{- end -}} {{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}} diff --git a/neutron/templates/daemonset-bagpipe-bgp.yaml b/neutron/templates/daemonset-bagpipe-bgp.yaml index df128929a4..9e6393ef40 100644 --- a/neutron/templates/daemonset-bagpipe-bgp.yaml +++ b/neutron/templates/daemonset-bagpipe-bgp.yaml @@ -14,12 +14,12 @@ limitations under the License. {{- define "bagpipeBgpLivenessProbeTemplate" }} tcpSocket: - port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + port: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- end }} {{- define "bagpipeBgpReadinessProbeTemplate" }} tcpSocket: - port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + port: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- end }} {{- define "neutron.bagpipe_bgp.daemonset" }} diff --git a/neutron/templates/deployment-server.yaml b/neutron/templates/deployment-server.yaml index 072ce9b6ee..2e39a40e31 100644 --- a/neutron/templates/deployment-server.yaml +++ b/neutron/templates/deployment-server.yaml @@ -18,13 +18,13 @@ exec: command: - python - -c - - "import requests; requests.get('http://127.0.0.1:{{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')" + - "import requests; requests.get('http://127.0.0.1:{{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')" initialDelaySeconds: 30 {{- else }} httpGet: - scheme: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }} + scheme: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }} path: / - port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + port: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- end }} {{- end }} {{- define "serverLivenessProbeTemplate" }} @@ -33,13 +33,13 @@ exec: command: - python - -c - - "import requests; requests.get('http://127.0.0.1:{{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')" + - "import requests; requests.get('http://127.0.0.1:{{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')" initialDelaySeconds: 30 {{- else }} httpGet: - scheme: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }} + scheme: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }} path: / - port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + port: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- end }} {{- end }} @@ -113,10 +113,10 @@ spec: {{ dict "envAll" $envAll "application" "neutron_server" "container" "nginx" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} ports: - name: q-api - containerPort: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + containerPort: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} env: - name: PORT - value: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} + value: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} - name: POD_IP valueFrom: fieldRef: @@ -127,7 +127,7 @@ spec: httpGet: scheme: HTTPS path: / - port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + port: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} command: - /tmp/nginx.sh - start @@ -172,7 +172,7 @@ spec: - stop ports: - name: q-api - containerPort: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + containerPort: {{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} volumeMounts: - name: pod-tmp mountPath: /tmp diff --git a/neutron/templates/service-server.yaml b/neutron/templates/service-server.yaml index 30a6567825..8fcee66970 100644 --- a/neutron/templates/service-server.yaml +++ b/neutron/templates/service-server.yaml @@ -22,7 +22,7 @@ metadata: spec: ports: - name: q-api - port: {{ tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + port: {{ tuple "network" "service" "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 843c5ad945..f1eb8d1000 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -2441,10 +2441,12 @@ endpoints: default: null scheme: default: 'http' + service: 'http' port: api: default: 9696 public: 80 + service: 9696 load_balancer: name: octavia hosts: diff --git a/releasenotes/notes/neutron.yaml b/releasenotes/notes/neutron.yaml index 96158c5035..67179f3ca5 100644 --- a/releasenotes/notes/neutron.yaml +++ b/releasenotes/notes/neutron.yaml @@ -40,4 +40,5 @@ neutron: - 0.2.24 Added OCI registry authentication - 0.2.25 Support TLS endpoints - 0.2.26 Use HTTP probe instead of TCP probe + - 0.2.27 Distinguish between port number of internal endpoint and binding port number ...