Magnum: use endpoints section and lookups to set port

This PS moves magnum to use the endpoints section and lookups to
set the port it serves on.

Change-Id: I0d75bfdad6fad3c6b8b0bdfd8c3799a3e759d8f6
This commit is contained in:
Pete Birley 2018-03-03 16:22:59 +00:00
parent a29aa075a4
commit 32c5f8c65c
4 changed files with 11 additions and 4 deletions

View File

@ -59,6 +59,10 @@ limitations under the License.
{{- tuple "oslo_messaging" "internal" "magnum" "amqp" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | set .Values.conf.magnum.DEFAULT "transport_url" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.magnum.api.port -}}
{{- tuple "container-infra" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.magnum.api "port" | quote | trunc 0 -}}
{{- end -}}
---
apiVersion: v1
kind: ConfigMap

View File

@ -64,10 +64,11 @@ spec:
- /tmp/magnum-api.sh
- stop
ports:
- containerPort: {{ .Values.conf.magnum.api.port }}
- name: m-api
containerPort: {{ tuple "container-infra" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ .Values.conf.magnum.api.port }}
port: {{ tuple "container-infra" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: magnum-bin
mountPath: /tmp/magnum-api.sh

View File

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: m-api
port: {{ .Values.conf.magnum.api.port }}
port: {{ tuple "container-infra" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ if .Values.network.api.node_port.enabled }}
nodePort: {{ .Values.network.api.node_port.port }}
{{ end }}

View File

@ -116,7 +116,9 @@ conf:
auth_version: v3
memcache_security_strategy: ENCRYPT
api:
port: 9511
#NOTE(portdirect): the bind port should not be defined, and is manipulated
# via the endpoints section.
port: null
host: 0.0.0.0
network: