From 78821790876347e0b540ed5b8824f1878eec475b Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 10:50:49 -0700 Subject: [PATCH 01/40] create new values file --- values.yaml | 368 ++++++++++-------------------------------------- values.yaml.old | 313 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 391 insertions(+), 290 deletions(-) create mode 100644 values.yaml.old diff --git a/values.yaml b/values.yaml index bb89c14..a5a695f 100644 --- a/values.yaml +++ b/values.yaml @@ -1,313 +1,101 @@ -# ┐ ┬o┬┌ ┬ ┐┌┐┐ ┬┬─┐ -# │┌┘│├┴┐│ ││││┌ ││─┤ -# └┘ ┘┘ ┘┘─┘┘└┘└─┘┘ ┘ +## 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 +## Refer there for more detail about the supported values -nameOverride: "" -fullnameOverride: "" +# These entries are shared between all the vikunja components -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # Extra labels - extraLabels: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" +env: + REDIS_HOSTNAME: '{{ printf "%s-redis-master" .Release.Name }}' + DB_HOSTNAME: "{{ .Release.Name }}-postgresql" + DB_USERNAME: "{{ .Values.postgresql.global.postgresql.auth.username }}" + DB_DATABASE_NAME: "{{ .Values.postgresql.global.postgresql.auth.database }}" + # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance + DB_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" + TYPESENSE_ENABLED: "{{ .Values.typesense.enabled }}" + TYPESENSE_API_KEY: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" + TYPESENSE_HOST: '{{ printf "%s-typesense" .Release.Name }}' + VIKUNJA_FRONTEND_URL: '{{ printf "http://%s-web:3000" .Release.Name }}' + VIKUNJA_API_URL: '{{ printf "http://%s-server:3001" .Release.Name }}' -# Extra labels that will be added to all resources -extraLabels: {} +image: + tag: v1.69.0 -# ┬─┐┬─┐┌─┐┌┐┐┌┐┐┬─┐┌┐┐┬─┐ -# ├─ │┬┘│ ││││ │ ├─ ││││ │ -# ┘ ┘└┘┘─┘┘└┘ ┘ ┴─┘┘└┘┘─┘ +vikunja: + 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: +# vikunja components frontend: - # Public API URL that client's browser will reach - apiUrl: "" - - replicaCount: 1 - + enabled: true image: - repository: vikunja/frontend + repository: ghcr.io/vikunja-app/vikunja-server pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - - podSecurityContext: {} - # fsGroup: 1000 - - securityContext: - allowPrivilegeEscalation: false - runAsUser: 101 # nginx - capabilities: - drop: - - ALL - add: - - NET_BIND_SERVICE - - - service: - type: ClusterIP - port: 80 - # If you want to set other fields, like externalName, externalTrafficPolicy, etc. - extraSpec: {} - ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - - initContainers: [] - - sidecarContainers: [] - - # Extra keys to set in deployment.spec. - # Useful if you want to set minReadySeconds, progressDeadlineSeconds, strategy - extraDeploymentSpec: {} - - pdb: - enabled: false - # maxUnavailable: 50% - minAvailable: 50% - - imagePullSecrets: [] - - podAnnotations: {} - - nodeSelector: {} - - tolerations: [] - - affinity: {} - - extraVolumes: [] - - extraVolumeMounts: [] - - livenessProbe: {} - # httpGet: - # path: /ready - # port: http - readinessProbe: {} - # httpGet: - # path: /ready - # port: http - startupProbe: {} - # httpGet: - # path: / - # port: http - - env: {} - - envFrom: {} - -# ┬─┐┬─┐o -# │─┤│─┘│ -# ┘ ┘┘ ┘ + main: + enabled: false + 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: [] api: - # Values for this config are described here https://vikunja.io/docs/config-options/ - config: - service: - JWTSecret: "" - interface: ":3456" - frontendurl: "" - enableregistration: false - timezone: GMT - database: - type: sqlite - path: /sqlite/vikunja.db - cache: - enabled: true - type: redis - redis: - enabled: false - host: "" - password: "" - db: 0 - cors: - enable: false - origins: [] - mailer: - enabled: false - log: - path: null - files: - basepath: /files - defaultsettings: - avatar_provider: gravatar - discoverable_by_name: true - discoverable_by_email: true - week_start: 1 - + enabled: true + env: + REVERSE_GEOCODING_DUMP_DIRECTORY: /geodata-cache persistence: - enabled: false - # Specifies whether a PVC should be created - create: true - # The name of the PVC to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - spec: {} - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # storageClassName: openebs-hostpath - - replicaCount: 1 - + 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: vikunja/api + repository: ghcr.io/vikunja-app/vikunja-server pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - securityContext: - capabilities: - add: [CAP_CHOWN] - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 +# Dependencies +postgresql: + enabled: false + global: + postgresql: + auth: + username: vikunja + database: vikunja + password: vikunja - service: - type: ClusterIP - port: 80 - # If you want to set other fields, like externalName, externalTrafficPolicy, etc. - extraSpec: {} - - ingress: +redis: + enabled: false + architecture: standalone + auth: enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi +typesense: + enabled: false + env: + TYPESENSE_DATA_DIR: /tsdata + TYPESENSE_API_KEY: typesense + persistence: + tsdata: + # Enabling typesense persistence is recommended to avoid slow reindexing + enabled: false + accessMode: ReadWriteOnce + size: 1Gi + # storageClass: storage-class + image: + repository: docker.io/typesense/typesense + tag: 0.24.0 + pullPolicy: IfNotPresent - autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - initContainers: [] - sidecarContainers: [] - # Extra keys to set in deployment.spec. - # Useful if you want to set minReadySeconds, progressDeadlineSeconds, strategy - extraDeploymentSpec: {} - pdb: - enabled: false - # maxUnavailable: 50% - minAvailable: 50% - - imagePullSecrets: [] - - podAnnotations: {} - - podSecurityContext: {} - # fsGroup: 1000 - - nodeSelector: {} - - tolerations: [] - - affinity: {} - - extraVolumes: [] - - extraVolumeMounts: [] - - livenessProbe: {} - # httpGet: - # path: /ready - # port: http - readinessProbe: {} - # httpGet: - # path: /ready - # port: http - startupProbe: {} - # httpGet: - # path: / - # port: http - - env: {} - - envFrom: {} - -# ┬─┐┌─┐┐─┐┌┐┐┌─┐┬─┐┬─┐┐─┐┐─┐┬ -# │─┘│ │└─┐ │ │ ┬│┬┘├─ └─┐│ ││ -# ┘ ┘─┘──┘ ┘ ┘─┘┘└┘┴─┘──┘└─\┘─┘ - -postgresqlEnabled: false -# Please refer to PostgreSQL subchart for a full list of possible values -postgresql: {} - -# ┬─┐┬─┐┬─┐o┐─┐ -# │┬┘├─ │ ││└─┐ -# ┘└┘┴─┘┘─┘┘──┘ - -redisEnabled: false -# Please refer to Redis subchart for a full list of possible values -redis: {} - -# ┬─┐┬─┐┐ ┬ -# │┬┘│─┤│││ -# ┘└┘┘ ┘└┴┘ - -# You can create custom resources from the plaintext definition -raw: [] diff --git a/values.yaml.old b/values.yaml.old new file mode 100644 index 0000000..bb89c14 --- /dev/null +++ b/values.yaml.old @@ -0,0 +1,313 @@ +# ┐ ┬o┬┌ ┬ ┐┌┐┐ ┬┬─┐ +# │┌┘│├┴┐│ ││││┌ ││─┤ +# └┘ ┘┘ ┘┘─┘┘└┘└─┘┘ ┘ + +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # Extra labels + extraLabels: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +# Extra labels that will be added to all resources +extraLabels: {} + +# ┬─┐┬─┐┌─┐┌┐┐┌┐┐┬─┐┌┐┐┬─┐ +# ├─ │┬┘│ ││││ │ ├─ ││││ │ +# ┘ ┘└┘┘─┘┘└┘ ┘ ┴─┘┘└┘┘─┘ + +frontend: + # Public API URL that client's browser will reach + apiUrl: "" + + replicaCount: 1 + + image: + repository: vikunja/frontend + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + + podSecurityContext: {} + # fsGroup: 1000 + + securityContext: + allowPrivilegeEscalation: false + runAsUser: 101 # nginx + capabilities: + drop: + - ALL + add: + - NET_BIND_SERVICE + + + service: + type: ClusterIP + port: 80 + # If you want to set other fields, like externalName, externalTrafficPolicy, etc. + extraSpec: {} + + ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + + initContainers: [] + + sidecarContainers: [] + + # Extra keys to set in deployment.spec. + # Useful if you want to set minReadySeconds, progressDeadlineSeconds, strategy + extraDeploymentSpec: {} + + pdb: + enabled: false + # maxUnavailable: 50% + minAvailable: 50% + + imagePullSecrets: [] + + podAnnotations: {} + + nodeSelector: {} + + tolerations: [] + + affinity: {} + + extraVolumes: [] + + extraVolumeMounts: [] + + livenessProbe: {} + # httpGet: + # path: /ready + # port: http + readinessProbe: {} + # httpGet: + # path: /ready + # port: http + startupProbe: {} + # httpGet: + # path: / + # port: http + + env: {} + + envFrom: {} + +# ┬─┐┬─┐o +# │─┤│─┘│ +# ┘ ┘┘ ┘ + +api: + # Values for this config are described here https://vikunja.io/docs/config-options/ + config: + service: + JWTSecret: "" + interface: ":3456" + frontendurl: "" + enableregistration: false + timezone: GMT + database: + type: sqlite + path: /sqlite/vikunja.db + cache: + enabled: true + type: redis + redis: + enabled: false + host: "" + password: "" + db: 0 + cors: + enable: false + origins: [] + mailer: + enabled: false + log: + path: null + files: + basepath: /files + defaultsettings: + avatar_provider: gravatar + discoverable_by_name: true + discoverable_by_email: true + week_start: 1 + + persistence: + enabled: false + # Specifies whether a PVC should be created + create: true + # The name of the PVC to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + spec: {} + # accessModes: ["ReadWriteOnce"] + # resources: + # requests: + # storage: 1Gi + # storageClassName: openebs-hostpath + + replicaCount: 1 + + image: + repository: vikunja/api + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + + securityContext: + capabilities: + add: [CAP_CHOWN] + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + service: + type: ClusterIP + port: 80 + # If you want to set other fields, like externalName, externalTrafficPolicy, etc. + extraSpec: {} + + ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + + initContainers: [] + + sidecarContainers: [] + + # Extra keys to set in deployment.spec. + # Useful if you want to set minReadySeconds, progressDeadlineSeconds, strategy + extraDeploymentSpec: {} + + pdb: + enabled: false + # maxUnavailable: 50% + minAvailable: 50% + + imagePullSecrets: [] + + podAnnotations: {} + + podSecurityContext: {} + # fsGroup: 1000 + + nodeSelector: {} + + tolerations: [] + + affinity: {} + + extraVolumes: [] + + extraVolumeMounts: [] + + livenessProbe: {} + # httpGet: + # path: /ready + # port: http + readinessProbe: {} + # httpGet: + # path: /ready + # port: http + startupProbe: {} + # httpGet: + # path: / + # port: http + + env: {} + + envFrom: {} + +# ┬─┐┌─┐┐─┐┌┐┐┌─┐┬─┐┬─┐┐─┐┐─┐┬ +# │─┘│ │└─┐ │ │ ┬│┬┘├─ └─┐│ ││ +# ┘ ┘─┘──┘ ┘ ┘─┘┘└┘┴─┘──┘└─\┘─┘ + +postgresqlEnabled: false +# Please refer to PostgreSQL subchart for a full list of possible values +postgresql: {} + +# ┬─┐┬─┐┬─┐o┐─┐ +# │┬┘├─ │ ││└─┐ +# ┘└┘┴─┘┘─┘┘──┘ + +redisEnabled: false +# Please refer to Redis subchart for a full list of possible values +redis: {} + +# ┬─┐┬─┐┐ ┬ +# │┬┘│─┤│││ +# ┘└┘┘ ┘└┴┘ + +# You can create custom resources from the plaintext definition +raw: [] -- 2.45.1 From 98a5f67444835d2a3ea8bf17659eef36bf4bcb3e Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 11:16:36 -0700 Subject: [PATCH 02/40] 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 }} -- 2.45.1 From ecf657ae716458d77aaccd669fef93ddd7904d14 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 18:22:04 -0700 Subject: [PATCH 03/40] move some more files around, nearly working --- Chart.lock | 7 +- Chart.yaml | 5 + templates/api.yaml | 9 -- templates/backend.yaml | 12 +++ templates/frontend.yaml | 5 + templates/old/_helpers.tpl | 102 -------------------- templates/old/api/deployment.yaml | 126 ------------------------- templates/old/api/hpa.yaml | 32 ------- templates/old/api/ingress.yaml | 41 -------- templates/old/api/pdb.yaml | 18 ---- templates/old/api/pvc.yaml | 10 -- templates/old/api/service.yaml | 18 ---- templates/old/frontend/deployment.yaml | 58 ------------ templates/old/frontend/hpa.yaml | 32 ------- templates/old/frontend/ingress.yaml | 41 -------- templates/old/frontend/pdb.yaml | 18 ---- templates/old/frontend/service.yaml | 18 ---- templates/serviceaccount.yaml | 9 ++ templates/typesense.yaml | 39 ++++++++ values.yaml | 60 +++++++----- 20 files changed, 111 insertions(+), 549 deletions(-) delete mode 100644 templates/api.yaml create mode 100644 templates/backend.yaml delete mode 100644 templates/old/_helpers.tpl delete mode 100644 templates/old/api/deployment.yaml delete mode 100644 templates/old/api/hpa.yaml delete mode 100644 templates/old/api/ingress.yaml delete mode 100644 templates/old/api/pdb.yaml delete mode 100644 templates/old/api/pvc.yaml delete mode 100644 templates/old/api/service.yaml delete mode 100644 templates/old/frontend/deployment.yaml delete mode 100644 templates/old/frontend/hpa.yaml delete mode 100644 templates/old/frontend/ingress.yaml delete mode 100644 templates/old/frontend/pdb.yaml delete mode 100644 templates/old/frontend/service.yaml create mode 100644 templates/serviceaccount.yaml create mode 100644 templates/typesense.yaml diff --git a/Chart.lock b/Chart.lock index 6c998d4..ce79a83 100644 --- a/Chart.lock +++ b/Chart.lock @@ -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" diff --git a/Chart.yaml b/Chart.yaml index 0ff268c..0ada135 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -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 diff --git a/templates/api.yaml b/templates/api.yaml deleted file mode 100644 index d03ff2b..0000000 --- a/templates/api.yaml +++ /dev/null @@ -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 }} \ No newline at end of file diff --git a/templates/backend.yaml b/templates/backend.yaml new file mode 100644 index 0000000..eff0e9a --- /dev/null +++ b/templates/backend.yaml @@ -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 }} \ No newline at end of file diff --git a/templates/frontend.yaml b/templates/frontend.yaml index 56e53da..6046068 100644 --- a/templates/frontend.yaml +++ b/templates/frontend.yaml @@ -1,4 +1,9 @@ {{- define "vikunja.frontend.hardcodedValues" -}} +global: + nameOverride: frontend + + + {{ end }} {{ if .Values.frontend.enabled }} diff --git a/templates/old/_helpers.tpl b/templates/old/_helpers.tpl deleted file mode 100644 index dcd995f..0000000 --- a/templates/old/_helpers.tpl +++ /dev/null @@ -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 }} \ No newline at end of file diff --git a/templates/old/api/deployment.yaml b/templates/old/api/deployment.yaml deleted file mode 100644 index 2892bdf..0000000 --- a/templates/old/api/deployment.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/api/hpa.yaml b/templates/old/api/hpa.yaml deleted file mode 100644 index b778e94..0000000 --- a/templates/old/api/hpa.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/api/ingress.yaml b/templates/old/api/ingress.yaml deleted file mode 100644 index 0e6b6c0..0000000 --- a/templates/old/api/ingress.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/api/pdb.yaml b/templates/old/api/pdb.yaml deleted file mode 100644 index d5a2e11..0000000 --- a/templates/old/api/pdb.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/api/pvc.yaml b/templates/old/api/pvc.yaml deleted file mode 100644 index 649f602..0000000 --- a/templates/old/api/pvc.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/api/service.yaml b/templates/old/api/service.yaml deleted file mode 100644 index c9c9aa6..0000000 --- a/templates/old/api/service.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/frontend/deployment.yaml b/templates/old/frontend/deployment.yaml deleted file mode 100644 index 647b946..0000000 --- a/templates/old/frontend/deployment.yaml +++ /dev/null @@ -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: {} - diff --git a/templates/old/frontend/hpa.yaml b/templates/old/frontend/hpa.yaml deleted file mode 100644 index 9264d45..0000000 --- a/templates/old/frontend/hpa.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/frontend/ingress.yaml b/templates/old/frontend/ingress.yaml deleted file mode 100644 index b824ff5..0000000 --- a/templates/old/frontend/ingress.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/frontend/pdb.yaml b/templates/old/frontend/pdb.yaml deleted file mode 100644 index c81810f..0000000 --- a/templates/old/frontend/pdb.yaml +++ /dev/null @@ -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 }} diff --git a/templates/old/frontend/service.yaml b/templates/old/frontend/service.yaml deleted file mode 100644 index 34dc798..0000000 --- a/templates/old/frontend/service.yaml +++ /dev/null @@ -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 }} diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml new file mode 100644 index 0000000..b648dc7 --- /dev/null +++ b/templates/serviceaccount.yaml @@ -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 }} \ No newline at end of file diff --git a/templates/typesense.yaml b/templates/typesense.yaml new file mode 100644 index 0000000..25a115a --- /dev/null +++ b/templates/typesense.yaml @@ -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 }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index a5a695f..281a06e 100644 --- a/values.yaml +++ b/values.yaml @@ -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: "" -- 2.45.1 From 5197cefe9865fe78695884c7195122e5c222bda1 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 18:49:17 -0700 Subject: [PATCH 04/40] well this at least renders lol --- templates/backend.yaml | 15 ++++++++++++++- templates/frontend.yaml | 21 ++++++++++++++++++++- values.yaml | 9 ++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/templates/backend.yaml b/templates/backend.yaml index eff0e9a..b867173 100644 --- a/templates/backend.yaml +++ b/templates/backend.yaml @@ -1,6 +1,19 @@ {{- define "vikunja.backend.hardcodedValues" -}} global: - nameOverride: backend + nameOverride: backend + +service: + main: + enabled: true + primary: true + type: ClusterIP + ports: + http: + enabled: true + primary: true + port: 3456 + protocol: HTTP + {{ end }} diff --git a/templates/frontend.yaml b/templates/frontend.yaml index 6046068..5660811 100644 --- a/templates/frontend.yaml +++ b/templates/frontend.yaml @@ -1,8 +1,27 @@ {{- define "vikunja.frontend.hardcodedValues" -}} global: - nameOverride: frontend + nameOverride: frontend +service: + main: + enabled: true + {{- if not .Values.backend.enabled -}} + primary: true + {{- end }} + type: ClusterIP + ports: + http: + enabled: true + {{- if not .Values.backend.enabled -}} + primary: true + {{- end }} + port: 80 + protocol: HTTP + targetPort: 8080 +env: + - name: VIKUNJA_SERVICE_INTERFACE + value: ":8080" {{ end }} diff --git a/values.yaml b/values.yaml index 281a06e..57aca01 100644 --- a/values.yaml +++ b/values.yaml @@ -46,10 +46,17 @@ frontend: tls: [] backend: - enabled: true + enabled: false image: repository: vikunja/api pullPolicy: IfNotPresent + persistence: + data: + enabled: true + # existingClaim: # your-claim + accessMode: ReadWriteOnce + size: 10Gi + # storageClass: storage-class ingress: main: enabled: false -- 2.45.1 From f45e1eca707df997abd1a4a1479f75e7193295fc Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 18:55:27 -0700 Subject: [PATCH 05/40] cool --- Chart.yaml | 6 +++--- templates/backend.yaml | 8 ++++++++ values.yaml | 15 +-------------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 0ada135..61329e1 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,13 +15,13 @@ appVersion: 0.21.0 kubeVersion: ">= 1.19" dependencies: - name: redis - version: 17.5.1 repository: https://charts.bitnami.com/bitnami - condition: redisEnabled + version: 17.11.6 + condition: redis.enabled - name: postgresql version: 12.1.9 repository: https://charts.bitnami.com/bitnami - condition: postgresqlEnabled + condition: postgresql.enabled - name: common repository: https://bjw-s.github.io/helm-charts version: 1.5.1 diff --git a/templates/backend.yaml b/templates/backend.yaml index b867173..2fd9d54 100644 --- a/templates/backend.yaml +++ b/templates/backend.yaml @@ -14,6 +14,14 @@ service: port: 3456 protocol: HTTP +env: + {{ if .Values.typesense.enabled }} + VIKUNJA_TYPESENSE_ENABLED: {{ .Values.typesense.apiKey }} + VIKUNJA_TYPESENSE_URL: {{ .Values.typesense.host }} + VIKUNJA_TYPESENSE_APIKEY: {{ .Values.typesense.apiKey }} + {{ end }} + + {{ end }} diff --git a/values.yaml b/values.yaml index 57aca01..80d589c 100644 --- a/values.yaml +++ b/values.yaml @@ -4,19 +4,6 @@ # These entries are shared between all the vikunja components -env: - REDIS_HOSTNAME: '{{ printf "%s-redis-master" .Release.Name }}' - DB_HOSTNAME: "{{ .Release.Name }}-postgresql" - DB_USERNAME: "{{ .Values.postgresql.global.postgresql.auth.username }}" - DB_DATABASE_NAME: "{{ .Values.postgresql.global.postgresql.auth.database }}" - # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance - DB_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" - TYPESENSE_ENABLED: "{{ .Values.typesense.enabled }}" - TYPESENSE_API_KEY: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" - TYPESENSE_HOST: '{{ printf "%s-typesense" .Release.Name }}' - VIKUNJA_FRONTEND_URL: '{{ printf "http://%s-web:3000" .Release.Name }}' - VIKUNJA_API_URL: '{{ printf "http://%s-server:3001" .Release.Name }}' - image: tag: 0.21.0 @@ -46,7 +33,7 @@ frontend: tls: [] backend: - enabled: false + enabled: true image: repository: vikunja/api pullPolicy: IfNotPresent -- 2.45.1 From 28b3153b6cdaf6d26a0ff5165c87e0aac0d051e2 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 19:06:21 -0700 Subject: [PATCH 06/40] change environment variable names --- templates/backend.yaml | 8 -- values.yaml | 16 ++- values.yaml.old | 313 ----------------------------------------- 3 files changed, 15 insertions(+), 322 deletions(-) delete mode 100644 values.yaml.old diff --git a/templates/backend.yaml b/templates/backend.yaml index 2fd9d54..b867173 100644 --- a/templates/backend.yaml +++ b/templates/backend.yaml @@ -14,14 +14,6 @@ service: port: 3456 protocol: HTTP -env: - {{ if .Values.typesense.enabled }} - VIKUNJA_TYPESENSE_ENABLED: {{ .Values.typesense.apiKey }} - VIKUNJA_TYPESENSE_URL: {{ .Values.typesense.host }} - VIKUNJA_TYPESENSE_APIKEY: {{ .Values.typesense.apiKey }} - {{ end }} - - {{ end }} diff --git a/values.yaml b/values.yaml index 80d589c..a119345 100644 --- a/values.yaml +++ b/values.yaml @@ -4,6 +4,20 @@ # These entries are shared between all the vikunja components +env: + VIKUNJA_REDIS_HOST: '{{ printf "%s-redis-master" .Release.Name }}' + VIKUNJA_REDIS_DB: "{{ .Release.Name }}" + VIKUNJA_DATABASE_HOST: "{{ .Release.Name }}-postgresql" + VIKUNJA_DATABASE_USER: "{{ .Values.postgresql.global.postgresql.auth.username }}" + VIKUNJA_DATABASE_DATABASE: "{{ .Values.postgresql.global.postgresql.auth.database }}" + # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance + VIKUNJA_DATABASE_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" + VIKUNJA_TYPESENSE_ENABLED: "{{ .Values.typesense.enabled }}" + VIKUNJA_TYPESENSE_APIKEY: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" + VIKUNJA_TYPESENSE_URL: '{{ printf "%s-typesense" .Release.Name }}' + VIKUNJA_FRONTEND_URL: '{{ printf "http://%s-frontend" .Release.Name }}' + VIKUNJA_API_URL: '{{ printf "http://%s-backend:3456" .Release.Name }}' + image: tag: 0.21.0 @@ -73,7 +87,7 @@ redis: enabled: false typesense: - enabled: false + enabled: true env: TYPESENSE_DATA_DIR: /tsdata TYPESENSE_API_KEY: typesense diff --git a/values.yaml.old b/values.yaml.old deleted file mode 100644 index bb89c14..0000000 --- a/values.yaml.old +++ /dev/null @@ -1,313 +0,0 @@ -# ┐ ┬o┬┌ ┬ ┐┌┐┐ ┬┬─┐ -# │┌┘│├┴┐│ ││││┌ ││─┤ -# └┘ ┘┘ ┘┘─┘┘└┘└─┘┘ ┘ - -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # Extra labels - extraLabels: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -# Extra labels that will be added to all resources -extraLabels: {} - -# ┬─┐┬─┐┌─┐┌┐┐┌┐┐┬─┐┌┐┐┬─┐ -# ├─ │┬┘│ ││││ │ ├─ ││││ │ -# ┘ ┘└┘┘─┘┘└┘ ┘ ┴─┘┘└┘┘─┘ - -frontend: - # Public API URL that client's browser will reach - apiUrl: "" - - replicaCount: 1 - - image: - repository: vikunja/frontend - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - - podSecurityContext: {} - # fsGroup: 1000 - - securityContext: - allowPrivilegeEscalation: false - runAsUser: 101 # nginx - capabilities: - drop: - - ALL - add: - - NET_BIND_SERVICE - - - service: - type: ClusterIP - port: 80 - # If you want to set other fields, like externalName, externalTrafficPolicy, etc. - extraSpec: {} - - ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - - initContainers: [] - - sidecarContainers: [] - - # Extra keys to set in deployment.spec. - # Useful if you want to set minReadySeconds, progressDeadlineSeconds, strategy - extraDeploymentSpec: {} - - pdb: - enabled: false - # maxUnavailable: 50% - minAvailable: 50% - - imagePullSecrets: [] - - podAnnotations: {} - - nodeSelector: {} - - tolerations: [] - - affinity: {} - - extraVolumes: [] - - extraVolumeMounts: [] - - livenessProbe: {} - # httpGet: - # path: /ready - # port: http - readinessProbe: {} - # httpGet: - # path: /ready - # port: http - startupProbe: {} - # httpGet: - # path: / - # port: http - - env: {} - - envFrom: {} - -# ┬─┐┬─┐o -# │─┤│─┘│ -# ┘ ┘┘ ┘ - -api: - # Values for this config are described here https://vikunja.io/docs/config-options/ - config: - service: - JWTSecret: "" - interface: ":3456" - frontendurl: "" - enableregistration: false - timezone: GMT - database: - type: sqlite - path: /sqlite/vikunja.db - cache: - enabled: true - type: redis - redis: - enabled: false - host: "" - password: "" - db: 0 - cors: - enable: false - origins: [] - mailer: - enabled: false - log: - path: null - files: - basepath: /files - defaultsettings: - avatar_provider: gravatar - discoverable_by_name: true - discoverable_by_email: true - week_start: 1 - - persistence: - enabled: false - # Specifies whether a PVC should be created - create: true - # The name of the PVC to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - spec: {} - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # storageClassName: openebs-hostpath - - replicaCount: 1 - - image: - repository: vikunja/api - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - - securityContext: - capabilities: - add: [CAP_CHOWN] - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - - service: - type: ClusterIP - port: 80 - # If you want to set other fields, like externalName, externalTrafficPolicy, etc. - extraSpec: {} - - ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - - initContainers: [] - - sidecarContainers: [] - - # Extra keys to set in deployment.spec. - # Useful if you want to set minReadySeconds, progressDeadlineSeconds, strategy - extraDeploymentSpec: {} - - pdb: - enabled: false - # maxUnavailable: 50% - minAvailable: 50% - - imagePullSecrets: [] - - podAnnotations: {} - - podSecurityContext: {} - # fsGroup: 1000 - - nodeSelector: {} - - tolerations: [] - - affinity: {} - - extraVolumes: [] - - extraVolumeMounts: [] - - livenessProbe: {} - # httpGet: - # path: /ready - # port: http - readinessProbe: {} - # httpGet: - # path: /ready - # port: http - startupProbe: {} - # httpGet: - # path: / - # port: http - - env: {} - - envFrom: {} - -# ┬─┐┌─┐┐─┐┌┐┐┌─┐┬─┐┬─┐┐─┐┐─┐┬ -# │─┘│ │└─┐ │ │ ┬│┬┘├─ └─┐│ ││ -# ┘ ┘─┘──┘ ┘ ┘─┘┘└┘┴─┘──┘└─\┘─┘ - -postgresqlEnabled: false -# Please refer to PostgreSQL subchart for a full list of possible values -postgresql: {} - -# ┬─┐┬─┐┬─┐o┐─┐ -# │┬┘├─ │ ││└─┐ -# ┘└┘┴─┘┘─┘┘──┘ - -redisEnabled: false -# Please refer to Redis subchart for a full list of possible values -redis: {} - -# ┬─┐┬─┐┐ ┬ -# │┬┘│─┤│││ -# ┘└┘┘ ┘└┴┘ - -# You can create custom resources from the plaintext definition -raw: [] -- 2.45.1 From 56d5371e30dae055e4130956770ebc2d0334c5db Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 21:51:32 -0700 Subject: [PATCH 07/40] well this works :) --- templates/frontend.yaml | 4 ---- values.yaml | 12 ++++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/templates/frontend.yaml b/templates/frontend.yaml index 5660811..d7f3e1e 100644 --- a/templates/frontend.yaml +++ b/templates/frontend.yaml @@ -17,11 +17,7 @@ service: {{- end }} port: 80 protocol: HTTP - targetPort: 8080 -env: - - name: VIKUNJA_SERVICE_INTERFACE - value: ":8080" {{ end }} diff --git a/values.yaml b/values.yaml index a119345..0264bac 100644 --- a/values.yaml +++ b/values.yaml @@ -12,7 +12,6 @@ env: VIKUNJA_DATABASE_DATABASE: "{{ .Values.postgresql.global.postgresql.auth.database }}" # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance VIKUNJA_DATABASE_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" - VIKUNJA_TYPESENSE_ENABLED: "{{ .Values.typesense.enabled }}" VIKUNJA_TYPESENSE_APIKEY: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" VIKUNJA_TYPESENSE_URL: '{{ printf "%s-typesense" .Release.Name }}' VIKUNJA_FRONTEND_URL: '{{ printf "http://%s-frontend" .Release.Name }}' @@ -72,7 +71,7 @@ backend: # Dependencies postgresql: - enabled: false + enabled: true global: postgresql: auth: @@ -89,18 +88,19 @@ redis: typesense: enabled: true env: - TYPESENSE_DATA_DIR: /tsdata + TYPESENSE_DATA_DIR: /data TYPESENSE_API_KEY: typesense persistence: - tsdata: + data: # Enabling typesense persistence is recommended to avoid slow reindexing - enabled: false + enabled: true accessMode: ReadWriteOnce size: 1Gi # storageClass: storage-class + image: repository: docker.io/typesense/typesense - tag: 0.24.0 + tag: 0.25.1 pullPolicy: IfNotPresent serviceAccount: -- 2.45.1 From 7224e44db3c2f562849650001ac4b0e48364a3f4 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 28 Sep 2023 21:51:58 -0700 Subject: [PATCH 08/40] oops this too --- templates/backend.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/backend.yaml b/templates/backend.yaml index b867173..37322fa 100644 --- a/templates/backend.yaml +++ b/templates/backend.yaml @@ -15,6 +15,15 @@ service: protocol: HTTP +env: +{{ if .Values.redis.enabled }} + VIKUNJA_REDIS_ENABLED: "true" +{{ end }} +{{ if .Values.typesense.enabled }} + VIKUNJA_TYPESENSE_ENABLED: "true" +{{ end }} + + {{ end }} {{ if .Values.backend.enabled }} -- 2.45.1 From 5312dc6a34306a81a37833a041fd0254ecae6c8b Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 4 Oct 2023 10:02:37 -0700 Subject: [PATCH 09/40] change backend to be api --- README.md | 2 +- templates/backend.yaml | 19 ++++++++++++++----- templates/frontend.yaml | 4 ++-- values.yaml | 27 +++++++++++++++++++-------- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e90b7df..0b50978 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Vikunja Helm Chart === -Deployes both frontend and backend. Also, you can deploy bitnami's PostgreSQL and Redis as subcharts if you want. +Deployes both frontend and api. Also, you can deploy bitnami's PostgreSQL and Redis as subcharts if you want. ## Requirements diff --git a/templates/backend.yaml b/templates/backend.yaml index 37322fa..5343347 100644 --- a/templates/backend.yaml +++ b/templates/backend.yaml @@ -1,6 +1,6 @@ -{{- define "vikunja.backend.hardcodedValues" -}} +{{- define "vikunja.api.hardcodedValues" -}} global: - nameOverride: backend + nameOverride: api service: main: @@ -23,12 +23,21 @@ env: VIKUNJA_TYPESENSE_ENABLED: "true" {{ end }} +# Logic to decide what the api URL should be +{{ if .Values.ingress.enabled }} + VIKUNJA_API_URL: "https://{{ .Values.ingress.host }}{{ .Values.ingress.path }}" +{{ else if .Values.service.main.enabled }} + VIKUNJA_API_URL: "http://{{ .Values.service.main.name }}.{{ .Values.service.main.namespace }}.svc.cluster.local:{{ .Values.service.main.ports.http.port }}{{ .Values.ingress.path }}" +{{ else }} + VIKUNJA_API_URL: "http://localhost:3456{{ .Values.ingress.path }}" +{{ end }} + {{ end }} -{{ if .Values.backend.enabled }} +{{ if .Values.api.enabled }} {{- $ctx := deepCopy . -}} -{{- $_ := get .Values "backend" | mergeOverwrite $ctx.Values -}} -{{- $_ = include "vikunja.backend.hardcodedValues" . | fromYaml | merge $ctx.Values -}} +{{- $_ := 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 index d7f3e1e..722c689 100644 --- a/templates/frontend.yaml +++ b/templates/frontend.yaml @@ -5,14 +5,14 @@ global: service: main: enabled: true - {{- if not .Values.backend.enabled -}} + {{- if not .Values.api.enabled -}} primary: true {{- end }} type: ClusterIP ports: http: enabled: true - {{- if not .Values.backend.enabled -}} + {{- if not .Values.api.enabled -}} primary: true {{- end }} port: 80 diff --git a/values.yaml b/values.yaml index 0264bac..db5eb97 100644 --- a/values.yaml +++ b/values.yaml @@ -1,9 +1,10 @@ ## This chart relies on the common library chart from bjw-s -## 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 +## You can find it and the values you can provide and modify, at https://github.com/bjw-s/helm-charts/tree/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common +## Here's the link to the values.yaml file: https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml +## Refer there for more detail about the supported values. +## Any values that you find in the above `values.yaml` can be provided to this chart and are then rendered. +# These environment variables are shared between all the vikunja components env: VIKUNJA_REDIS_HOST: '{{ printf "%s-redis-master" .Release.Name }}' VIKUNJA_REDIS_DB: "{{ .Release.Name }}" @@ -15,7 +16,7 @@ env: VIKUNJA_TYPESENSE_APIKEY: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" VIKUNJA_TYPESENSE_URL: '{{ printf "%s-typesense" .Release.Name }}' VIKUNJA_FRONTEND_URL: '{{ printf "http://%s-frontend" .Release.Name }}' - VIKUNJA_API_URL: '{{ printf "http://%s-backend:3456" .Release.Name }}' + VIKUNJA_API_URL: '{{ .Values.backened.ingress.main.hosts[0].host }}' image: tag: 0.21.0 @@ -27,12 +28,16 @@ storage: # You have to specify an existing PVC to use existingClaim: -# vikunja components +###################### +# VIKUNJA COMPONENTS # +###################### frontend: enabled: true + # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L63-L69 image: repository: vikunja/frontend pullPolicy: IfNotPresent + # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L393-L436 ingress: main: enabled: true @@ -45,7 +50,7 @@ frontend: - path: "/" tls: [] -backend: +api: enabled: true image: repository: vikunja/api @@ -69,7 +74,12 @@ backend: - path: "/api" tls: [] -# Dependencies +########################## +# END VIKUNJA COMPONENTS # +########################## + + +# Optional Dependencies postgresql: enabled: true global: @@ -103,6 +113,7 @@ typesense: tag: 0.25.1 pullPolicy: IfNotPresent +# https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L85-L94 serviceAccount: # -- Specifies whether a service account should be created create: false -- 2.45.1 From f7731a71f6fbe2d138d90c3159bc384c1f707e3c Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 4 Oct 2023 10:20:22 -0700 Subject: [PATCH 10/40] remove serviceaccount, user can define if needed --- templates/serviceaccount.yaml | 9 --------- values.yaml | 18 ------------------ 2 files changed, 27 deletions(-) delete mode 100644 templates/serviceaccount.yaml diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml deleted file mode 100644 index b648dc7..0000000 --- a/templates/serviceaccount.yaml +++ /dev/null @@ -1,9 +0,0 @@ -{{- 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 }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index db5eb97..8a0d503 100644 --- a/values.yaml +++ b/values.yaml @@ -112,21 +112,3 @@ typesense: repository: docker.io/typesense/typesense tag: 0.25.1 pullPolicy: IfNotPresent - -# https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L85-L94 -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: "" - - - -- 2.45.1 From ca277268526bf3c059ec30a95fdb9addfc9b5f7e Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 4 Oct 2023 14:31:06 -0700 Subject: [PATCH 11/40] working api configmap --- .gitignore | 1 + templates/{backend.yaml => api.yaml} | 18 ++++++++++------- values.yaml | 29 ++++++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 9 deletions(-) rename templates/{backend.yaml => api.yaml} (63%) diff --git a/.gitignore b/.gitignore index f899a70..67f5729 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ charts/*.tgz *.tgz +output.yaml diff --git a/templates/backend.yaml b/templates/api.yaml similarity index 63% rename from templates/backend.yaml rename to templates/api.yaml index 5343347..0ce46b2 100644 --- a/templates/backend.yaml +++ b/templates/api.yaml @@ -14,6 +14,14 @@ service: port: 3456 protocol: HTTP +persistence: + config: + enabled: true + type: configMap + name: "{{ .Release.Name }}-api-config" + mountPath: /etc/vikunja/config.yml + subPath: config.yml + env: {{ if .Values.redis.enabled }} @@ -24,16 +32,12 @@ env: {{ end }} # Logic to decide what the api URL should be -{{ if .Values.ingress.enabled }} - VIKUNJA_API_URL: "https://{{ .Values.ingress.host }}{{ .Values.ingress.path }}" -{{ else if .Values.service.main.enabled }} - VIKUNJA_API_URL: "http://{{ .Values.service.main.name }}.{{ .Values.service.main.namespace }}.svc.cluster.local:{{ .Values.service.main.ports.http.port }}{{ .Values.ingress.path }}" -{{ else }} - VIKUNJA_API_URL: "http://localhost:3456{{ .Values.ingress.path }}" +{{ if .Values.frontend.ingress.enabled }} + VIKUNJA_FRONTEND_URL: "http://{{ index .Values.frontend.ingress.main.hosts 0 "host" }}{{ index .Values.frontend.ingress.main.hosts 0 "path" }}" +{{ end }} {{ end }} -{{ end }} {{ if .Values.api.enabled }} {{- $ctx := deepCopy . -}} diff --git a/values.yaml b/values.yaml index 8a0d503..3db65b5 100644 --- a/values.yaml +++ b/values.yaml @@ -15,8 +15,6 @@ env: VIKUNJA_DATABASE_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" VIKUNJA_TYPESENSE_APIKEY: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" VIKUNJA_TYPESENSE_URL: '{{ printf "%s-typesense" .Release.Name }}' - VIKUNJA_FRONTEND_URL: '{{ printf "http://%s-frontend" .Release.Name }}' - VIKUNJA_API_URL: '{{ .Values.backened.ingress.main.hosts[0].host }}' image: tag: 0.21.0 @@ -31,12 +29,21 @@ storage: ###################### # VIKUNJA COMPONENTS # ###################### +# You can find the default values frontend: enabled: true + # You can add any of the top-level keys in the common chart's `values.yaml` to override them here. + # For example, this values.yaml file overrides the image values, located here: # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L63-L69 image: repository: vikunja/frontend pullPolicy: IfNotPresent + # You can use either a `service` or an `ingress`. `Ingress` is recommended. You can make changes the service created by this chart, by overriding the values found here: + # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L294-L354 + service: + main: + type: ClusterIP + # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L393-L436 ingress: main: @@ -49,6 +56,12 @@ frontend: paths: - path: "/" tls: [] + configMaps: + # The configuration for Vikunja's frontend. + # https://vikunja.io/docs/config-options/ + config: + enabled: true + data: {} api: enabled: true @@ -73,6 +86,18 @@ api: paths: - path: "/api" tls: [] + configMaps: + # The configuration for Vikunja's backend. + # https://vikunja.io/docs/config-options/ + config: + enabled: true + data: + service: + # Vikunja needs to know the frontend URL for password reset emails. + frontendUrl: http://vikunja.local + + # env: + # VIKUNJA_FRONTEND_URL: http://vikunja.local/api ########################## # END VIKUNJA COMPONENTS # -- 2.45.1 From 3df883fcbde6fb743b035274f37b549f8073a345 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 4 Oct 2023 16:21:54 -0700 Subject: [PATCH 12/40] update the values for redis and postgres --- values.yaml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/values.yaml b/values.yaml index 3db65b5..e5b7920 100644 --- a/values.yaml +++ b/values.yaml @@ -4,18 +4,6 @@ ## Refer there for more detail about the supported values. ## Any values that you find in the above `values.yaml` can be provided to this chart and are then rendered. -# These environment variables are shared between all the vikunja components -env: - VIKUNJA_REDIS_HOST: '{{ printf "%s-redis-master" .Release.Name }}' - VIKUNJA_REDIS_DB: "{{ .Release.Name }}" - VIKUNJA_DATABASE_HOST: "{{ .Release.Name }}-postgresql" - VIKUNJA_DATABASE_USER: "{{ .Values.postgresql.global.postgresql.auth.username }}" - VIKUNJA_DATABASE_DATABASE: "{{ .Values.postgresql.global.postgresql.auth.database }}" - # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance - VIKUNJA_DATABASE_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" - VIKUNJA_TYPESENSE_APIKEY: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" - VIKUNJA_TYPESENSE_URL: '{{ printf "%s-typesense" .Release.Name }}' - image: tag: 0.21.0 @@ -38,7 +26,9 @@ frontend: image: repository: vikunja/frontend pullPolicy: IfNotPresent - # You can use either a `service` or an `ingress`. `Ingress` is recommended. You can make changes the service created by this chart, by overriding the values found here: + # You can use either a `service` or an `ingress` to interact with Vikunja's frontend. + # `Ingress` is the recommended option, but you can still set the `service` to + # `LoadBalancer` or another service type. # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L294-L354 service: main: @@ -92,9 +82,25 @@ api: config: enabled: true data: + database: + # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance + # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L141-L145C25 + type: 'postgres' + user: "{{ .Values.postgresql.global.postgresql.auth.username }}" + password: "{{ .Values.postgresql.global.postgresql.auth.password }}" + database: "{{ .Values.postgresql.global.postgresql.auth.database }}" + host: '{{ .Release.Name }}-postgresql' service: # Vikunja needs to know the frontend URL for password reset emails. frontendUrl: http://vikunja.local + typesense: + # Typesense will only work if it is enabled below (typesense.enabled). + url: '{{ printf "%s-typesense" .Release.Name }}' + apiKey: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" + redis: + # Redis will only work if it is enabled below (redis.enabled). + host: '{{ printf "%s-redis-master" .Release.Name }}' + db: "{{ .Release.Name }}" # env: # VIKUNJA_FRONTEND_URL: http://vikunja.local/api -- 2.45.1 From 26c311614d0f4ca061098aad2b2f0e0c95f0bc9d Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 4 Oct 2023 16:26:44 -0700 Subject: [PATCH 13/40] update comment --- values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/values.yaml b/values.yaml index e5b7920..00842bc 100644 --- a/values.yaml +++ b/values.yaml @@ -83,8 +83,7 @@ api: enabled: true data: database: - # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance - # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L141-L145C25 + # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) type: 'postgres' user: "{{ .Values.postgresql.global.postgresql.auth.username }}" password: "{{ .Values.postgresql.global.postgresql.auth.password }}" -- 2.45.1 From 4909345cd1975b4c1c9668980b9be7fbbb7eb3ee Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 4 Oct 2023 18:53:44 -0700 Subject: [PATCH 14/40] Move api pod to be first, move api configmap to be underneath the config.yml --- values.yaml | 97 +++++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/values.yaml b/values.yaml index 00842bc..9c66b46 100644 --- a/values.yaml +++ b/values.yaml @@ -18,6 +18,55 @@ storage: # VIKUNJA COMPONENTS # ###################### # You can find the default values +api: + enabled: true + image: + repository: vikunja/api + pullPolicy: IfNotPresent + persistence: + data: + enabled: true + # existingClaim: # your-claim + accessMode: ReadWriteOnce + size: 10Gi + # storageClass: storage-class + ingress: + main: + enabled: false + 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: "/api" + tls: [] + configMaps: + # The configuration for Vikunja's backend. + # https://vikunja.io/docs/config-options/ + config: + enabled: true + data: + config.yml: + database: + # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) + type: 'postgres' + user: "{{ .Values.postgresql.global.postgresql.auth.username }}" + password: "{{ .Values.postgresql.global.postgresql.auth.password }}" + database: "{{ .Values.postgresql.global.postgresql.auth.database }}" + host: '{{ .Release.Name }}-postgresql' + service: + # Vikunja needs to know the frontend URL for password reset emails. + frontendUrl: http://vikunja.local + typesense: + # Typesense will only work if it is enabled below (typesense.enabled). + url: '{{ printf "%s-typesense" .Release.Name }}' + apiKey: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" + redis: + # Redis will only work if it is enabled below (redis.enabled). + host: '{{ printf "%s-redis-master" .Release.Name }}' + db: "{{ .Release.Name }}" + frontend: enabled: true # You can add any of the top-level keys in the common chart's `values.yaml` to override them here. @@ -53,53 +102,7 @@ frontend: enabled: true data: {} -api: - enabled: true - image: - repository: vikunja/api - pullPolicy: IfNotPresent - persistence: - data: - enabled: true - # existingClaim: # your-claim - accessMode: ReadWriteOnce - size: 10Gi - # storageClass: storage-class - ingress: - main: - enabled: false - 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: "/api" - tls: [] - configMaps: - # The configuration for Vikunja's backend. - # https://vikunja.io/docs/config-options/ - config: - enabled: true - data: - database: - # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) - type: 'postgres' - user: "{{ .Values.postgresql.global.postgresql.auth.username }}" - password: "{{ .Values.postgresql.global.postgresql.auth.password }}" - database: "{{ .Values.postgresql.global.postgresql.auth.database }}" - host: '{{ .Release.Name }}-postgresql' - service: - # Vikunja needs to know the frontend URL for password reset emails. - frontendUrl: http://vikunja.local - typesense: - # Typesense will only work if it is enabled below (typesense.enabled). - url: '{{ printf "%s-typesense" .Release.Name }}' - apiKey: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" - redis: - # Redis will only work if it is enabled below (redis.enabled). - host: '{{ printf "%s-redis-master" .Release.Name }}' - db: "{{ .Release.Name }}" + # env: # VIKUNJA_FRONTEND_URL: http://vikunja.local/api -- 2.45.1 From 4136286a1ab24e87ab24433ff0535fb0de1184da Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 5 Oct 2023 08:55:31 -0700 Subject: [PATCH 15/40] add api pod probe --- templates/api.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/templates/api.yaml b/templates/api.yaml index 0ce46b2..9226a4f 100644 --- a/templates/api.yaml +++ b/templates/api.yaml @@ -22,6 +22,21 @@ persistence: mountPath: /etc/vikunja/config.yml subPath: config.yml +probes: + liveness: &probes + enabled: true + custom: true + spec: + httpGet: + path: /api/v1 + port: http + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + failureThreshold: 3 + readiness: *probes + startup: + enabled: false env: {{ if .Values.redis.enabled }} -- 2.45.1 From e29dc292b03f249504b06e1d66640b088e342fad Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 5 Oct 2023 08:56:30 -0700 Subject: [PATCH 16/40] fix `config.yml` to be a string --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 9c66b46..7b40907 100644 --- a/values.yaml +++ b/values.yaml @@ -47,7 +47,7 @@ api: config: enabled: true data: - config.yml: + config.yml: | database: # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) type: 'postgres' -- 2.45.1 From b526d218e2e5d7e8596dcd334502bae8b8f345f9 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 5 Oct 2023 08:57:11 -0700 Subject: [PATCH 17/40] set the primary frontend service to be the primary frontend service --- templates/frontend.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/templates/frontend.yaml b/templates/frontend.yaml index 722c689..8c2e295 100644 --- a/templates/frontend.yaml +++ b/templates/frontend.yaml @@ -5,16 +5,12 @@ global: service: main: enabled: true - {{- if not .Values.api.enabled -}} primary: true - {{- end }} type: ClusterIP ports: http: enabled: true - {{- if not .Values.api.enabled -}} primary: true - {{- end }} port: 80 protocol: HTTP -- 2.45.1 From 763de078183f2d2072d03fc99727f173e2d275fa Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 5 Oct 2023 14:04:20 -0700 Subject: [PATCH 18/40] update README.md --- README.md | 148 ++++++++++++++++++---------------------------------- values.yaml | 2 +- 2 files changed, 51 insertions(+), 99 deletions(-) diff --git a/README.md b/README.md index 0b50978..3964d45 100644 --- a/README.md +++ b/README.md @@ -10,124 +10,76 @@ Helm >= 3 ## Quickstart -Default settings should work for you and if you define ingress settings according to your controller (for both API and Frontend), you will be able to access the frontend. Anyway, it won't have any default credentials. In order to create a user, you **have to enable registration** and register a new user. +The majority of default values defined in `values.yaml` should be compatible for your deployment. Additionally, if you utilize an Ingress for both the API and Frontend, you will be able to access the frontend out of the box. However, it won't have any default credentials, you will need to **either** enable registration, or execute `/bin/sh` on the API container and run the following command: + +```bash +./vikunja user create --email --user --password +``` + +If you do **not** wish to execute the above command in order to create a new user, you'll need to enable registration by appending ```yaml api: - config: - service: - enableregistration: true + configMaps: + config: + enabled: true + data: + config.yml: + service: + enableregistration: true ``` -Once you have registered, you can disable registration back if you do not need it. +Once you've registered your user, feel free to disable registration if you don't wish for other users to register. -## Advanced features +### Modifying Resources -### Raw resources +Often times, modifications need to be made to a Helm chart to allow it to operate in your Kubernetes cluster. By utilizing bjw-s's `common` library, there are quite a few options that can be easily modified. -Often happens, that you have to deploy some cloud-specific resources that are not a part of the application chart itself. You have to either create an extra chart for that, or manage them with other tools (kustomize, plain manifests etc.). That is painful. We have a solution. If you want to create anything that is not present in the chart, *just add it in raw*! +Anything you see [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml), including the top-level keys, can be added and subtracted from this chart's `values.yaml`, underneath the `api`, `frontend`, and (optionally) `typesense` key. -Let's say, you are hosted in [GKE](https://cloud.google.com/kubernetes-engine) and want to use Google-managed TLS certificates. In order to do that, you have to create a ManagedCertificate resource. It can be done this way. +For example, if you wished to create a `serviceAccount` as can be seen [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L85-L87) for the `api` pod: + +```yaml +api: + serviceAccount: + create: true +``` + +Then, (for some reason), if you wished to deploy the `frontend` as a `DaemonSet` ([as can be seen here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L12-L17)), you could do the following: ```yaml frontend: - enabled: true - annotations: - kubernetes.io/ingress.class: gce - networking.gke.io/managed-certificates: gmc-example-com - hosts: - - host: example.com - paths: - - path: / - pathType: Prefix - -raw: -- apiVersion: networking.gke.io/v1 - kind: ManagedCertificate - metadata: - name: gmc-example-com - spec: - domains: - - example.com -``` - -Or, let's say, you have decided to use Google SQL database instead of self-hosted, and placed credentials in Google Secret Manager. You plan to use [ExternalSecrets](https://external-secrets.io/v0.7.2/) to get that credentials. These can be easily integrated as well. - -```yaml -# Disable embedded database -postgresqlEnabled: false - -api: - config: - database: - # Use PostgreSQL database anyway - type: postgres - envFrom: - # Bind env variables from the secret - - name: VIKUNJA_DATABASE_USER - valueFrom: - secretKeyRef: - name: postgresql-credentials - key: username - - name: VIKUNJA_DATABASE_PASSWORD - valueFrom: - secretKeyRef: - name: postgresql-credentials - key: password - - name: VIKUNJA_DATABASE_HOST - valueFrom: - secretKeyRef: - name: postgresql-credentials - key: hostname - - name: VIKUNJA_DATABASE_DATABASE - valueFrom: - secretKeyRef: - name: postgresql-credentials - key: database - -raw: -- apiVersion: external-secrets.io/v1beta1 - kind: SecretStore - metadata: - name: gcpsm - spec: - refreshInterval: 300 - provider: - gcpsm: - projectID: my-google-project-id - -- apiVersion: external-secrets.io/v1beta1 - kind: ExternalSecret - metadata: - name: postgresql-credentials - spec: - secretStoreRef: - kind: SecretStore - name: gcpsm - target: - deletionPolicy: Delete - refreshInterval: 5m - dataFrom: - - extract: - key: cloud-sql-credentials -``` - -Enjoy! + controller: + type: daemonset +``` ### Use an existing file volume claim -In the `values.yaml` file, you can configure wether to create the Persistent Volume Claim or use an existing one: +In the `values.yaml` file, you can either define your own existing Persistent Volume Claim (PVC) or have the chart create one on your behalf. +To have the chart use your pre-existing PVC: ```yaml - # Specifies whether a PVC should be created - create: true - # The name of the PVC to use. - # If not set and create is true, a name is generated using the fullname template - name: "" +api: + persistence: + data: + enabled: true + existingClaim: ``` -This is helpful when migrating from a different k8s chart and want to re-use the existing volume or if you need more control over how the volume is created. +To have the chart create one on your behalf: + +```yaml +# You can find the default values +api: + enabled: true + persistence: + data: + enabled: true + accessMode: ReadWriteOnce + size: 10Gi + storageClass: storage-class +``` ## Publishing diff --git a/values.yaml b/values.yaml index 7b40907..9c66b46 100644 --- a/values.yaml +++ b/values.yaml @@ -47,7 +47,7 @@ api: config: enabled: true data: - config.yml: | + config.yml: database: # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) type: 'postgres' -- 2.45.1 From 2ed6c6e504b7f4e6fa360e2d10f4aed589c7bbe8 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 5 Oct 2023 15:14:58 -0700 Subject: [PATCH 19/40] update Redis chart version --- Chart.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chart.lock b/Chart.lock index ce79a83..12fec3b 100644 --- a/Chart.lock +++ b/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: redis repository: https://charts.bitnami.com/bitnami - version: 17.5.1 + version: 17.11.6 - name: postgresql repository: https://charts.bitnami.com/bitnami version: 12.1.9 - 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" +digest: sha256:efadd6fed4908e6062d0d227177d5d650e5fe5b9c94f1cc99feb33ce3a1d0916 +generated: "2023-10-05T14:21:22.588364801-07:00" -- 2.45.1 From a748fcdb8f112e1e4ef9c8911e575d3bb68e4d7d Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 5 Oct 2023 15:31:06 -0700 Subject: [PATCH 20/40] update frontend env values --- values.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/values.yaml b/values.yaml index 9c66b46..3c4911d 100644 --- a/values.yaml +++ b/values.yaml @@ -101,11 +101,8 @@ frontend: config: enabled: true data: {} - - - # env: - # VIKUNJA_FRONTEND_URL: http://vikunja.local/api + # VIKUNJA_API_URL: http://vikunja.local/api ########################## # END VIKUNJA COMPONENTS # -- 2.45.1 From d8500214e98def13755bad78e31e9b2e39404df1 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 10 Oct 2023 15:19:07 -0700 Subject: [PATCH 21/40] Fix typo, provide some additional context/links --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6eae44e..e22aaa8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Vikunja Helm Chart === -Deployes both frontend and api. Also, you can deploy bitnami's PostgreSQL and Redis as subcharts if you want. +This Helm Chart deploys both the Vikunja [frontend](https://hub.docker.com/r/vikunja/frontend) and Vikunja [api](https://hub.docker.com/r/vikunja/api) containers, in addition to other Kubernetes resources so that you'll have a fully functioning Vikunja deployment quickly. Also, you can deploy Bitnami's [PostgreSQL](https://github.com/bitnami/charts/tree/main/bitnami/postgresql) and [Redis](https://github.com/bitnami/charts/tree/main/bitnami/redis) as subcharts if you want, as Vikunja can utilize them as its database and caching mechanism (respectively). ## Requirements -- 2.45.1 From 61b8892ff0aa802e33c40656e27caa6105b48881 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 10 Oct 2023 15:23:38 -0700 Subject: [PATCH 22/40] fix api probe endpoint --- templates/api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/api.yaml b/templates/api.yaml index 9226a4f..c997a43 100644 --- a/templates/api.yaml +++ b/templates/api.yaml @@ -28,7 +28,7 @@ probes: custom: true spec: httpGet: - path: /api/v1 + path: /api/v1/info port: http initialDelaySeconds: 0 periodSeconds: 10 -- 2.45.1 From 9cd4680e707c57d06e718f8d1e6f524408965a32 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 10 Oct 2023 15:37:44 -0700 Subject: [PATCH 23/40] have frontendUrl use Ingress host if exists --- templates/api.yaml | 13 +++++++++++++ values.yaml | 10 ++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/templates/api.yaml b/templates/api.yaml index c997a43..4ac7ee2 100644 --- a/templates/api.yaml +++ b/templates/api.yaml @@ -38,6 +38,19 @@ probes: startup: enabled: false +{{ if .Values.frontend.ingress.enabled }} +configMaps: + # The configuration for Vikunja's backend. + # https://vikunja.io/docs/config-options/ + config: + enabled: true + data: + config.yml: + service: + # Vikunja needs to know the frontend URL for password reset emails. + frontendUrl: "http://{{ index .Values.frontend.ingress.main.hosts 0 "host" }}{{ index .Values.frontend.ingress.main.hosts 0 "path" }}" +{{ end }} + env: {{ if .Values.redis.enabled }} VIKUNJA_REDIS_ENABLED: "true" diff --git a/values.yaml b/values.yaml index 3c4911d..3ae9f5a 100644 --- a/values.yaml +++ b/values.yaml @@ -17,7 +17,7 @@ storage: ###################### # VIKUNJA COMPONENTS # ###################### -# You can find the default values +# You can find the default values that this `values.yaml` overrides, in the comment at the top of this file. api: enabled: true image: @@ -48,6 +48,11 @@ api: enabled: true data: config.yml: + # Vikunja needs to know the frontend URL for password reset emails. + # So you might need to provide its value, if you're not using an ingress. + # service: + # frontendUrl: http://vikunja.local + database: # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) type: 'postgres' @@ -55,9 +60,6 @@ api: password: "{{ .Values.postgresql.global.postgresql.auth.password }}" database: "{{ .Values.postgresql.global.postgresql.auth.database }}" host: '{{ .Release.Name }}-postgresql' - service: - # Vikunja needs to know the frontend URL for password reset emails. - frontendUrl: http://vikunja.local typesense: # Typesense will only work if it is enabled below (typesense.enabled). url: '{{ printf "%s-typesense" .Release.Name }}' -- 2.45.1 From 7d2f43fee3d21c2a5844ac71bcf54c7da96cf1b9 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 10 Oct 2023 15:37:59 -0700 Subject: [PATCH 24/40] add comment about having to change ingress host --- values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/values.yaml b/values.yaml index 3ae9f5a..462b6db 100644 --- a/values.yaml +++ b/values.yaml @@ -93,6 +93,7 @@ frontend: # proxy-body-size is set to 0 to remove the body limit on file uploads nginx.ingress.kubernetes.io/proxy-body-size: "0" hosts: + # This is just an example. You should change this to your own domain. - host: vikunja.local paths: - path: "/" -- 2.45.1 From c601e5e449523ffb7feb7d35ca72389075769d9c Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 10 Oct 2023 15:40:48 -0700 Subject: [PATCH 25/40] only override frontendUrl if user has enabled the config configmap --- templates/api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/api.yaml b/templates/api.yaml index 4ac7ee2..cf279ac 100644 --- a/templates/api.yaml +++ b/templates/api.yaml @@ -38,7 +38,7 @@ probes: startup: enabled: false -{{ if .Values.frontend.ingress.enabled }} +{{ if and .Values.frontend.ingress.enabled .Values.api.configMaps.config.enabled}} configMaps: # The configuration for Vikunja's backend. # https://vikunja.io/docs/config-options/ -- 2.45.1 From 76b209a70c3b73b8bcaeff153e8c5a56a3901975 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 11 Oct 2023 06:52:47 -0700 Subject: [PATCH 26/40] rename backend to api --- templates/api.yaml | 2 +- values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/api.yaml b/templates/api.yaml index cf279ac..92f9785 100644 --- a/templates/api.yaml +++ b/templates/api.yaml @@ -40,7 +40,7 @@ probes: {{ if and .Values.frontend.ingress.enabled .Values.api.configMaps.config.enabled}} configMaps: - # The configuration for Vikunja's backend. + # The configuration for Vikunja's api. # https://vikunja.io/docs/config-options/ config: enabled: true diff --git a/values.yaml b/values.yaml index 462b6db..c09ca4b 100644 --- a/values.yaml +++ b/values.yaml @@ -32,7 +32,7 @@ api: # storageClass: storage-class ingress: main: - enabled: false + 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" @@ -42,7 +42,7 @@ api: - path: "/api" tls: [] configMaps: - # The configuration for Vikunja's backend. + # The configuration for Vikunja's api. # https://vikunja.io/docs/config-options/ config: enabled: true -- 2.45.1 From 3ea99647e2b2343762d9fe7ce26def2065f19957 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 11 Oct 2023 06:52:59 -0700 Subject: [PATCH 27/40] move logic for determining api url --- templates/frontend.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/frontend.yaml b/templates/frontend.yaml index 8c2e295..d2b140a 100644 --- a/templates/frontend.yaml +++ b/templates/frontend.yaml @@ -14,6 +14,10 @@ service: port: 80 protocol: HTTP +env: + {{- if .Values.api.ingress.main.enabled }} + VIKUNJA_API_URL: "http://{{ index .Values.api.ingress.main.hosts 0 "host" }}{{ index .Values.api.ingress.main.hosts 0 "path" }}" + {{ end }} {{ end }} -- 2.45.1 From 688a055c369218558392df042f8ee6e16900e0f6 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 11 Oct 2023 06:58:54 -0700 Subject: [PATCH 28/40] Fix README.md --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e22aaa8..fa7fe03 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ This Helm Chart deploys both the Vikunja [frontend](https://hub.docker.com/r/vik ## Quickstart -The majority of default values defined in `values.yaml` should be compatible for your deployment. Additionally, if you utilize an Ingress for both the API and Frontend, you will be able to access the frontend out of the box. However, it won't have any default credentials, you will need to **either** enable registration, or execute `/bin/sh` on the API container and run the following command: +The majority of default values defined in `values.yaml` should be compatible for your deployment. Additionally, if you utilize an Ingress for both the API and Frontend, you will be able to access the frontend out of the box. However, it won't have any default credentials. So, you'll need to create an account using the registration button. -```bash -./vikunja user create --email --user --password -``` +That should be it! -If you do **not** wish to execute the above command in order to create a new user, you'll need to enable registration by appending +## Registration (creating users) + +You can disable registration (if you do not with to allow others to register on your Vikunja), by providing the following values in your `values.yaml`: ```yaml api: @@ -26,10 +26,14 @@ api: data: config.yml: service: - enableregistration: true + enableregistration: false ``` -Once you've registered your user, feel free to disable registration if you don't wish for other users to register. +If you need to create another user, you could opt to execute the following command on the `api` container: + +```bash +./vikunja user create --email --user --password +``` ### Modifying Resources -- 2.45.1 From 48c7b05968c482d9b1066b30647f73570c5f7b70 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 11 Oct 2023 07:05:22 -0700 Subject: [PATCH 29/40] change api url `/api` to `/api/v1` --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index c09ca4b..3f379e7 100644 --- a/values.yaml +++ b/values.yaml @@ -39,7 +39,7 @@ api: hosts: - host: vikunja.local paths: - - path: "/api" + - path: "/api/v1" tls: [] configMaps: # The configuration for Vikunja's api. -- 2.45.1 From 746555db06a473963aa86202296ecbc4cae4ce40 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 11 Oct 2023 07:06:57 -0700 Subject: [PATCH 30/40] add comment about PVC --- values.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/values.yaml b/values.yaml index 3f379e7..e4aa64b 100644 --- a/values.yaml +++ b/values.yaml @@ -7,13 +7,6 @@ image: tag: 0.21.0 -storage: - persistence: - - # Automatically creating the library volume is not supported by this chart - # You have to specify an existing PVC to use - existingClaim: - ###################### # VIKUNJA COMPONENTS # ###################### @@ -24,6 +17,8 @@ api: repository: vikunja/api pullPolicy: IfNotPresent persistence: + # This is your Vikunja data will live, you can either let + # the chart create a new PVC for you or provide an existing one. data: enabled: true # existingClaim: # your-claim -- 2.45.1 From d406bb50fd2b0a9c0bad8a1533b9ab90dedd5f78 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 11 Oct 2023 07:11:56 -0700 Subject: [PATCH 31/40] change md heading --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa7fe03..681ba97 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The majority of default values defined in `values.yaml` should be compatible for That should be it! -## Registration (creating users) +### Registration (creating users) You can disable registration (if you do not with to allow others to register on your Vikunja), by providing the following values in your `values.yaml`: @@ -35,7 +35,7 @@ If you need to create another user, you could opt to execute the following comma ./vikunja user create --email --user --password ``` -### Modifying Resources +### Modifying Deployed Resources Often times, modifications need to be made to a Helm chart to allow it to operate in your Kubernetes cluster. By utilizing bjw-s's `common` library, there are quite a few options that can be easily modified. -- 2.45.1 From 915fe8529881d9ac9ebb7dd17b1e2fb9173c44a9 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Fri, 20 Oct 2023 17:12:20 -0700 Subject: [PATCH 32/40] add more context --- values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/values.yaml b/values.yaml index e4aa64b..efc5170 100644 --- a/values.yaml +++ b/values.yaml @@ -50,6 +50,7 @@ api: database: # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) + # To utilize a secret in this configMap, you can do something like the following: https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L141-L145 type: 'postgres' user: "{{ .Values.postgresql.global.postgresql.auth.username }}" password: "{{ .Values.postgresql.global.postgresql.auth.password }}" -- 2.45.1 From 6352bb844c5d3f609384eae50717a06101b6ac79 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Fri, 20 Oct 2023 17:25:37 -0700 Subject: [PATCH 33/40] add more comments about VIKUNJA_API_URL --- values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/values.yaml b/values.yaml index efc5170..7aedfd1 100644 --- a/values.yaml +++ b/values.yaml @@ -100,6 +100,8 @@ frontend: config: enabled: true data: {} + # If you've used the "built-in" ingress in the api section, you don't need to specify VIKUNJA_API_URL as an environment variable here. + # If you've used something else, you'll need to provide the URL to the API here. # env: # VIKUNJA_API_URL: http://vikunja.local/api -- 2.45.1 From 34b6d620aa652b419a1bf8131a23a6dfcac6eceb Mon Sep 17 00:00:00 2001 From: perf3ct Date: Fri, 20 Oct 2023 17:27:58 -0700 Subject: [PATCH 34/40] toss this --- values.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/values.yaml b/values.yaml index 7aedfd1..6e3abe9 100644 --- a/values.yaml +++ b/values.yaml @@ -94,12 +94,6 @@ frontend: paths: - path: "/" tls: [] - configMaps: - # The configuration for Vikunja's frontend. - # https://vikunja.io/docs/config-options/ - config: - enabled: true - data: {} # If you've used the "built-in" ingress in the api section, you don't need to specify VIKUNJA_API_URL as an environment variable here. # If you've used something else, you'll need to provide the URL to the API here. # env: -- 2.45.1 From a3a944482e78063c233b013b2ebe8c7902597ef4 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Fri, 20 Oct 2023 18:00:43 -0700 Subject: [PATCH 35/40] this needs to be a string --- values.yaml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/values.yaml b/values.yaml index 6e3abe9..e57e5c0 100644 --- a/values.yaml +++ b/values.yaml @@ -2,7 +2,7 @@ ## You can find it and the values you can provide and modify, at https://github.com/bjw-s/helm-charts/tree/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common ## Here's the link to the values.yaml file: https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml ## Refer there for more detail about the supported values. -## Any values that you find in the above `values.yaml` can be provided to this chart and are then rendered. +## Any values that you find in the above `values.yaml` can be provided to this chart and are then rendered. image: tag: 0.21.0 @@ -17,8 +17,8 @@ api: repository: vikunja/api pullPolicy: IfNotPresent persistence: - # This is your Vikunja data will live, you can either let - # the chart create a new PVC for you or provide an existing one. + # This is your Vikunja data will live, you can either let + # the chart create a new PVC for you or provide an existing one. data: enabled: true # existingClaim: # your-claim @@ -42,7 +42,7 @@ api: config: enabled: true data: - config.yml: + config.yml: | # Vikunja needs to know the frontend URL for password reset emails. # So you might need to provide its value, if you're not using an ingress. # service: @@ -51,11 +51,11 @@ api: database: # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) # To utilize a secret in this configMap, you can do something like the following: https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L141-L145 - type: 'postgres' + type: postgres user: "{{ .Values.postgresql.global.postgresql.auth.username }}" password: "{{ .Values.postgresql.global.postgresql.auth.password }}" database: "{{ .Values.postgresql.global.postgresql.auth.database }}" - host: '{{ .Release.Name }}-postgresql' + host: "{{ .Release.Name }}-postgresql" typesense: # Typesense will only work if it is enabled below (typesense.enabled). url: '{{ printf "%s-typesense" .Release.Name }}' @@ -80,7 +80,7 @@ frontend: service: main: type: ClusterIP - + # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L393-L436 ingress: main: @@ -97,13 +97,12 @@ frontend: # If you've used the "built-in" ingress in the api section, you don't need to specify VIKUNJA_API_URL as an environment variable here. # If you've used something else, you'll need to provide the URL to the API here. # env: - # VIKUNJA_API_URL: http://vikunja.local/api + # VIKUNJA_API_URL: http://vikunja.local/api ########################## # END VIKUNJA COMPONENTS # ########################## - # Optional Dependencies postgresql: enabled: true -- 2.45.1 From 8e752fc433d8780ee438c7398ad36d964fceb70d Mon Sep 17 00:00:00 2001 From: perf3ct Date: Sat, 21 Oct 2023 12:36:41 -0700 Subject: [PATCH 36/40] Pass variables that *may* require secrets via environment to the API container, instead of configMap since we can provide secrets to the `env` key. --- values.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/values.yaml b/values.yaml index e57e5c0..dd9a5f9 100644 --- a/values.yaml +++ b/values.yaml @@ -48,14 +48,6 @@ api: # service: # frontendUrl: http://vikunja.local - database: - # You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance (https://github.com/bitnami/charts/blob/5ff8ad5f3c754e3c2423d6abf46f522e8abe0410/bitnami/postgresql/values.yaml#L35-L39) - # To utilize a secret in this configMap, you can do something like the following: https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L141-L145 - type: postgres - user: "{{ .Values.postgresql.global.postgresql.auth.username }}" - password: "{{ .Values.postgresql.global.postgresql.auth.password }}" - database: "{{ .Values.postgresql.global.postgresql.auth.database }}" - host: "{{ .Release.Name }}-postgresql" typesense: # Typesense will only work if it is enabled below (typesense.enabled). url: '{{ printf "%s-typesense" .Release.Name }}' @@ -64,6 +56,14 @@ api: # Redis will only work if it is enabled below (redis.enabled). host: '{{ printf "%s-redis-master" .Release.Name }}' db: "{{ .Release.Name }}" + env: + # To utilize a secret in the environment variables, you can do something like the following: https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L141-L145 + # You could also use MySQL or SQLite, but we recommend PostgreSQL. + # https://vikunja.io/docs/config-options/#type + VIKUNJA_DATABASE_TYPE: "postgres" + VIKUNJA_DATABASE_USER: "{{ .Values.postgresql.global.postgresql.auth.username }}" + VIKUNJA_DATABASE_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" + VIKUNJA_DATABASE_NAME: "{{ .Values.postgresql.global.postgresql.auth.database }}" frontend: enabled: true -- 2.45.1 From 6cefa2e3d2b52c90c8e4510018887d738055ec3f Mon Sep 17 00:00:00 2001 From: perf3ct Date: Sat, 21 Oct 2023 12:43:56 -0700 Subject: [PATCH 37/40] this should be moved then --- templates/api.yaml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/templates/api.yaml b/templates/api.yaml index 92f9785..2c30d63 100644 --- a/templates/api.yaml +++ b/templates/api.yaml @@ -38,18 +38,6 @@ probes: startup: enabled: false -{{ if and .Values.frontend.ingress.enabled .Values.api.configMaps.config.enabled}} -configMaps: - # The configuration for Vikunja's api. - # https://vikunja.io/docs/config-options/ - config: - enabled: true - data: - config.yml: - service: - # Vikunja needs to know the frontend URL for password reset emails. - frontendUrl: "http://{{ index .Values.frontend.ingress.main.hosts 0 "host" }}{{ index .Values.frontend.ingress.main.hosts 0 "path" }}" -{{ end }} env: {{ if .Values.redis.enabled }} @@ -58,6 +46,11 @@ env: {{ if .Values.typesense.enabled }} VIKUNJA_TYPESENSE_ENABLED: "true" {{ end }} +{{ if and .Values.frontend.ingress.enabled .Values.api.configMaps.config.enabled}} + # The configuration for Vikunja's api. + # https://vikunja.io/docs/config-options/ + VIKUNJA_SERVICE_FRONTENDURL: "http://{{ index .Values.frontend.ingress.main.hosts 0 "host" }}{{ index .Values.frontend.ingress.main.hosts 0 "path" }}" +{{ end }} # Logic to decide what the api URL should be {{ if .Values.frontend.ingress.enabled }} -- 2.45.1 From 0d72431ad75fddc08c48de07583985f8fd3464d8 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Sat, 21 Oct 2023 16:08:05 -0700 Subject: [PATCH 38/40] these need to be double quoted --- values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/values.yaml b/values.yaml index dd9a5f9..653e3e5 100644 --- a/values.yaml +++ b/values.yaml @@ -50,11 +50,11 @@ api: typesense: # Typesense will only work if it is enabled below (typesense.enabled). - url: '{{ printf "%s-typesense" .Release.Name }}' + url: "{{ printf "%s-typesense" .Release.Name }}:8108" apiKey: "{{ .Values.typesense.env.TYPESENSE_API_KEY }}" redis: # Redis will only work if it is enabled below (redis.enabled). - host: '{{ printf "%s-redis-master" .Release.Name }}' + host: "{{ printf "%s-redis-master" .Release.Name }}:6379" db: "{{ .Release.Name }}" env: # To utilize a secret in the environment variables, you can do something like the following: https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L141-L145 -- 2.45.1 From e09afb9e25885efd3d80d40ad8e61ba588870cff Mon Sep 17 00:00:00 2001 From: perf3ct Date: Sat, 21 Oct 2023 16:19:45 -0700 Subject: [PATCH 39/40] specify tag as well --- values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/values.yaml b/values.yaml index 653e3e5..3e410b8 100644 --- a/values.yaml +++ b/values.yaml @@ -15,6 +15,7 @@ api: enabled: true image: repository: vikunja/api + tag: 0.21.0 pullPolicy: IfNotPresent persistence: # This is your Vikunja data will live, you can either let @@ -72,6 +73,7 @@ frontend: # https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L63-L69 image: repository: vikunja/frontend + tag: 0.21.0 pullPolicy: IfNotPresent # You can use either a `service` or an `ingress` to interact with Vikunja's frontend. # `Ingress` is the recommended option, but you can still set the `service` to -- 2.45.1 From ce56e07518e9187f2f406a80c94dc8fddca53a87 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 2 Nov 2023 12:34:45 -0700 Subject: [PATCH 40/40] Move README.md components around --- README.md | 86 +++++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 681ba97..8e8ebc0 100644 --- a/README.md +++ b/README.md @@ -14,49 +14,6 @@ The majority of default values defined in `values.yaml` should be compatible for That should be it! -### Registration (creating users) - -You can disable registration (if you do not with to allow others to register on your Vikunja), by providing the following values in your `values.yaml`: - -```yaml -api: - configMaps: - config: - enabled: true - data: - config.yml: - service: - enableregistration: false -``` - -If you need to create another user, you could opt to execute the following command on the `api` container: - -```bash -./vikunja user create --email --user --password -``` - -### Modifying Deployed Resources - -Often times, modifications need to be made to a Helm chart to allow it to operate in your Kubernetes cluster. By utilizing bjw-s's `common` library, there are quite a few options that can be easily modified. - -Anything you see [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml), including the top-level keys, can be added and subtracted from this chart's `values.yaml`, underneath the `api`, `frontend`, and (optionally) `typesense` key. - -For example, if you wished to create a `serviceAccount` as can be seen [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L85-L87) for the `api` pod: - -```yaml -api: - serviceAccount: - create: true -``` - -Then, (for some reason), if you wished to deploy the `frontend` as a `DaemonSet` ([as can be seen here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L12-L17)), you could do the following: - -```yaml -frontend: - controller: - type: daemonset -``` - ### Use an existing file volume claim In the `values.yaml` file, you can either define your own existing Persistent Volume Claim (PVC) or have the chart create one on your behalf. @@ -85,6 +42,49 @@ api: storageClass: storage-class ``` +### Modifying Deployed Resources + +Often times, modifications need to be made to a Helm chart to allow it to operate in your Kubernetes cluster. By utilizing bjw-s's `common` library, there are quite a few options that can be easily modified. + +Anything you see [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml), including the top-level keys, can be added and subtracted from this chart's `values.yaml`, underneath the `api`, `frontend`, and (optionally) `typesense` key. + +For example, if you wished to create a `serviceAccount` as can be seen [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L85-L87) for the `api` pod: + +```yaml +api: + serviceAccount: + create: true +``` + +Then, (for some reason), if you wished to deploy the `frontend` as a `DaemonSet` ([as can be seen here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L12-L17)), you could do the following: + +```yaml +frontend: + controller: + type: daemonset +``` + +### Another Example of Modifying `config.yml` (Enabling Registration) + +You can disable registration (if you do not with to allow others to register on your Vikunja), by providing the following values in your `values.yaml`: + +```yaml +api: + configMaps: + config: + enabled: true + data: + config.yml: + service: + enableregistration: false +``` + +If you need to create another user, you could opt to execute the following command on the `api` container: + +```bash +./vikunja user create --email --user --password +``` + ## Publishing The following steps are automatically performed when a git tag for a new version is pushed to the repository. -- 2.45.1