move some more files around, nearly working

This commit is contained in:
perf3ct 2023-09-28 18:22:04 -07:00
parent 98a5f67444
commit ecf657ae71
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
20 changed files with 111 additions and 549 deletions

View File

@ -5,5 +5,8 @@ dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.1.9
digest: sha256:32d64f09a27c0f9ae04893871166a0eaed21f1575219aa1d5f8cf0cdd076492b
generated: "2023-01-27T08:31:13.211732638+02:00"
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 1.5.1
digest: sha256:6fe381e7569a05b9c0b65d0c4c5ef470196c83e4ceb5b7af9048d8fc186c29ff
generated: "2023-09-28T18:03:56.997510626-07:00"

View File

@ -22,12 +22,17 @@ dependencies:
version: 12.1.9
repository: https://charts.bitnami.com/bitnami
condition: postgresqlEnabled
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 1.5.1
keywords:
- vikunja
- todo
- to-do
- task
- tack-tracker
- project-management
- self-hosted
maintainers:
- name: Vikunja
url: https://vikunja.io

View File

@ -1,9 +0,0 @@
{{- 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 }}

12
templates/backend.yaml Normal file
View File

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

View File

@ -1,4 +1,9 @@
{{- define "vikunja.frontend.hardcodedValues" -}}
global:
nameOverride: frontend
{{ end }}
{{ if .Values.frontend.enabled }}

View File

@ -1,102 +0,0 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "vikunja.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "vikunja.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vikunja.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "vikunja.labels" -}}
helm.sh/chart: {{ include "vikunja.chart" . }}
{{ include "vikunja.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "vikunja.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vikunja.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.extraLabels }}
{{- toYaml . | nindent 0 }}
{{- end }}
{{- end }}
{{/*
Selector labels for API
*/}}
{{- define "vikunja.apiSelectorLabels" -}}
{{ include "vikunja.selectorLabels" . }}
app.kubernetes.io/component: api
{{- end }}
{{/*
Selector labels for frontend
*/}}
{{- define "vikunja.frontendSelectorLabels" -}}
{{ include "vikunja.selectorLabels" . }}
app.kubernetes.io/component: frontend
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "vikunja.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "vikunja.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
API fullname
*/}}
{{- define "vikunja.apiFullname" -}}
{{- include "vikunja.fullname" . | printf "%s-api" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Frontend fullname
*/}}
{{- define "vikunja.frontendFullname" -}}
{{- include "vikunja.fullname" . | printf "%s-frontend" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create the name of the PVC to use
*/}}
{{- define "vikunja.pvcName" -}}
{{- default (include "vikunja.fullname" .) .Values.api.persistence.name }}
{{- end }}

View File

