-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bitnami/redis] feat: Add external access service for redis sentinel (#…
…32190) * Readme: add new values description Signed-off-by: Benjamin Leveque <[email protected]> * values: add new variable for redis externalAccess Signed-off-by: Benjamin Leveque <[email protected]> * svc-external: new service to allow external access Signed-off-by: Benjamin Leveque <[email protected]> * redis: add config for using external IP Signed-off-by: Benjamin Leveque <[email protected]> * svc-external: fix wrong values path Signed-off-by: Benjamin Leveque <[email protected]> * readme: fix replica not sentinel Signed-off-by: Benjamin Leveque <[email protected]> * Chart: bump minor version for new feature Signed-off-by: Benjamin Leveque <[email protected]> * readme: update using readme-generator tool Signed-off-by: Benjamin Leveque <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <[email protected]> * chat: bump version to follow new release Signed-off-by: Benjamin Leveque <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <[email protected]> * fix(redis): update label inclusion to use commonLabels instead of sentinel.commonLabels Signed-off-by: Benjamin Leveque <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <[email protected]> Signed-off-by: Benjamin Leveque <[email protected]> * svc-external : update typo Signed-off-by: Benjamin Leveque <[email protected]> * readme: fix readme typo sentinelport svc-external Signed-off-by: Benjamin Leveque <[email protected]> --------- Signed-off-by: Benjamin Leveque <[email protected]> Signed-off-by: Bitnami Containers <[email protected]> Signed-off-by: unkls ben <[email protected]> Signed-off-by: David Gomez <[email protected]> Co-authored-by: Bitnami Containers <[email protected]> Co-authored-by: David Gomez <[email protected]>
- Loading branch information
1 parent
8dcc47c
commit 0582ac3
Showing
8 changed files
with
200 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{{- /* | ||
Copyright Broadcom, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: APACHE-2.0 | ||
*/}} | ||
|
||
{{- if .Values.sentinel.externalAccess.enabled }} | ||
{{- $fullName := include "common.names.fullname" . }} | ||
{{- $nodesCount := .Values.replica.replicaCount | int }} | ||
{{- $root := . }} | ||
|
||
{{- range $i, $e := until $nodesCount }} | ||
{{- $targetPod := printf "%s-%d" (printf "%s-node" $fullName) $i }} | ||
{{- $_ := set $ "targetPod" $targetPod }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "common.names.fullname" $ }}-{{ $i }}-svc | ||
namespace: {{ include "common.names.namespace" $ | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" $root.Values.commonLabels "context" $ ) | nindent 4 }} | ||
pod: {{ $targetPod }} | ||
{{- if or | ||
(ne $root.Values.sentinel.externalAccess.service.loadBalancerIPAnnotaion "") }} | ||
{{- $loadBalancerIPAnnotaion := "" }} | ||
{{- if ne $root.Values.sentinel.externalAccess.service.loadBalancerIPAnnotaion ""}} | ||
{{- $loadBalancerIPAnnotaion = printf | ||
"%s: %s" | ||
$root.Values.sentinel.externalAccess.service.loadBalancerIPAnnotaion | ||
(index $root.Values.sentinel.externalAccess.service.loadBalancerIP $i) }} | ||
{{- end }} | ||
{{- $annotations := include "common.tplvalues.merge" | ||
( dict "values" | ||
( list | ||
$root.Values.sentinel.externalAccess.service.annotations | ||
$root.Values.sentinel.commonAnnotations | ||
$loadBalancerIPAnnotaion | ||
) "context" $ ) }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: {{ $root.Values.sentinel.externalAccess.service.type }} | ||
{{- if and | ||
($root.Values.sentinel.externalAccess.service.loadBalancerIP) | ||
(eq $root.Values.sentinel.externalAccess.service.loadBalancerIPAnnotaion "") | ||
(not $root.Values.sentinel.externalAccess.service.disableLoadBalancerIP) }} | ||
loadBalancerIP: {{ index $root.Values.sentinel.externalAccess.service.loadBalancerIP $i }} | ||
{{- end }} | ||
{{- if and (eq $root.Values.sentinel.externalAccess.service.type "LoadBalancer") $root.Values.sentinel.externalAccess.service.loadBalancerClass }} | ||
loadBalancerClass: {{ $root.Values.sentinel.externalAccess.service.loadBalancerClass }} | ||
{{- end }} | ||
{{- if and (eq $root.Values.sentinel.externalAccess.service.type "LoadBalancer") $root.Values.sentinel.externalAccess.service.loadBalancerSourceRanges }} | ||
loadBalancerSourceRanges: {{- toYaml $root.Values.sentinel.externalAccess.service.loadBalancerSourceRanges | nindent 4 }} | ||
{{- end }} | ||
ports: | ||
- name: tcp-redis | ||
port: {{ $root.Values.sentinel.externalAccess.service.redisPort }} | ||
protocol: TCP | ||
targetPort: 6379 | ||
- name: tcp-sentinel | ||
port: {{ $root.Values.sentinel.externalAccess.service.sentinelPort }} | ||
protocol: TCP | ||
targetPort: 26379 | ||
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list $root.Values.sentinel.commonLabels ) "context" $ ) }} | ||
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} | ||
statefulset.kubernetes.io/pod-name: {{ $targetPod }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters