Merge "Barbican: use endpoints section and lookups to set port"

This commit is contained in:
Zuul 2018-03-05 17:54:51 +00:00 committed by Gerrit Code Review
commit 7cee174498
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 -}} {{- 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 -}} {{- 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 -}} {{- 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 -}} {{- end -}}
--- ---

View File

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

View File

@ -24,7 +24,7 @@ metadata:
spec: spec:
ports: ports:
- name: b-api - 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 }} {{ if .Values.network.api.node_port.enabled }}
nodePort: {{ .Values.network.api.node_port.port }} nodePort: {{ .Values.network.api.node_port.port }}
{{ end }} {{ end }}

View File

@ -392,7 +392,9 @@ conf:
database: database:
max_retries: -1 max_retries: -1
barbican_api: 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 # Names of secrets used by bootstrap and environmental checks
secrets: secrets: