Skip to content

Commit

Permalink
fix: connection urls to be automatically comma separated
Browse files Browse the repository at this point in the history
  • Loading branch information
tuunit committed Nov 28, 2024
1 parent 49c2289 commit 0a6c1a0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
6 changes: 3 additions & 3 deletions helm/oauth2-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: oauth2-proxy
version: 7.8.0
version: 7.8.1
apiVersion: v2
appVersion: 7.7.1
home: https://oauth2-proxy.github.io/oauth2-proxy/
Expand Down Expand Up @@ -35,7 +35,7 @@ kubeVersion: ">=1.16.0-0"
annotations:
artifacthub.io/changes: |
- kind: added
description: allow templates in annotations
description: automatically concatenate connectionUrls with comma
links:
- name: Github PR
url: https://github.com/oauth2-proxy/manifests/pull/256
url: https://github.com/oauth2-proxy/manifests/pull/268
18 changes: 18 additions & 0 deletions helm/oauth2-proxy/ci/redis-sentinel-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sessionStorage:
type: redis
redis:
clientType: sentinel
sentinel:
password: "foo"
connectionUrls:
- "redis://oauth2-proxy-redis.svc:6379"
redis:
# provision an instance of the redis sub-chart
enabled: true
architecture: replicate
global:
redis:
password: "foo"
initContainers:
waitForRedis:
enabled: true
8 changes: 4 additions & 4 deletions helm/oauth2-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ spec:
- name: OAUTH2_PROXY_REDIS_USE_CLUSTER
value: "true"
- name: OAUTH2_PROXY_REDIS_CLUSTER_CONNECTION_URLS
value: {{ .Values.sessionStorage.redis.cluster.connectionUrls }}
value: {{ join "," .Values.sessionStorage.redis.cluster.connectionUrls }}
{{- else if eq (default "" .Values.sessionStorage.redis.clientType) "sentinel" }}
- name: OAUTH2_PROXY_REDIS_USE_SENTINEL
value: "true"
- name: OAUTH2_PROXY_REDIS_SENTINEL_CONNECTION_URLS
value: {{ .Values.sessionStorage.redis.sentinel.connectionUrls }}
value: {{ join "," .Values.sessionStorage.redis.sentinel.connectionUrls }}
{{- end }}
{{- if .Values.initContainers.waitForRedis.securityContext.enabled }}
{{- $securityContext := unset .Values.initContainers.waitForRedis.securityContext "enabled" }}
Expand Down Expand Up @@ -213,14 +213,14 @@ spec:
- name: OAUTH2_PROXY_REDIS_USE_CLUSTER
value: "true"
- name: OAUTH2_PROXY_REDIS_CLUSTER_CONNECTION_URLS
value: {{ .Values.sessionStorage.redis.cluster.connectionUrls }}
value: {{ join "," .Values.sessionStorage.redis.cluster.connectionUrls }}
{{- else if eq (default "" .Values.sessionStorage.redis.clientType) "sentinel" }}
- name: OAUTH2_PROXY_REDIS_USE_SENTINEL
value: "true"
- name: OAUTH2_PROXY_REDIS_SENTINEL_MASTER_NAME
value: {{ .Values.sessionStorage.redis.sentinel.masterName }}
- name: OAUTH2_PROXY_REDIS_SENTINEL_CONNECTION_URLS
value: {{ .Values.sessionStorage.redis.sentinel.connectionUrls }}
value: {{ join "," .Values.sessionStorage.redis.sentinel.connectionUrls }}
{{- if or .Values.sessionStorage.redis.sentinel.existingSecret .Values.sessionStorage.redis.existingSecret .Values.sessionStorage.redis.sentinel.password }}
- name: OAUTH2_PROXY_REDIS_SENTINEL_PASSWORD
valueFrom:
Expand Down
8 changes: 6 additions & 2 deletions helm/oauth2-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,10 @@ sessionStorage:
# URL of redis standalone server for redis session storage (e.g. `redis://HOST[:PORT]`). Automatically generated if not set
connectionUrl: ""
cluster:
# List of Redis cluster connection URLs (e.g. `["redis://127.0.0.1:8000", "redis://127.0.0.1:8000"]`)
# List of Redis cluster connection URLs. Array or single string allowed.
connectionUrls: []
# - "redis://127.0.0.1:8000"
# - "redis://127.0.0.1:8001"
sentinel:
# Name of the Kubernetes secret containing the redis sentinel password value (see also `sessionStorage.redis.sentinel.passwordKey`). Default: `sessionStorage.redis.existingSecret`
existingSecret: ""
Expand All @@ -380,8 +382,10 @@ sessionStorage:
passwordKey: "redis-sentinel-password"
# Redis sentinel master name
masterName: ""
# List of Redis sentinel connection URLs (e.g. `["redis://127.0.0.1:8000", "redis://127.0.0.1:8000"]`)
# List of Redis cluster connection URLs. Array or single string allowed.
connectionUrls: []
# - "redis://127.0.0.1:8000"
# - "redis://127.0.0.1:8001"

# Enables and configure the automatic deployment of the redis subchart
redis:
Expand Down

0 comments on commit 0a6c1a0

Please sign in to comment.