Skip to content

Commit 99eba89

Browse files
committed
chore(redis): optimize bind info
1 parent fe1ef4c commit 99eba89

10 files changed

Lines changed: 190 additions & 110 deletions

File tree

addons/redis/7.0/plans/standard-1024/bind.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ credential:
1919
serviceRef:
2020
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
2121
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+
- name: REDISPORT
24+
valueFrom:
25+
serviceRef:
26+
name: {{ template "common.names.fullname" . }}
27+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
2228
{{- end }}
2329

2430
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
4450
{{- end }}
4551

46-
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47-
- name: REDIS_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: {{ template "common.names.fullname" . }}
51-
jsonpath: '{ .data.redis-password }'
52-
{{- end }}
53-
5452
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553
{{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654
- name: EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169
serviceRef:
7270
name: {{ template "common.names.fullname" . }}
7371
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+
{{- end }}
7473

75-
- name: REDISPORT
74+
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+
- name: REDIS_PASSWORD
7676
valueFrom:
77-
serviceRef:
77+
secretKeyRef:
7878
name: {{ template "common.names.fullname" . }}
79-
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
79+
jsonpath: '{ .data.redis-password }'
80+
{{- end }}
81+
82+
{{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+
- name: REDIS_SENTINEL_PASSWORD
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ template "common.names.fullname" . }}
87+
jsonpath: '{ .data.redis-password }'
8088
{{- end }}

addons/redis/7.0/plans/standard-128/bind.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ credential:
1919
serviceRef:
2020
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
2121
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+
- name: REDISPORT
24+
valueFrom:
25+
serviceRef:
26+
name: {{ template "common.names.fullname" . }}
27+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
2228
{{- end }}
2329

2430
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
4450
{{- end }}
4551

46-
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47-
- name: REDIS_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: {{ template "common.names.fullname" . }}
51-
jsonpath: '{ .data.redis-password }'
52-
{{- end }}
53-
5452
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553
{{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654
- name: EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169
serviceRef:
7270
name: {{ template "common.names.fullname" . }}
7371
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+
{{- end }}
7473

75-
- name: REDISPORT
74+
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+
- name: REDIS_PASSWORD
7676
valueFrom:
77-
serviceRef:
77+
secretKeyRef:
7878
name: {{ template "common.names.fullname" . }}
79-
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
79+
jsonpath: '{ .data.redis-password }'
80+
{{- end }}
81+
82+
{{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+
- name: REDIS_SENTINEL_PASSWORD
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ template "common.names.fullname" . }}
87+
jsonpath: '{ .data.redis-password }'
8088
{{- end }}

addons/redis/7.0/plans/standard-16384/bind.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ credential:
1919
serviceRef:
2020
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
2121
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+
- name: REDISPORT
24+
valueFrom:
25+
serviceRef:
26+
name: {{ template "common.names.fullname" . }}
27+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
2228
{{- end }}
2329

2430
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
4450
{{- end }}
4551

46-
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47-
- name: REDIS_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: {{ template "common.names.fullname" . }}
51-
jsonpath: '{ .data.redis-password }'
52-
{{- end }}
53-
5452
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553
{{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654
- name: EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169
serviceRef:
7270
name: {{ template "common.names.fullname" . }}
7371
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+
{{- end }}
7473

75-
- name: REDISPORT
74+
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+
- name: REDIS_PASSWORD
7676
valueFrom:
77-
serviceRef:
77+
secretKeyRef:
7878
name: {{ template "common.names.fullname" . }}
79-
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
79+
jsonpath: '{ .data.redis-password }'
80+
{{- end }}
81+
82+
{{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+
- name: REDIS_SENTINEL_PASSWORD
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ template "common.names.fullname" . }}
87+
jsonpath: '{ .data.redis-password }'
8088
{{- end }}

addons/redis/7.0/plans/standard-2048/bind.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ credential:
1919
serviceRef:
2020
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
2121
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+
- name: REDISPORT
24+
valueFrom:
25+
serviceRef:
26+
name: {{ template "common.names.fullname" . }}
27+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
2228
{{- end }}
2329

2430
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
4450
{{- end }}
4551

46-
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47-
- name: REDIS_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: {{ template "common.names.fullname" . }}
51-
jsonpath: '{ .data.redis-password }'
52-
{{- end }}
53-
5452
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553
{{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654
- name: EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169
serviceRef:
7270
name: {{ template "common.names.fullname" . }}
7371
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+
{{- end }}
7473

75-
- name: REDISPORT
74+
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+
- name: REDIS_PASSWORD
7676
valueFrom:
77-
serviceRef:
77+
secretKeyRef:
7878
name: {{ template "common.names.fullname" . }}
79-
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
79+
jsonpath: '{ .data.redis-password }'
80+
{{- end }}
81+
82+
{{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+
- name: REDIS_SENTINEL_PASSWORD
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ template "common.names.fullname" . }}
87+
jsonpath: '{ .data.redis-password }'
8088
{{- end }}

addons/redis/7.0/plans/standard-256/bind.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ credential:
1919
serviceRef:
2020
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
2121
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+
- name: REDISPORT
24+
valueFrom:
25+
serviceRef:
26+
name: {{ template "common.names.fullname" . }}
27+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
2228
{{- end }}
2329

2430
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
4450
{{- end }}
4551

46-
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47-
- name: REDIS_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: {{ template "common.names.fullname" . }}
51-
jsonpath: '{ .data.redis-password }'
52-
{{- end }}
53-
5452
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553
{{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654
- name: EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169
serviceRef:
7270
name: {{ template "common.names.fullname" . }}
7371
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+
{{- end }}
7473

75-
- name: REDISPORT
74+
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+
- name: REDIS_PASSWORD
7676
valueFrom:
77-
serviceRef:
77+
secretKeyRef:
7878
name: {{ template "common.names.fullname" . }}
79-
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
79+
jsonpath: '{ .data.redis-password }'
80+
{{- end }}
81+
82+
{{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+
- name: REDIS_SENTINEL_PASSWORD
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ template "common.names.fullname" . }}
87+
jsonpath: '{ .data.redis-password }'
8088
{{- end }}

addons/redis/7.0/plans/standard-32768/bind.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ credential:
1919
serviceRef:
2020
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
2121
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+
- name: REDISPORT
24+
valueFrom:
25+
serviceRef:
26+
name: {{ template "common.names.fullname" . }}
27+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
2228
{{- end }}
2329

2430
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
4450
{{- end }}
4551

46-
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47-
- name: REDIS_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: {{ template "common.names.fullname" . }}
51-
jsonpath: '{ .data.redis-password }'
52-
{{- end }}
53-
5452
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553
{{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654
- name: EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169
serviceRef:
7270
name: {{ template "common.names.fullname" . }}
7371
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+
{{- end }}
7473

75-
- name: REDISPORT
74+
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+
- name: REDIS_PASSWORD
7676
valueFrom:
77-
serviceRef:
77+
secretKeyRef:
7878
name: {{ template "common.names.fullname" . }}
79-
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
79+
jsonpath: '{ .data.redis-password }'
80+
{{- end }}
81+
82+
{{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+
- name: REDIS_SENTINEL_PASSWORD
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ template "common.names.fullname" . }}
87+
jsonpath: '{ .data.redis-password }'
8088
{{- end }}

addons/redis/7.0/plans/standard-4096/bind.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ credential:
1919
serviceRef:
2020
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
2121
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+
- name: REDISPORT
24+
valueFrom:
25+
serviceRef:
26+
name: {{ template "common.names.fullname" . }}
27+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
2228
{{- end }}
2329

2430
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
4450
{{- end }}
4551

46-
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47-
- name: REDIS_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: {{ template "common.names.fullname" . }}
51-
jsonpath: '{ .data.redis-password }'
52-
{{- end }}
53-
5452
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553
{{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654
- name: EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169
serviceRef:
7270
name: {{ template "common.names.fullname" . }}
7371
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+
{{- end }}
7473

75-
- name: REDISPORT
74+
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+
- name: REDIS_PASSWORD
7676
valueFrom:
77-
serviceRef:
77+
secretKeyRef:
7878
name: {{ template "common.names.fullname" . }}
79-
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
79+
jsonpath: '{ .data.redis-password }'
80+
{{- end }}
81+
82+
{{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+
- name: REDIS_SENTINEL_PASSWORD
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ template "common.names.fullname" . }}
87+
jsonpath: '{ .data.redis-password }'
8088
{{- end }}

0 commit comments

Comments
 (0)