From 70118e5aeb620ddc2221dd0a3b075d9a9d803565 Mon Sep 17 00:00:00 2001 From: Thomas Blarre Date: Wed, 13 Nov 2024 18:47:14 +0000 Subject: [PATCH 1/4] Prepared vaultwarden --- vaultwarden-argocd-apps/.helmignore | 23 +++++++ vaultwarden-argocd-apps/Chart.yaml | 5 ++ .../templates/_helpers.tpl | 62 +++++++++++++++++++ vaultwarden-argocd-apps/values.yaml | 0 vaultwarden-postinstall/.helmignore | 23 +++++++ vaultwarden-postinstall/Chart.yaml | 5 ++ .../templates/_helpers.tpl | 62 +++++++++++++++++++ vaultwarden-postinstall/values.yaml | 0 vaultwarden-requirements/.helmignore | 23 +++++++ vaultwarden-requirements/Chart.yaml | 5 ++ .../templates/_helpers.tpl | 62 +++++++++++++++++++ .../templates/db-cluster.yaml | 8 +++ .../templates/vaultwarden-data.yaml | 11 ++++ vaultwarden-requirements/values.yaml | 8 +++ 14 files changed, 297 insertions(+) create mode 100644 vaultwarden-argocd-apps/.helmignore create mode 100644 vaultwarden-argocd-apps/Chart.yaml create mode 100644 vaultwarden-argocd-apps/templates/_helpers.tpl create mode 100644 vaultwarden-argocd-apps/values.yaml create mode 100644 vaultwarden-postinstall/.helmignore create mode 100644 vaultwarden-postinstall/Chart.yaml create mode 100644 vaultwarden-postinstall/templates/_helpers.tpl create mode 100644 vaultwarden-postinstall/values.yaml create mode 100644 vaultwarden-requirements/.helmignore create mode 100644 vaultwarden-requirements/Chart.yaml create mode 100644 vaultwarden-requirements/templates/_helpers.tpl create mode 100644 vaultwarden-requirements/templates/db-cluster.yaml create mode 100644 vaultwarden-requirements/templates/vaultwarden-data.yaml create mode 100644 vaultwarden-requirements/values.yaml diff --git a/vaultwarden-argocd-apps/.helmignore b/vaultwarden-argocd-apps/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/vaultwarden-argocd-apps/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/vaultwarden-argocd-apps/Chart.yaml b/vaultwarden-argocd-apps/Chart.yaml new file mode 100644 index 0000000..30cabad --- /dev/null +++ b/vaultwarden-argocd-apps/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: vaultwarden-argocd-apps +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 diff --git a/vaultwarden-argocd-apps/templates/_helpers.tpl b/vaultwarden-argocd-apps/templates/_helpers.tpl new file mode 100644 index 0000000..71c0dfd --- /dev/null +++ b/vaultwarden-argocd-apps/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "vaultwarden-argocd-apps.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 "vaultwarden-argocd-apps.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 "vaultwarden-argocd-apps.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "vaultwarden-argocd-apps.labels" -}} +helm.sh/chart: {{ include "vaultwarden-argocd-apps.chart" . }} +{{ include "vaultwarden-argocd-apps.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "vaultwarden-argocd-apps.selectorLabels" -}} +app.kubernetes.io/name: {{ include "vaultwarden-argocd-apps.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "vaultwarden-argocd-apps.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "vaultwarden-argocd-apps.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/vaultwarden-argocd-apps/values.yaml b/vaultwarden-argocd-apps/values.yaml new file mode 100644 index 0000000..e69de29 diff --git a/vaultwarden-postinstall/.helmignore b/vaultwarden-postinstall/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/vaultwarden-postinstall/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/vaultwarden-postinstall/Chart.yaml b/vaultwarden-postinstall/Chart.yaml new file mode 100644 index 0000000..5b39f93 --- /dev/null +++ b/vaultwarden-postinstall/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: vaultwarden-postinstall +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 diff --git a/vaultwarden-postinstall/templates/_helpers.tpl b/vaultwarden-postinstall/templates/_helpers.tpl new file mode 100644 index 0000000..f5f8d4e --- /dev/null +++ b/vaultwarden-postinstall/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "vaultwarden-postinstall.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 "vaultwarden-postinstall.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 "vaultwarden-postinstall.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "vaultwarden-postinstall.labels" -}} +helm.sh/chart: {{ include "vaultwarden-postinstall.chart" . }} +{{ include "vaultwarden-postinstall.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "vaultwarden-postinstall.selectorLabels" -}} +app.kubernetes.io/name: {{ include "vaultwarden-postinstall.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "vaultwarden-postinstall.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "vaultwarden-postinstall.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/vaultwarden-postinstall/values.yaml b/vaultwarden-postinstall/values.yaml new file mode 100644 index 0000000..e69de29 diff --git a/vaultwarden-requirements/.helmignore b/vaultwarden-requirements/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/vaultwarden-requirements/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/vaultwarden-requirements/Chart.yaml b/vaultwarden-requirements/Chart.yaml new file mode 100644 index 0000000..38b5d46 --- /dev/null +++ b/vaultwarden-requirements/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: vaultwarden-requirements +description: A Helm chart for deploying the dbcluster and pvc for vaultwarden +type: application +version: 0.1.0 diff --git a/vaultwarden-requirements/templates/_helpers.tpl b/vaultwarden-requirements/templates/_helpers.tpl new file mode 100644 index 0000000..a01c686 --- /dev/null +++ b/vaultwarden-requirements/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "vaultwarden-requirements.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 "vaultwarden-requirements.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 "vaultwarden-requirements.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "vaultwarden-requirements.labels" -}} +helm.sh/chart: {{ include "vaultwarden-requirements.chart" . }} +{{ include "vaultwarden-requirements.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "vaultwarden-requirements.selectorLabels" -}} +app.kubernetes.io/name: {{ include "vaultwarden-requirements.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "vaultwarden-requirements.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "vaultwarden-requirements.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/vaultwarden-requirements/templates/db-cluster.yaml b/vaultwarden-requirements/templates/db-cluster.yaml new file mode 100644 index 0000000..d93f794 --- /dev/null +++ b/vaultwarden-requirements/templates/db-cluster.yaml @@ -0,0 +1,8 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: vaultwarden-db +spec: + instances: {{ .Values.vaultwarden.dbCluster.numInstances }} + storage: + size: {{ .Values.vaultwarden.dbCluster.size }} diff --git a/vaultwarden-requirements/templates/vaultwarden-data.yaml b/vaultwarden-requirements/templates/vaultwarden-data.yaml new file mode 100644 index 0000000..85f90d0 --- /dev/null +++ b/vaultwarden-requirements/templates/vaultwarden-data.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Values.vaultwarden.dataPvc.name }} +spec: + storageClassName: {{ .Values.vaultwarden.dataPvc.storageClassName }} + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.vaultwarden.dataPvc.size }} diff --git a/vaultwarden-requirements/values.yaml b/vaultwarden-requirements/values.yaml new file mode 100644 index 0000000..4662ce9 --- /dev/null +++ b/vaultwarden-requirements/values.yaml @@ -0,0 +1,8 @@ +vaultwarden: + dbCluster: + numInstances: 3 + size: 10Gi + dataPvc: + name: vaultwarden-data + storageClassName: '' + size: 10Gi From 529ebc8095d1bafbeb0486aac16d07a673f27408 Mon Sep 17 00:00:00 2001 From: roukydesbois Date: Thu, 14 Nov 2024 08:56:58 +0000 Subject: [PATCH 2/4] Finished requirements --- .../templates/vaultwarden-chart.yaml | 63 +++++++++++++++++++ .../vaultwarden-requirements-app.yaml | 36 +++++++++++ vaultwarden-argocd-apps/values.yaml | 29 +++++++++ 3 files changed, 128 insertions(+) create mode 100644 vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml create mode 100644 vaultwarden-argocd-apps/templates/vaultwarden-requirements-app.yaml diff --git a/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml b/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml new file mode 100644 index 0000000..1753eb6 --- /dev/null +++ b/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml @@ -0,0 +1,63 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: vaultwarden + namespace: {{ .Values.argocd.namespace }} + annotations: + argocd.argoproj.io/sync-wave: "0" + notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578" +spec: + project: {{ .Values.argocd.project }} + source: + repoURL: "tccr.io/truecharts" + chart: vaultwarden + targetRevision: 28.x + helm: + releaseName: vaultwarden + valuesObject: + workload: + main: + podSpec: + containers: + main: + env: + DOMAIN: {{ .Values.vaultwarden.FQDN }} + persistence: + config: + enabled: true + mountPath: /config + type: pvc + namespace: {{ .Values.mainNamespace }} + accessModes: ReadWriteOnce + size: 100Mi + storageClass: {{ .Values.generalConfigStorageClass }} + database: + enabled: true + mountPath: /database + type: pvc + namespace: {{ .Values.mainNamespace }} + accessModes: ReadWriteOnce + size: 100Mi + storageClass: {{ .Values.generalConfigStorageClass }} + data: + enabled: true + mountPath: /data + type: pvc + namespace: {{ .Values.mainNamespace }} + existingClaim: thomflix-media + destination: + server: {{ .Values.mainDestination }} + namespace: {{ .Values.mainNamespace }} + syncPolicy: + automated: + prune: true # Automatically remove resources no longer in the repo + selfHeal: true # Automatically self-heal when drift is detected + syncOptions: + - ApplyOutOfSyncOnly=true + - ServerSideApply=true + - CreateNamespace=true + ignoreDifferences: + - group: apps + kind: Deployment + jsonPointers: + - /spec/template/spec/hostUsers diff --git a/vaultwarden-argocd-apps/templates/vaultwarden-requirements-app.yaml b/vaultwarden-argocd-apps/templates/vaultwarden-requirements-app.yaml new file mode 100644 index 0000000..9a14bf0 --- /dev/null +++ b/vaultwarden-argocd-apps/templates/vaultwarden-requirements-app.yaml @@ -0,0 +1,36 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: vaultwarden-requirements + namespace: {{ .Values.argocd.namespace }} + annotations: + argocd.argoproj.io/sync-wave: "-1" + notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578" +spec: + project: {{ .Values.argocd.project }} + source: + repoURL: {{ .Values.argocd.requirements.repoURL }} + targetRevision: {{ .Values.argocd.requirements.targetRevision }} + path: {{ .Values.argocd.requirements.path }} + helm: + releaseName: vaultwarden-requirements + valuesObject: + vaultwarden: + dbCluster: + numInstances: {{ .Values.vaultwarden.dbCluster.numInstances }} + size: {{ .Values.vaultwarden.dbCluster.size }} + dataPvc: + name: {{ .Values.vaultwarden.dataPvc.name }} + storageClassName: {{ .Values.vaultwarden.dataPvc.storageClassName }} + size: {{ .Values.vaultwarden.dataPvc.size }} + destination: + server: {{ .Values.destination.server }} + namespace: {{ .Values.destination.namespace }} + syncPolicy: + automated: + prune: true # Automatically remove resources no longer in the repo + selfHeal: true # Automatically self-heal when drift is detected + syncOptions: + - ApplyOutOfSyncOnly=true + - ServerSideApply=true + - CreateNamespace=true diff --git a/vaultwarden-argocd-apps/values.yaml b/vaultwarden-argocd-apps/values.yaml index e69de29..9daf0e8 100644 --- a/vaultwarden-argocd-apps/values.yaml +++ b/vaultwarden-argocd-apps/values.yaml @@ -0,0 +1,29 @@ +argocd: + namespace: argocd + project: default + requirements: + repoURL: "https://git.blarre.net/thomas/helm-charts.git" + targetRevision: HEAD + path: vaultwarden-requirements + postinstall: + repoURL: "https://git.blarre.net/thomas/helm-charts.git" + targetRevision: HEAD + path: vaultwarden-postinstall + +destination: + server: "https://kubernetes.default.svc" + namespace: vaultwarden + +vaultwarden: + dbCluster: + numInstances: 3 + size: 10Gi + dataPvc: + name: vaultwarden-data + storageClassName: '' + size: 10Gi + FQDN: vaultwarden.domain.net + replicaCount: 1 + +tailscaleIngresses: + odooHostname: odoo From d083169e655002300791930d38cde819a0e4fc39 Mon Sep 17 00:00:00 2001 From: Thomas Blarre Date: Thu, 14 Nov 2024 19:21:30 +0000 Subject: [PATCH 3/4] Using another chart for vaultwarden --- .../templates/vaultwarden-chart.yaml | 45 ++++--------------- vaultwarden-argocd-apps/values.yaml | 1 + 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml b/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml index 1753eb6..0539424 100644 --- a/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml +++ b/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml @@ -9,42 +9,18 @@ metadata: spec: project: {{ .Values.argocd.project }} source: - repoURL: "tccr.io/truecharts" + repoURL: "https://guerzon.github.io/vaultwarden" chart: vaultwarden - targetRevision: 28.x + targetRevision: v0.29.x helm: releaseName: vaultwarden valuesObject: - workload: - main: - podSpec: - containers: - main: - env: - DOMAIN: {{ .Values.vaultwarden.FQDN }} - persistence: - config: - enabled: true - mountPath: /config - type: pvc - namespace: {{ .Values.mainNamespace }} - accessModes: ReadWriteOnce - size: 100Mi - storageClass: {{ .Values.generalConfigStorageClass }} - database: - enabled: true - mountPath: /database - type: pvc - namespace: {{ .Values.mainNamespace }} - accessModes: ReadWriteOnce - size: 100Mi - storageClass: {{ .Values.generalConfigStorageClass }} - data: - enabled: true - mountPath: /data - type: pvc - namespace: {{ .Values.mainNamespace }} - existingClaim: thomflix-media + database: + type: postgresql + existingSecret: {{ .Values.vaultwarden.dbCluster.secretName }} + existingSecretKey: uri + ingress: + enabled: true destination: server: {{ .Values.mainDestination }} namespace: {{ .Values.mainNamespace }} @@ -56,8 +32,3 @@ spec: - ApplyOutOfSyncOnly=true - ServerSideApply=true - CreateNamespace=true - ignoreDifferences: - - group: apps - kind: Deployment - jsonPointers: - - /spec/template/spec/hostUsers diff --git a/vaultwarden-argocd-apps/values.yaml b/vaultwarden-argocd-apps/values.yaml index 9daf0e8..2c0b3e2 100644 --- a/vaultwarden-argocd-apps/values.yaml +++ b/vaultwarden-argocd-apps/values.yaml @@ -18,6 +18,7 @@ vaultwarden: dbCluster: numInstances: 3 size: 10Gi + secretName: vaultwarden-db-app dataPvc: name: vaultwarden-data storageClassName: '' From 5ffcfa40398c0e80c33405e753afe37c2df9470d Mon Sep 17 00:00:00 2001 From: Thomas Blarre Date: Thu, 14 Nov 2024 23:07:23 +0000 Subject: [PATCH 4/4] Finished vaultwarden --- .../templates/vaultwarden-chart.yaml | 12 +++++++- .../templates/vaultwarden-postinstall.yaml | 30 +++++++++++++++++++ vaultwarden-argocd-apps/values.yaml | 10 +++++-- vaultwarden-postinstall/Chart.yaml | 2 +- .../templates/vaultwarden-ingress.yaml | 16 ++++++++++ vaultwarden-postinstall/values.yaml | 2 ++ .../templates/vaultwarden-data.yaml | 2 ++ 7 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 vaultwarden-argocd-apps/templates/vaultwarden-postinstall.yaml create mode 100644 vaultwarden-postinstall/templates/vaultwarden-ingress.yaml diff --git a/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml b/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml index 0539424..5dbfcee 100644 --- a/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml +++ b/vaultwarden-argocd-apps/templates/vaultwarden-chart.yaml @@ -15,12 +15,22 @@ spec: helm: releaseName: vaultwarden valuesObject: + domain: {{ .Values.vaultwarden.fqdn }} + timeZone: {{ .Values.vaultwarden.timeZone }} database: type: postgresql existingSecret: {{ .Values.vaultwarden.dbCluster.secretName }} existingSecretKey: uri + data: + name: {{ .Values.vaultwarden.dataPvc.name }} + size: {{ .Values.vaultwarden.dataPvc.size }} + class: {{ .Values.vaultwarden.dataPvc.storageClassName }} + attachments: + name: {{ .Values.vaultwarden.attachmentPvc.name }} + size: {{ .Values.vaultwarden.attachmentPvc.size }} + class: {{ .Values.vaultwarden.attachmentPvc.storageClassName }} ingress: - enabled: true + enabled: false destination: server: {{ .Values.mainDestination }} namespace: {{ .Values.mainNamespace }} diff --git a/vaultwarden-argocd-apps/templates/vaultwarden-postinstall.yaml b/vaultwarden-argocd-apps/templates/vaultwarden-postinstall.yaml new file mode 100644 index 0000000..1b23944 --- /dev/null +++ b/vaultwarden-argocd-apps/templates/vaultwarden-postinstall.yaml @@ -0,0 +1,30 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: vaultwarden-postinstall + namespace: {{ .Values.argocd.namespace }} + annotations: + argocd.argoproj.io/sync-wave: "1" + notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578" +spec: + project: {{ .Values.argocd.project }} + source: + repoURL: {{ .Values.argocd.postinstall.repoURL }} + targetRevision: {{ .Values.argocd.postinstall.targetRevision }} + path: {{ .Values.argocd.postinstall.path }} + helm: + releaseName: vaultwarden-postinstall + valuesObject: + tailscaleIngresses: + vaultwardenHostname: {{ .Values.tailscaleIngresses.vaultwardenHostname }} + destination: + server: {{ .Values.destination.server }} + namespace: {{ .Values.destination.namespace }} + syncPolicy: + automated: + prune: true # Automatically remove resources no longer in the repo + selfHeal: true # Automatically self-heal when drift is detected + syncOptions: + - ApplyOutOfSyncOnly=true + - ServerSideApply=true + - CreateNamespace=true diff --git a/vaultwarden-argocd-apps/values.yaml b/vaultwarden-argocd-apps/values.yaml index 2c0b3e2..c27afc8 100644 --- a/vaultwarden-argocd-apps/values.yaml +++ b/vaultwarden-argocd-apps/values.yaml @@ -23,8 +23,12 @@ vaultwarden: name: vaultwarden-data storageClassName: '' size: 10Gi - FQDN: vaultwarden.domain.net - replicaCount: 1 + attachmentPvc: + name: vaultwarden-attachments + storageClassName: '' + size: 10Gi + fqdn: vaultwarden.domain.net + timeZone: "Europe/Lisbon" tailscaleIngresses: - odooHostname: odoo + vaultwardenHostname: vaultwarden diff --git a/vaultwarden-postinstall/Chart.yaml b/vaultwarden-postinstall/Chart.yaml index 5b39f93..a2d7dc7 100644 --- a/vaultwarden-postinstall/Chart.yaml +++ b/vaultwarden-postinstall/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 name: vaultwarden-postinstall -description: A Helm chart for Kubernetes +description: A Helm chart for deploynig vaultwarden's ingress type: application version: 0.1.0 diff --git a/vaultwarden-postinstall/templates/vaultwarden-ingress.yaml b/vaultwarden-postinstall/templates/vaultwarden-ingress.yaml new file mode 100644 index 0000000..2020167 --- /dev/null +++ b/vaultwarden-postinstall/templates/vaultwarden-ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ts-vaultwarden + annotations: + tailscale.com/funnel: "true" +spec: + defaultBackend: + service: + name: vaultwarden + port: + name: http + ingressClassName: tailscale + tls: + - hosts: + - {{ .Values.tailscaleIngresses.vaultwardenHostname }} diff --git a/vaultwarden-postinstall/values.yaml b/vaultwarden-postinstall/values.yaml index e69de29..ceadf8a 100644 --- a/vaultwarden-postinstall/values.yaml +++ b/vaultwarden-postinstall/values.yaml @@ -0,0 +1,2 @@ +tailscaleIngresses: + vaultwardenHostname: vaultwarden \ No newline at end of file diff --git a/vaultwarden-requirements/templates/vaultwarden-data.yaml b/vaultwarden-requirements/templates/vaultwarden-data.yaml index 85f90d0..7c326c3 100644 --- a/vaultwarden-requirements/templates/vaultwarden-data.yaml +++ b/vaultwarden-requirements/templates/vaultwarden-data.yaml @@ -1,3 +1,4 @@ +{{- if false -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -9,3 +10,4 @@ spec: resources: requests: storage: {{ .Values.vaultwarden.dataPvc.size }} +{{- end }} \ No newline at end of file