feat (molgenis-vault): Add vault-ui
This commit is contained in:
parent
12de8ad404
commit
8541b328b8
|
@ -1,3 +1,17 @@
|
|||
{{/*
|
||||
Define vault ui fullname
|
||||
*/}}
|
||||
{{- define "vault.ui.fullname" -}}
|
||||
{{- printf "%s-ui" .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Define vault service url for the ui
|
||||
*/}}
|
||||
{{- define "vault.service.url" -}}
|
||||
{{- printf "https://%s:8200" .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* See https://github.com/helm/helm/issues/4535 */}}
|
||||
{{- define "call-nested" }}
|
||||
{{- $dot := index . 0 }}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{{- if .Values.ui.ingress.enabled -}}
|
||||
{{- $serviceName := include "vault.ui.fullname" . -}}
|
||||
{{- $servicePort := .Values.ui.service.externalPort -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ template "vault.ui.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "molgenis-vault.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.ui.ingress.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
- host: {{ .Values.ui.ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
- path:
|
||||
backend:
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- if .Values.ui.ingress.tls }}
|
||||
tls:
|
||||
{{ toYaml .Values.ui.ingress.tls | indent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,23 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "vault.ui.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "vault-operator.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
type: {{ .Values.ui.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.ui.service.externalPort }}
|
||||
targetPort: {{ .Values.ui.service.internalPort }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.ui.service.name }}
|
||||
{{- if .Values.ui.service.nodePort }}
|
||||
nodePort: {{ .Values.ui.service.nodePort }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "vault-operator.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
component: {{ .Values.ui.name }}
|
|
@ -0,0 +1,50 @@
|
|||
apiVersion: apps/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "vault.ui.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "vault-operator.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
component: {{ .Values.ui.name }}
|
||||
spec:
|
||||
replicas: {{ .Values.ui.replicaCount }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "vault-operator.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
component: {{ .Values.ui.name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Values.ui.name }}
|
||||
image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.imagePullPolicy }}
|
||||
env:
|
||||
- name: VAULT_URL_DEFAULT
|
||||
{{- if .Values.ui.vault.url }}
|
||||
value: {{ .Values.ui.vault.url }}
|
||||
{{ else }}
|
||||
value: {{ template "vault.service.url" . }}
|
||||
{{- end }}
|
||||
- name: VAULT_AUTH_DEFAULT
|
||||
value: {{ .Values.ui.vault.auth }}
|
||||
- name: NODE_TLS_REJECT_UNAUTHORIZED
|
||||
value: '0'
|
||||
ports:
|
||||
- containerPort: {{ .Values.ui.service.internalPort }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: {{ .Values.ui.service.internalPort }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: {{ .Values.ui.service.internalPort }}
|
||||
resources:
|
||||
{{ toYaml .Values.ui.resources | indent 12 }}
|
||||
{{- if .Values.ui.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.ui.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
|
@ -75,4 +75,5 @@ ui:
|
|||
# memory: 128Mi
|
||||
nodeSelector: {}
|
||||
vault:
|
||||
auth: TOKEN
|
||||
auth: GITHUB
|
||||
url: https://vault.vault-operator:8200
|
Loading…
Reference in New Issue