Skip to content

Commit

Permalink
feat: Replace nginx snippet annotation with custom header annotation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrSpeck authored Aug 29, 2024
1 parent eac4a45 commit 6c1cf6a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 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.24.4
version: 0.25.0
kubeVersion: ">=1.12.0-0"
7 changes: 7 additions & 0 deletions charts/vaultwarden/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: custom-headers-configmap
data:
Request-Id: $req_id
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vaultwarden.fullname" . }}
namespace: {{ .Release.Namespace }}
Expand Down
3 changes: 1 addition & 2 deletions charts/vaultwarden/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ metadata:
{{- toYaml $ingress.additionalAnnotations | nindent 4 }}
{{- end }}
{{- if $ingress.nginxIngressAnnotations }}
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "Request-Id: $req_id";
nginx.ingress.kubernetes.io/custom-headers: {{ $ingress.customHeadersConfigMap }}
nginx.ingress.kubernetes.io/connection-proxy-header: "keep-alive"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
Expand Down
32 changes: 17 additions & 15 deletions charts/vaultwarden/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ serviceAccount:

## @param podSecurityContext Pod security options
##
podSecurityContext: {}
podSecurityContext:
{}
# fsGroup: 1001
# supplementalGroups:
# - 1001

## @param securityContext Default security options to run vault as read only container without privilege escalation
securityContext: {}
securityContext:
{}
# allowPrivilegeEscalation: false
# privileged: false
# readOnlyRootFilesystem: true
Expand All @@ -122,7 +124,6 @@ securityContext: {}
## Ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config
dnsConfig: {}


## @section Reliability configuration
##

Expand Down Expand Up @@ -194,7 +195,8 @@ startupProbe:

## @param resources Resource configurations
##
resources: {}
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
Expand All @@ -208,7 +210,8 @@ resources: {}

## @param strategy Resource configurations
##
strategy: {}
strategy:
{}
# type: RollingUpdate
# rollingUpdate:
# maxSurge: 1
Expand All @@ -224,13 +227,13 @@ podDisruptionBudget:
## @param podDisruptionBudget.maxUnavailable Maximum number/percentage of pods that may be made unavailable
maxUnavailable: null


## @section Persistent data configuration
##

## @param data Data directory configuration, refer to values.yaml for parameters.
##
data: {}
data:
{}
# name: "vaultwarden-data"
# size: "15Gi"
# class: ""
Expand All @@ -241,7 +244,8 @@ data: {}
## @param attachments Attachments directory configuration, refer to values.yaml for parameters.
## By default, attachments/ is located inside the data directory.
##
attachments: {}
attachments:
{}
# name: "vaultwarden-files"
# size: "100Gi"
# class: ""
Expand Down Expand Up @@ -296,7 +300,6 @@ database:
## Supported since 1.29.0.
## Refer to https://github.com/dani-garcia/vaultwarden/wiki/Enabling-Mobile-Client-push-notification for details
##

pushNotifications:
## @param pushNotifications.enabled Enable the push notification service
##
Expand Down Expand Up @@ -451,7 +454,6 @@ emailChangeAllowed: "true"
##
showPassHint: "false"


## @section Advanced settings
##

Expand Down Expand Up @@ -529,14 +531,12 @@ adminRateLimitMaxBurst: "3"
##
timeZone: ""


## @section BETA Features
##

## @param orgGroupsEnabled Controls whether group support is enabled for organizations
orgGroupsEnabled: "false"


## @section MFA/2FA settings
##

Expand Down Expand Up @@ -564,7 +564,6 @@ duo:
##
hostname: ""


## @section SMTP Configuration
##
smtp:
Expand Down Expand Up @@ -628,7 +627,6 @@ smtp:
##
debug: false


## @section Exposure settings
##

Expand Down Expand Up @@ -667,7 +665,7 @@ ingress:
#
class: "nginx"
## @param ingress.nginxIngressAnnotations Add nginx specific ingress annotations
## This annotations are only makes sense for the kubernetes nginx ingress controller (https://kubernetes.github.io/ingress-nginx/)
## These annotations only make sense for the kubernetes nginx ingress controller (https://kubernetes.github.io/ingress-nginx/)
##
nginxIngressAnnotations: true
## @param ingress.additionalAnnotations Additional annotations for the ingress resource.
Expand Down Expand Up @@ -698,6 +696,10 @@ ingress:
## @param ingress.nginxAllowList Comma-separated list of IP addresses and subnets to allow.
##
nginxAllowList: ""
## @param ingress.customHeadersConfigMap ConfigMap containing custom headers to be added to the ingress.
## Defaults to "custom-headers-configmap", which sets a Request-ID header.
##
customHeadersConfigMap: "custom-headers-configmap"
## TODO:
## - Add support for using cert-manager.
## - Support for multiple TLS hostnames.
Expand Down

0 comments on commit 6c1cf6a

Please sign in to comment.