From 98a5f67444835d2a3ea8bf17659eef36bf4bcb3e Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 11:16:36 -0700 Subject: [PATCH] move files around, create new api/frontend yaml --- templates/NOTES.txt | 0 templates/api.yaml | 9 ++ templates/frontend.yaml | 9 ++ templates/frontend/deployment.yaml | 107 ---------------------- templates/{ => old}/_helpers.tpl | 0 templates/{ => old}/api/deployment.yaml | 0 templates/{ => old}/api/hpa.yaml | 0 templates/{ => old}/api/ingress.yaml | 0 templates/{ => old}/api/pdb.yaml | 0 templates/{ => old}/api/pvc.yaml | 0 templates/{ => old}/api/service.yaml | 0 templates/old/frontend/deployment.yaml | 58 ++++++++++++ templates/{ => old}/frontend/hpa.yaml | 0 templates/{ => old}/frontend/ingress.yaml | 0 templates/{ => old}/frontend/pdb.yaml | 0 templates/{ => old}/frontend/service.yaml | 0 templates/raw.yaml | 5 - templates/secret.yaml | 9 -- templates/serviceaccount.yaml | 15 --- 19 files changed, 76 insertions(+), 136 deletions(-) delete mode 100644 templates/NOTES.txt create mode 100644 templates/api.yaml create mode 100644 templates/frontend.yaml delete mode 100644 templates/frontend/deployment.yaml rename templates/{ => old}/_helpers.tpl (100%) rename templates/{ => old}/api/deployment.yaml (100%) rename templates/{ => old}/api/hpa.yaml (100%) rename templates/{ => old}/api/ingress.yaml (100%) rename templates/{ => old}/api/pdb.yaml (100%) rename templates/{ => old}/api/pvc.yaml (100%) rename templates/{ => old}/api/service.yaml (100%) create mode 100644 templates/old/frontend/deployment.yaml rename templates/{ => old}/frontend/hpa.yaml (100%) rename templates/{ => old}/frontend/ingress.yaml (100%) rename templates/{ => old}/frontend/pdb.yaml (100%) rename templates/{ => old}/frontend/service.yaml (100%) delete mode 100644 templates/raw.yaml delete mode 100644 templates/secret.yaml delete mode 100644 templates/serviceaccount.yaml diff --git a/templates/NOTES.txt b/templates/NOTES.txt deleted file mode 100644 index e69de29..0000000 diff --git a/templates/api.yaml b/templates/api.yaml new file mode 100644 index 0000000..d03ff2b --- /dev/null +++ b/templates/api.yaml @@ -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 }} \ No newline at end of file diff --git a/templates/frontend.yaml b/templates/frontend.yaml new file mode 100644 index 0000000..56e53da --- /dev/null +++ b/templates/frontend.yaml @@ -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 }} \ No newline at end of file diff --git a/templates/frontend/deployment.yaml b/templates/frontend/deployment.yaml deleted file mode 100644 index a1cbffb..0000000 --- a/templates/frontend/deployment.yaml +++ /dev/null @@ -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 }} diff --git a/templates/_helpers.tpl b/templates/old/_helpers.tpl similarity index 100% rename from templates/_helpers.tpl rename to templates/old/_helpers.tpl diff --git a/templates/api/deployment.yaml b/templates/old/api/deployment.yaml similarity index 100% rename from templates/api/deployment.yaml rename to templates/old/api/deployment.yaml diff --git a/templates/api/hpa.yaml b/templates/old/api/hpa.yaml similarity index 100% rename from templates/api/hpa.yaml rename to templates/old/api/hpa.yaml diff --git a/templates/api/ingress.yaml b/templates/old/api/ingress.yaml similarity index 100% rename from templates/api/ingress.yaml rename to templates/old/api/ingress.yaml diff --git a/templates/api/pdb.yaml b/templates/old/api/pdb.yaml similarity index 100% rename from templates/api/pdb.yaml rename to templates/old/api/pdb.yaml diff --git a/templates/api/pvc.yaml b/templates/old/api/pvc.yaml similarity index 100% rename from templates/api/pvc.yaml rename to templates/old/api/pvc.yaml diff --git a/templates/api/service.yaml b/templates/old/api/service.yaml similarity index 100% rename from templates/api/service.yaml rename to templates/old/api/service.yaml diff --git a/templates/old/frontend/deployment.yaml b/templates/old/frontend/deployment.yaml new file mode 100644 index 0000000..647b946 --- /dev/null +++ b/templates/old/frontend/deployment.yaml @@ -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: {} + diff --git a/templates/frontend/hpa.yaml b/templates/old/frontend/hpa.yaml similarity index 100% rename from templates/frontend/hpa.yaml rename to templates/old/frontend/hpa.yaml diff --git a/templates/frontend/ingress.yaml b/templates/old/frontend/ingress.yaml similarity index 100% rename from templates/frontend/ingress.yaml rename to templates/old/frontend/ingress.yaml diff --git a/templates/frontend/pdb.yaml b/templates/old/frontend/pdb.yaml similarity index 100% rename from templates/frontend/pdb.yaml rename to templates/old/frontend/pdb.yaml diff --git a/templates/frontend/service.yaml b/templates/old/frontend/service.yaml similarity index 100% rename from templates/frontend/service.yaml rename to templates/old/frontend/service.yaml diff --git a/templates/raw.yaml b/templates/raw.yaml deleted file mode 100644 index 7a022d6..0000000 --- a/templates/raw.yaml +++ /dev/null @@ -1,5 +0,0 @@ -{{- range .Values.raw }} -{{- $manifest := include "vikunja.labels" $ | fromYaml | dict "labels" | dict "metadata" | mergeOverwrite . }} -{{- toYaml $manifest }} ---- -{{- end }} diff --git a/templates/secret.yaml b/templates/secret.yaml deleted file mode 100644 index 5ffee56..0000000 --- a/templates/secret.yaml +++ /dev/null @@ -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 }} diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml deleted file mode 100644 index 3cfbcdd..0000000 --- a/templates/serviceaccount.yaml +++ /dev/null @@ -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 }}