From bd46cc489e1e39e489e6ce08c3b5c4baba4c37b7 Mon Sep 17 00:00:00 2001 From: Yitaek Hwang Date: Fri, 28 Jun 2019 00:29:19 -0400 Subject: [PATCH] [stable/redis] Allow slave pods to connect to master when networkPolicy is enabled (#15082) * Adding network policy label for slave pods Signed-off-by: YITAEK HWANG * [stable/redis] fixing ordering of if statements in networkpolicy Signed-off-by: YITAEK HWANG --- stable/redis/Chart.yaml | 2 +- stable/redis/templates/networkpolicy.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/stable/redis/Chart.yaml b/stable/redis/Chart.yaml index 0fe766f204..2ac0e68492 100644 --- a/stable/redis/Chart.yaml +++ b/stable/redis/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: redis -version: 8.0.12 +version: 8.0.13 appVersion: 5.0.5 description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. keywords: diff --git a/stable/redis/templates/networkpolicy.yaml b/stable/redis/templates/networkpolicy.yaml index a77af3d51f..560c21a57d 100644 --- a/stable/redis/templates/networkpolicy.yaml +++ b/stable/redis/templates/networkpolicy.yaml @@ -32,6 +32,13 @@ spec: role: metrics app: {{ template "redis.name" . }} {{- end }} + {{- if ge .Values.cluster.slaveCount 1.0 }} + - podSelector: + matchLabels: + release: "{{ .Release.Name }}" + role: slave + app: {{ template "redis.name" . }} + {{- end }} {{- end }} {{- if .Values.metrics.enabled }} # Allow prometheus scrapes for metrics