Heat: use endpoints section and lookups to set port

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

Change-Id: Id44db993c1b5df5ffd2b9bb6602faca4ac3472a6
This commit is contained in:
Pete Birley 2018-03-03 15:41:24 +00:00
parent 16c6d31155
commit 08b8f5c4f5
8 changed files with 33 additions and 12 deletions

View File

@ -109,6 +109,18 @@ limitations under the License.
{{- tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | trimSuffix .Values.endpoints.identity.path.default | set .Values.conf.heat.trustee "auth_url" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.heat.heat_api.bind_port -}}
{{- tuple "orchestration" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.heat.heat_api "bind_port" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.heat.heat_api_cloudwatch.bind_port -}}
{{- tuple "cloudwatch" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.heat.heat_api_cloudwatch "bind_port" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.heat.heat_api_cfn.bind_port -}}
{{- tuple "cloudformation" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.heat.heat_api_cfn "bind_port" | quote | trunc 0 -}}
{{- end -}}
---
apiVersion: v1
kind: ConfigMap

View File

@ -64,10 +64,11 @@ spec:
- /tmp/heat-api.sh
- stop
ports:
- containerPort: {{ .Values.conf.heat.heat_api.bind_port }}
- name: h-api
containerPort: {{ tuple "orchestration" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ .Values.conf.heat.heat_api.bind_port }}
port: {{ tuple "orchestration" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: pod-etc-heat
mountPath: /etc/heat

View File

@ -64,10 +64,11 @@ spec:
- /tmp/heat-cfn.sh
- stop
ports:
- containerPort: {{ .Values.conf.heat.heat_api_cfn.bind_port }}
- name: h-cfn
containerPort: {{ tuple "cloudformation" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ .Values.conf.heat.heat_api_cfn.bind_port }}
port: {{ tuple "cloudformation" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: pod-etc-heat
mountPath: /etc/heat

View File

@ -64,10 +64,11 @@ spec:
- /tmp/heat-cloudwatch.sh
- stop
ports:
- containerPort: {{ .Values.conf.heat.heat_api_cloudwatch.bind_port }}
- name: h-cwh
containerPort: {{ tuple "cloudwatch" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ .Values.conf.heat.heat_api_cloudwatch.bind_port }}
port: {{ tuple "cloudwatch" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: pod-etc-heat
mountPath: /etc/heat

View File

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: h-api
port: {{ .Values.conf.heat.heat_api.bind_port }}
port: {{ tuple "orchestration" "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

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: h-cfn
port: {{ .Values.conf.heat.heat_api_cfn.bind_port }}
port: {{ tuple "cloudformation" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ if .Values.network.cfn.node_port.enabled }}
nodePort: {{ .Values.network.cfn.node_port.port }}
{{ end }}

View File

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: h-cwh
port: {{ .Values.conf.heat.heat_api_cloudwatch.bind_port }}
port: {{ tuple "cloudwatch" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ if .Values.network.cloudwatch.node_port.enabled }}
nodePort: {{ .Values.network.cloudwatch.node_port.port }}
{{ end }}

View File

@ -223,13 +223,19 @@ conf:
auth_type: password
auth_version: v3
heat_api:
bind_port: 8004
#NOTE(portdirect): the bind port should not be defined, and is manipulated
# via the endpoints section.
bind_port: null
workers: 4
heat_api_cloudwatch:
bind_port: 8003
#NOTE(portdirect): the bind port should not be defined, and is manipulated
# via the endpoints section.
bind_port: null
workers: 4
heat_api_cfn:
bind_port: 8000
#NOTE(portdirect): the bind port should not be defined, and is manipulated
# via the endpoints section.
bind_port: null
workers: 4
paste_deploy:
api_paste_config: /etc/heat/api-paste.ini