move files around, create new api/frontend yaml

This commit is contained in:
perf3ct 2023-09-28 11:16:36 -07:00
parent 7882179087
commit 98a5f67444
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
19 changed files with 76 additions and 136 deletions

View File

9
templates/api.yaml Normal file
View File

@ -0,0 +1,9 @@
{{- define "vikunja.api.hardcodedValues" -}}
{{ end }}
{{ if .Values.api.enabled }}
{{- $ctx := deepCopy . -}}
{{- $_ := get .Values "api" | mergeOverwrite $ctx.Values -}}
{{- $_ = include "vikunja.api.hardcodedValues" . | fromYaml | merge $ctx.Values -}}
{{- include "bjw-s.common.loader.all" $ctx }}
{{ end }}

9
templates/frontend.yaml Normal file
View File

@ -0,0 +1,9 @@
{{- define "vikunja.frontend.hardcodedValues" -}}
{{ end }}
{{ if .Values.frontend.enabled }}
{{- $ctx := deepCopy . -}}
{{- $_ := get .Values "frontend" | mergeOverwrite $ctx.Values -}}
{{- $_ = include "vikunja.frontend.hardcodedValues" . | fromYaml | merge $ctx.Values -}}
{{- include "bjw-s.common.loader.all" $ctx }}
{{ end }}

View File

@ -1,107 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vikunja.frontendFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
{{- if not .Values.frontend.autoscaling.enabled }}
replicas: {{ .Values.frontend.replicaCount }}
{{- end }}
{{- with .Values.frontend.extraDeploymentSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}
selector:
matchLabels:
{{- include "vikunja.frontendSelectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.frontend.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "vikunja.frontendSelectorLabels" . | nindent 8 }}
spec:
{{- with .Values.frontend.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "vikunja.serviceAccountName" . }}
{{- with .Values.frontend.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.frontend.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
{{- with .Values.frontend.sidecarContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
- name: frontend
{{- with .Values.frontend.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- $image := required ".image.repository is not set" .Values.frontend.image.repository }}
{{- $tag := default .Chart.AppVersion .Values.frontend.image.tag | toString }}
image: {{ printf "%s:%s" $image $tag | quote }}
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: VIKUNJA_API_URL
value: {{ quote .Values.frontend.apiUrl }}
- name: VIKUNJA_HTTP_PORT
value: "8080"
{{- with .Values.frontend.env }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.frontend.envFrom }}
envFrom:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.frontend.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.frontend.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.frontend.startupProbe }}
startupProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.frontend.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
{{- with .Values.frontend.extraVolumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
{{- with .Values.frontend.extraVolumes }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.frontend.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.frontend.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.frontend.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -0,0 +1,58 @@
{{- define "vikunja.frontend.hardcodedValues" -}}
global:
nameOverride: frontend
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vikunja.frontendFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
{{- if not .Values.frontend.autoscaling.enabled }}
replicas: {{ .Values.frontend.replicaCount }}
{{- end }}
{{- with .Values.frontend.extraDeploymentSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}
selector:
matchLabels:
{{- include "vikunja.frontendSelectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.frontend.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "vikunja.frontendSelectorLabels" . | nindent 8 }}
spec:
{{- with .Values.frontend.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "vikunja.serviceAccountName" . }}
{{- with .Values.frontend.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: frontend
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: VIKUNJA_API_URL
value: {{ quote .Values.frontend.apiUrl }}
- name: VIKUNJA_HTTP_PORT
value: "8080"
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}

View File

@ -1,5 +0,0 @@
{{- range .Values.raw }}
{{- $manifest := include "vikunja.labels" $ | fromYaml | dict "labels" | dict "metadata" | mergeOverwrite . }}
{{- toYaml $manifest }}
---
{{- end }}

View File

@ -1,9 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "vikunja.fullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
type: Opaque
data:
api-config.yaml: {{ toYaml .Values.api.config | b64enc }}

View File

@ -1,15 +0,0 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "vikunja.serviceAccountName" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}