Barbican: use endpoints section and lookups to set port

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

Change-Id: Ic48382b978259333edc35cda3f2294703a39fce4
This commit is contained in:
Pete Birley 2018-03-03 15:19:42 +00:00
parent 16c6d31155
commit 6810cc6aa8
4 changed files with 12 additions and 5 deletions

View File

@ -66,8 +66,12 @@ limitations under the License.
{{- tuple "key_manager" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | trimSuffix $barbicanPath | set .Values.conf.barbican.DEFAULT "host_href" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.barbican.barbican_api.bind_port -}}
{{- tuple "key_manager" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.barbican.barbican_api "bind_port" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.barbican_api.uwsgi.socket -}}
{{- printf ":%1.f" .Values.conf.barbican.barbican_api.bind_port | set .Values.conf.barbican_api.uwsgi "socket" | quote | trunc 0 -}}
{{- printf ":%s" ( tuple "key_manager" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" ) | set .Values.conf.barbican_api.uwsgi "socket" | quote | trunc 0 -}}
{{- end -}}
---

View File

@ -63,10 +63,11 @@ spec:
- /tmp/barbican.sh
- stop
ports:
- containerPort: {{ .Values.conf.barbican.barbican_api.bind_port }}
- name: b-api
containerPort: {{ tuple "key_manager" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ .Values.conf.barbican.barbican_api.bind_port }}
port: {{ tuple "key_manager" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: etcbarbican
mountPath: /etc/barbican

View File

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: b-api
port: {{ .Values.conf.barbican.barbican_api.bind_port }}
port: {{ tuple "key-manager" "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

@ -392,7 +392,9 @@ conf:
database:
max_retries: -1
barbican_api:
bind_port: 9311
#NOTE(portdirect): the bind port should not be defined, and is manipulated
# via the endpoints section.
bind_port: null
# Names of secrets used by bootstrap and environmental checks
secrets: