2022-07-10 00:45:18 +01:00
|
|
|
apiVersion: apps/v1
|
2022-07-13 12:42:52 +01:00
|
|
|
kind: StatefulSet
|
2022-07-10 00:45:18 +01:00
|
|
|
metadata:
|
|
|
|
name: vaultwarden
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: vaultwarden
|
2022-07-13 12:42:52 +01:00
|
|
|
serviceName: vaultwarden
|
|
|
|
replicas: 1
|
2022-07-10 00:45:18 +01:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: vaultwarden
|
|
|
|
spec:
|
|
|
|
volumes:
|
|
|
|
- name: litestream
|
|
|
|
configMap:
|
2022-07-20 17:03:39 +01:00
|
|
|
name: vaultwarden-litestream
|
2022-07-10 00:45:18 +01:00
|
|
|
- name: config
|
|
|
|
configMap:
|
|
|
|
name: vaultwarden
|
|
|
|
initContainers:
|
|
|
|
- name: init-litestream
|
2023-07-14 16:36:23 +01:00
|
|
|
image: litestream/litestream:sha-749bc0d
|
2022-07-10 00:45:18 +01:00
|
|
|
args: ['restore', '-if-db-not-exists', '-if-replica-exists', '-v', '/data/db.sqlite3']
|
|
|
|
volumeMounts:
|
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
|
|
|
- name: litestream
|
|
|
|
mountPath: /etc/litestream.yml
|
2022-07-20 17:03:39 +01:00
|
|
|
subPath: vaultwarden.yml
|
2023-08-05 12:02:00 +01:00
|
|
|
envFrom:
|
|
|
|
- secretRef:
|
|
|
|
name: vaultwarden-litestream-s3
|
2022-07-10 00:45:18 +01:00
|
|
|
|
|
|
|
containers:
|
|
|
|
- name: vaultwarden
|
|
|
|
image: docker.io/vaultwarden/server
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
memory: "128Mi"
|
|
|
|
cpu: "500m"
|
|
|
|
requests:
|
|
|
|
memory: "64Mi"
|
|
|
|
cpu: "100m"
|
2022-07-13 12:42:52 +01:00
|
|
|
ports:
|
|
|
|
- containerPort: 80
|
|
|
|
name: web
|
2022-07-10 00:45:18 +01:00
|
|
|
volumeMounts:
|
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
|
|
|
- name: config
|
|
|
|
mountPath: /data/config.json
|
|
|
|
subPath: vaultwarden.json
|
|
|
|
- name: litestream
|
2023-07-14 16:36:23 +01:00
|
|
|
image: litestream/litestream:sha-749bc0d
|
2022-07-10 00:45:18 +01:00
|
|
|
args: ['replicate']
|
|
|
|
volumeMounts:
|
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
|
|
|
- name: litestream
|
|
|
|
mountPath: /etc/litestream.yml
|
2022-07-20 17:03:39 +01:00
|
|
|
subPath: vaultwarden.yml
|
2023-08-05 12:02:00 +01:00
|
|
|
envFrom:
|
|
|
|
- secretRef:
|
|
|
|
name: vaultwarden-litestream-s3
|
2022-07-10 00:45:18 +01:00
|
|
|
ports:
|
|
|
|
- name: metrics
|
|
|
|
containerPort: 9090
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
memory: "128Mi"
|
|
|
|
cpu: "300m"
|
|
|
|
requests:
|
|
|
|
memory: "64Mi"
|
|
|
|
cpu: "100m"
|
2022-07-13 12:42:52 +01:00
|
|
|
|
|
|
|
volumeClaimTemplates:
|
|
|
|
- metadata:
|
|
|
|
name: data
|
|
|
|
spec:
|
2023-08-05 12:02:00 +01:00
|
|
|
storageClassName: nfs-client
|
2022-07-13 12:42:52 +01:00
|
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 1Gi
|
2022-07-10 00:45:18 +01:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
2022-07-20 17:03:39 +01:00
|
|
|
kind: Service
|
2022-07-10 00:45:18 +01:00
|
|
|
metadata:
|
2022-07-20 17:03:39 +01:00
|
|
|
name: vaultwarden
|
2022-07-10 00:45:18 +01:00
|
|
|
spec:
|
2022-07-20 17:03:39 +01:00
|
|
|
selector:
|
|
|
|
app: vaultwarden
|
|
|
|
ports:
|
|
|
|
- port: 80
|
|
|
|
targetPort: 80
|