diff --git a/barbican/templates/configmap-etc.yaml b/barbican/templates/configmap-etc.yaml index 9688041cf9..881775feeb 100644 --- a/barbican/templates/configmap-etc.yaml +++ b/barbican/templates/configmap-etc.yaml @@ -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 -}} --- diff --git a/barbican/templates/deployment-api.yaml b/barbican/templates/deployment-api.yaml index 27cb680443..fbcfcce069 100644 --- a/barbican/templates/deployment-api.yaml +++ b/barbican/templates/deployment-api.yaml @@ -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 diff --git a/barbican/templates/service-api.yaml b/barbican/templates/service-api.yaml index 2bdebdd4f3..7c79810a7e 100644 --- a/barbican/templates/service-api.yaml +++ b/barbican/templates/service-api.yaml @@ -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 }} diff --git a/barbican/values.yaml b/barbican/values.yaml index 0fe9fdc889..8d1a5271b4 100644 --- a/barbican/values.yaml +++ b/barbican/values.yaml @@ -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: