Skip to content

Commit

Permalink
feat: Add support for running multiple replicas (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
guerzon authored Nov 18, 2024
1 parent f929908 commit 873309a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/vaultwarden/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- name: guerzon
email: [email protected]
url: https://github.com/guerzon
version: 0.29.4
version: 0.30.0
kubeVersion: ">=1.12.0-0"
18 changes: 16 additions & 2 deletions charts/vaultwarden/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ Visit [this](https://medium.com/@sreafterhours/deploy-vaultwarden-to-amazon-eks-

Detailed configuration options can be found in the [Exposure Settings](#exposure-settings) section.

## High Availability

Set the following to run multiple deployment/statefulset replicas:

```yaml
replicas: 10
service:
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 10800
```

## Security

### Admin page
Expand Down Expand Up @@ -285,7 +299,7 @@ data:
To use persistent storage for attachments, set the `attachments` dictionary. Optionally set a different path. Note that by default, the path is `/data/attachments`.

```yaml
data:
attachments:
name: "vaultwarden-data"
size: "15Gi"
class: "local-path"
Expand All @@ -295,7 +309,7 @@ In case you want to keep the existing persistent volume claim during uninstall a
(This will be ignored for StatefulSets and is only relevant for `resourceType: Deployment`)

```yaml
data:
attachments:
name: "vaultwarden-data"
size: "15Gi"
class: "local-path"
Expand Down
2 changes: 1 addition & 1 deletion charts/vaultwarden/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app.kubernetes.io/component: vaultwarden
Expand Down
7 changes: 7 additions & 0 deletions charts/vaultwarden/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ spec:
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.sessionAffinity }}
sessionAffinity: {{ .Values.service.sessionAffinity }}
{{- end }}
{{- if .Values.service.sessionAffinityConfig }}
sessionAffinityConfig:
{{- toYaml .Values.service.sessionAffinityConfig | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/vaultwarden/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
{{- end }}
spec:
serviceName: vaultwarden
replicas: 1
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app.kubernetes.io/component: vaultwarden
Expand Down
15 changes: 15 additions & 0 deletions charts/vaultwarden/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ image:
##
extraVars: []

## @param replicas Number of deployment replicas
##
replicas: 1

## @param fullnameOverride String to override the application name.
##
fullnameOverride: ""
Expand Down Expand Up @@ -691,7 +695,18 @@ service:
##
labels: {}
## @param service.ipFamilyPolicy IP family policy for the service
##
ipFamilyPolicy: "SingleStack"
## @param service.sessionAffinity Session affinity
##
# sessionAffinity: ClientIP
sessionAffinity: ""
## @param service.sessionAffinity Session affinity configuration
##
sessionAffinityConfig: {}
# sessionAffinityConfig:
# clientIP:
# timeoutSeconds: 10800

## Ingress configuration
## Refer to the README for some examples
Expand Down

0 comments on commit 873309a

Please sign in to comment.