Skip to content

Commit

Permalink
[stable/redis-ha]: Allow DNS requests to local network (#289)
Browse files Browse the repository at this point in the history
* [stable/redis-ha]: Allow DNS requests to local network

- In some situations (GKE cluster with [Cloud DNS](https://cloud.google.com/kubernetes-engine/docs/how-to/cloud-dns#architecture)), the DNS server is configured on the local network IP range
  (169.254.0.0/16), so we should allow this CIDR in the default network policy.

Signed-off-by: Laurent Lavaud <[email protected]>

* set in default values

---------

Signed-off-by: Laurent Lavaud <[email protected]>
  • Loading branch information
llavaud authored Sep 27, 2024
1 parent 4d03a7e commit 2c336fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/redis-ha/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords:
- redis
- keyvalue
- database
version: 4.27.6
version: 4.27.7
appVersion: 7.2.4
description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management
icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png
Expand Down
7 changes: 0 additions & 7 deletions charts/redis-ha/templates/redis-ha-network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ spec:
protocol: TCP
- port: {{ .Values.sentinel.port }}
protocol: TCP
- to:
- namespaceSelector: {}
ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
{{- range $rule := .Values.networkPolicy.egressRules }}
- to:
{{ (tpl (toYaml $rule.selectors) $) | indent 7 }}
Expand Down
15 changes: 14 additions & 1 deletion charts/redis-ha/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,20 @@ networkPolicy:
# protocol: TCP

## user can define egress rules too, uses the same structure as ingressRules
egressRules: []
egressRules:
- selectors:
# allow all destinations for DNS traffic
- namespaceSelector: {}
- ipBlock:
# Cloud Provider often uses the local link local range to host managed DNS resolvers.
# We need to allow this range to ensure that the Redis pods can resolve DNS.
# Example architecture for GCP Cloud DNS: https://cloud.google.com/kubernetes-engine/docs/how-to/cloud-dns#architecture
cidr: 169.254.0.0/16
ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP

splitBrainDetection:
interval: 60
Expand Down

0 comments on commit 2c336fa

Please sign in to comment.