2023-02-13 16:48:20 +00:00
|
|
|
{{/*
|
|
|
|
Copyright (c) HashiCorp, Inc.
|
|
|
|
SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/}}
|
|
|
|
|
2024-05-28 11:52:10 +00:00
|
|
|
{{ template "openbao.mode" . }}
|
2020-02-21 16:16:33 +00:00
|
|
|
{{- if ne .mode "external" }}
|
2024-05-28 11:52:10 +00:00
|
|
|
{{- template "openbao.uiEnabled" . -}}
|
2022-03-21 16:50:23 +00:00
|
|
|
{{- if .uiEnabled -}}
|
|
|
|
|
2018-08-18 05:08:03 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2024-05-28 11:52:10 +00:00
|
|
|
name: {{ template "openbao.fullname" . }}-ui
|
|
|
|
namespace: {{ include "openbao.namespace" . }}
|
2018-08-18 05:08:03 +00:00
|
|
|
labels:
|
2024-05-28 11:52:10 +00:00
|
|
|
helm.sh/chart: {{ include "openbao.chart" . }}
|
|
|
|
app.kubernetes.io/name: {{ include "openbao.name" . }}-ui
|
2019-08-07 18:55:32 +00:00
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
2024-05-28 11:52:10 +00:00
|
|
|
{{- template "openbao.ui.annotations" . }}
|
2018-08-18 05:08:03 +00:00
|
|
|
spec:
|
2023-08-24 22:14:19 +00:00
|
|
|
{{- if (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
|
|
|
|
{{- if .Values.ui.serviceIPFamilyPolicy }}
|
|
|
|
ipFamilyPolicy: {{ .Values.ui.serviceIPFamilyPolicy }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.ui.serviceIPFamilies }}
|
|
|
|
ipFamilies: {{ .Values.ui.serviceIPFamilies | toYaml | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2018-08-18 05:08:03 +00:00
|
|
|
selector:
|
2024-05-28 11:52:10 +00:00
|
|
|
app.kubernetes.io/name: {{ include "openbao.name" . }}
|
2019-08-12 14:04:08 +00:00
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
2018-08-18 21:38:33 +00:00
|
|
|
component: server
|
2024-05-28 11:52:10 +00:00
|
|
|
{{- if and (.Values.ui.activeOpenbaoPodOnly) (eq .mode "ha") }}
|
|
|
|
openbao-active: "true"
|
2020-08-20 18:39:46 +00:00
|
|
|
{{- end }}
|
|
|
|
publishNotReadyAddresses: {{ .Values.ui.publishNotReadyAddresses }}
|
2018-08-18 05:08:03 +00:00
|
|
|
ports:
|
2024-05-28 11:52:10 +00:00
|
|
|
- name: {{ include "openbao.scheme" . }}
|
2019-09-06 14:27:31 +00:00
|
|
|
port: {{ .Values.ui.externalPort }}
|
2021-05-25 14:20:23 +00:00
|
|
|
targetPort: {{ .Values.ui.targetPort }}
|
2019-08-20 15:40:47 +00:00
|
|
|
{{- if .Values.ui.serviceNodePort }}
|
|
|
|
nodePort: {{ .Values.ui.serviceNodePort }}
|
|
|
|
{{- end }}
|
2019-09-06 14:27:31 +00:00
|
|
|
type: {{ .Values.ui.serviceType }}
|
2021-10-18 13:45:52 +00:00
|
|
|
{{- include "service.externalTrafficPolicy" .Values.ui }}
|
|
|
|
{{- include "service.loadBalancer" .Values.ui }}
|
2019-07-31 18:26:12 +00:00
|
|
|
{{- end -}}
|
2020-08-20 18:39:46 +00:00
|
|
|
{{- end }}
|