From 0a6c1a0774d81721e6549fc757bafc4a5e38d3a7 Mon Sep 17 00:00:00 2001 From: Jan Larwig Date: Wed, 27 Nov 2024 18:51:53 +0100 Subject: [PATCH] fix: connection urls to be automatically comma separated --- helm/oauth2-proxy/Chart.yaml | 6 +++--- .../oauth2-proxy/ci/redis-sentinel-values.yaml | 18 ++++++++++++++++++ helm/oauth2-proxy/templates/deployment.yaml | 8 ++++---- helm/oauth2-proxy/values.yaml | 8 ++++++-- 4 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 helm/oauth2-proxy/ci/redis-sentinel-values.yaml diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index fe850f0..9fd60fd 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -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/ @@ -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 diff --git a/helm/oauth2-proxy/ci/redis-sentinel-values.yaml b/helm/oauth2-proxy/ci/redis-sentinel-values.yaml new file mode 100644 index 0000000..9bce78a --- /dev/null +++ b/helm/oauth2-proxy/ci/redis-sentinel-values.yaml @@ -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 diff --git a/helm/oauth2-proxy/templates/deployment.yaml b/helm/oauth2-proxy/templates/deployment.yaml index 8ed2f70..89b2f35 100644 --- a/helm/oauth2-proxy/templates/deployment.yaml +++ b/helm/oauth2-proxy/templates/deployment.yaml @@ -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" }} @@ -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: diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index c9ef103..b32b2c3 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -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: "" @@ -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: