diff --git a/apps/charts/vaultwarden/Chart.yaml b/apps/charts/vaultwarden/Chart.yaml new file mode 100644 index 0000000..1561690 --- /dev/null +++ b/apps/charts/vaultwarden/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +version: 1.0.0 +name: vaultwarden diff --git a/apps/charts/vaultwarden/templates/deployment.yaml b/apps/charts/vaultwarden/templates/deployment.yaml new file mode 100644 index 0000000..44feda6 --- /dev/null +++ b/apps/charts/vaultwarden/templates/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Release.Name }}" +spec: + strategy: + type: Recreate + replicas: 1 + revisionHistoryLimit: 0 + selector: + matchLabels: + app: "{{ .Release.Name }}" + template: + metadata: + labels: + app: "{{ .Release.Name }}" + spec: + containers: + - name: "{{ .Release.Name }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + env: + - name: TZ + value: "{{ .Values.globals.timezone }}" + - name: DOMAIN + value: "https://{{ .Values.subdomain }}.{{ .Values.globals.domain }}" + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + tcpSocket: + port: http + readinessProbe: + tcpSocket: + port: http + volumeMounts: + - mountPath: /data + name: data + volumes: + - name: data + persistentVolumeClaim: + claimName: "{{ .Release.Name }}-data" diff --git a/apps/charts/vaultwarden/templates/external-http-service.yaml b/apps/charts/vaultwarden/templates/external-http-service.yaml new file mode 100644 index 0000000..e28916d --- /dev/null +++ b/apps/charts/vaultwarden/templates/external-http-service.yaml @@ -0,0 +1,11 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: ExternalHttpService +metadata: + name: '{{ .Release.Name }}' +spec: + environment: '{{ .Values.globals.environment }}' + subdomain: '{{ .Values.subdomain }}' + destination: + host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local' + port: + number: 80 diff --git a/apps/charts/vaultwarden/templates/pvc.yaml b/apps/charts/vaultwarden/templates/pvc.yaml new file mode 100644 index 0000000..aeca898 --- /dev/null +++ b/apps/charts/vaultwarden/templates/pvc.yaml @@ -0,0 +1,11 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: "{{ .Release.Name }}-data" +spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "1Gi" + storageClassName: "{{ .Values.globals.environment }}" diff --git a/apps/charts/vaultwarden/templates/service.yaml b/apps/charts/vaultwarden/templates/service.yaml new file mode 100644 index 0000000..98872d7 --- /dev/null +++ b/apps/charts/vaultwarden/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Release.Name }}" + labels: + app: "{{ .Release.Name }}" +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 80 + protocol: TCP + name: http + selector: + app: "{{ .Release.Name }}" diff --git a/apps/charts/vaultwarden/templates/virtual-service.yaml b/apps/charts/vaultwarden/templates/virtual-service.yaml new file mode 100644 index 0000000..0af9b24 --- /dev/null +++ b/apps/charts/vaultwarden/templates/virtual-service.yaml @@ -0,0 +1,18 @@ +apiVersion: networking.istio.io/v1 +kind: VirtualService +metadata: + name: "{{ .Release.Name }}" + namespace: "{{ .Release.Namespace }}" +spec: + gateways: + - "{{ .Values.globals.istio.gateway }}" + - mesh + hosts: + - "{{ .Values.subdomain }}.{{ .Values.globals.domain }}" + - mesh + http: + - route: + - destination: + host: "{{ .Release.Name }}" + port: + number: 80 diff --git a/apps/charts/vaultwarden/values.yaml b/apps/charts/vaultwarden/values.yaml new file mode 100644 index 0000000..1d07767 --- /dev/null +++ b/apps/charts/vaultwarden/values.yaml @@ -0,0 +1,6 @@ +image: + repository: vaultwarden/server + tag: latest + pullPolicy: IfNotPresent +subdomain: vaultwarden +