@ -1,126 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vikunja.apiFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
{{- if not .Values.api.autoscaling.enabled }}
replicas: {{ .Values.api.replicaCount }}
{{- end }}
{{- with .Values.api.extraDeploymentSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}
selector:
matchLabels:
{{- include "vikunja.apiSelectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.api.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "vikunja.apiSelectorLabels" . | nindent 8 }}
spec:
{{- with .Values.api.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "vikunja.serviceAccountName" . }}
{{- with .Values.api.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
{{- with .Values.api.sidecarContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
- name: api
{{- with .Values.api.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- $image := required ".image.repository is not set" .Values.api.image.repository }}
{{- $tag := default .Chart.AppVersion .Values.api.image.tag | toString }}
image: {{ printf "%s:%s" $image $tag | quote }}
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
ports:
- name: http
containerPort: {{ (.Values.api.config.service.interface | split ":")._1 | int }}
protocol: TCP
{{- with .Values.api.env }}
env:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.envFrom }}
envFrom:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.api.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.api.startupProbe }}
startupProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.api.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
- name: api-config
subPath: api-config.yaml
mountPath: /etc/vikunja/config.yaml
{{- if .Values.api.persistence.enabled }}
- name: storage
subPath: files
mountPath: {{ quote .Values.api.config.files.basepath }}
{{- if eq .Values.api.config.database.type "sqlite" }}
- name: storage
subPath: sqlite
mountPath: {{ dir .Values.api.config.database.path | quote }}
{{- end }}
{{- end }}
{{- with .Values.api.extraVolumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
- name: api-config
secret:
secretName: {{ include "vikunja.fullname" . }}
defaultMode: 0644
{{- if .Values.api.persistence.enabled }}
- name: storage
persistentVolumeClaim:
claimName: {{ include "vikunja.pvcName" . }}
{{- end }}
{{- with .Values.api.extraVolumes }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.api.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -1,32 +0,0 @@
{{- if .Values.api.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "vikunja.apiFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "vikunja.apiFullname" . }}
minReplicas: {{ int .Values.api.autoscaling.minReplicas }}
maxReplicas: {{ int .Values.api.autoscaling.maxReplicas }}
metrics:
{{- if .Values.api.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ int .Values.api.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ int .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@ -1,41 +0,0 @@
{{- if .Values.api.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "vikunja.apiFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
{{- with .Values.api.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.api.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.api.ingress.tls }}
tls:
{{- range .Values.api.ingress.tls }}
- secretName: {{ quote .secretName }}
hosts:
{{- toYaml .hosts | nindent 8 }}
{{- end }}
{{- end }}
rules:
{{- range .Values.api.ingress.hosts }}
- host: {{ quote .host }}
http:
paths:
{{- range .paths }}
- path: {{ quote .path }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
backend:
service:
name: {{ include "vikunja.apiFullname" $ }}
port:
name: http
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,18 +0,0 @@
{{- if .Values.api.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "vikunja.apiFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
{{- with .Values.api.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- with .Values.api.pdb.minAvailable }}
minAvailable: {{ . }}
{{- end }}
selector:
matchLabels:
{{- include "vikunja.apiSelectorLabels" . | nindent 6 }}
{{- end }}

View File

@ -1,10 +0,0 @@
{{- if and .Values.api.persistence.enabled .Values.api.persistence.create }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "vikunja.pvcName" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
{{- toYaml .Values.api.persistence.spec | nindent 2 }}
{{- end }}

View File

@ -1,18 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "vikunja.apiFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
type: {{ .Values.api.service.type }}
ports:
- port: {{ int .Values.api.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "vikunja.apiSelectorLabels" . | nindent 4 }}
{{- with .Values.api.service.extraSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}

View File

@ -1,58 +0,0 @@
{{- 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,32 +0,0 @@
{{- if .Values.frontend.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "vikunja.frontendFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "vikunja.frontendFullname" . }}
minReplicas: {{ int .Values.frontend.autoscaling.minReplicas }}
maxReplicas: {{ int .Values.frontend.autoscaling.maxReplicas }}
metrics:
{{- if .Values.frontend.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ int .Values.frontend.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ int .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@ -1,41 +0,0 @@
{{- if .Values.frontend.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "vikunja.frontendFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
{{- with .Values.frontend.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.frontend.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.frontend.ingress.tls }}
tls:
{{- range .Values.frontend.ingress.tls }}
- secretName: {{ quote .secretName }}
hosts:
{{- toYaml .hosts | nindent 8 }}
{{- end }}
{{- end }}
rules:
{{- range .Values.frontend.ingress.hosts }}
- host: {{ quote .host }}
http:
paths:
{{- range .paths }}
- path: {{ quote .path }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
backend:
service:
name: {{ include "vikunja.frontendFullname" $ }}
port:
name: http
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,18 +0,0 @@
{{- if .Values.frontend.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "vikunja.frontendFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
{{- with .Values.frontend.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- with .Values.frontend.pdb.minAvailable }}
minAvailable: {{ . }}
{{- end }}
selector:
matchLabels:
{{- include "vikunja.frontendSelectorLabels" . | nindent 6 }}
{{- end }}

View File

@ -1,18 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "vikunja.frontendFullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
type: {{ .Values.frontend.service.type }}
ports:
- port: {{ int .Values.frontend.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "vikunja.frontendSelectorLabels" . | nindent 4 }}
{{- with .Values.frontend.service.extraSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}

View File

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

39
templates/typesense.yaml Normal file
View File

@ -0,0 +1,39 @@
{{- define "vikunja.typesense.hardcodedValues" -}}
global:
nameOverride: typesense
service:
main:
enabled: true
primary: true
type: ClusterIP
ports:
http:
enabled: true
primary: true
port: 8108
protocol: HTTP
probes:
liveness: &probes
enabled: true
custom: true
spec:
httpGet:
path: /health
port: http
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
readiness: *probes
startup:
enabled: false
{{- end }}
{{ if .Values.typesense.enabled }}
{{- $ctx := deepCopy . -}}
{{- $_ := get .Values "typesense" | mergeOverwrite $ctx.Values -}}
{{- $_ = include "vikunja.typesense.hardcodedValues" . | fromYaml | merge $ctx.Values -}}
{{- include "bjw-s.common.loader.all" $ctx }}
{{ end }}

View File

@ -1,5 +1,5 @@
## This chart relies on the common library chart from bjw-s
## You can find it at https://github.com/bjw-s/helm-charts/tree/main/charts/library/common
## You can find it and the values you can provide and modify, at https://github.com/bjw-s/helm-charts/tree/main/charts/library/common
## Refer there for more detail about the supported values
# These entries are shared between all the vikunja components
@ -18,12 +18,11 @@ env:
VIKUNJA_API_URL: '{{ printf "http://%s-server:3001" .Release.Name }}'
image:
tag: v1.69.0
tag: 0.21.0
vikunja:
storage:
persistence:
# Main data store for all photos shared between different components.
library:
# Automatically creating the library volume is not supported by this chart
# You have to specify an existing PVC to use
existingClaim:
@ -32,7 +31,24 @@ vikunja:
frontend:
enabled: true
image:
repository: ghcr.io/vikunja-app/vikunja-server
repository: vikunja/frontend
pullPolicy: IfNotPresent
ingress:
main:
enabled: true
annotations:
# proxy-body-size is set to 0 to remove the body limit on file uploads
nginx.ingress.kubernetes.io/proxy-body-size: "0"
hosts:
- host: vikunja.local
paths:
- path: "/"
tls: []
backend:
enabled: true
image:
repository: vikunja/api
pullPolicy: IfNotPresent
ingress:
main:
@ -43,25 +59,9 @@ frontend:
hosts:
- host: vikunja.local
paths:
- path: "/"
- path: "/api"
tls: []
api:
enabled: true
env:
REVERSE_GEOCODING_DUMP_DIRECTORY: /geodata-cache
persistence:
geodata-cache:
enabled: true
size: 1Gi
# Optional: Set this to pvc to avoid downloading the geodata every start.
type: emptyDir
accessMode: ReadWriteMany
# storageClass: your-class
image:
repository: ghcr.io/vikunja-app/vikunja-server
pullPolicy: IfNotPresent
# Dependencies
postgresql:
enabled: false
@ -95,7 +95,19 @@ typesense:
tag: 0.24.0
pullPolicy: IfNotPresent
serviceAccount:
# -- Specifies whether a service account should be created
create: false
# -- Annotations to add to the service account
annotations: {}
# -- Labels to add to the service account
labels: {}
# -- The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""