From 9c51832aedac035164a9c8cfabcccb0eeda323a8 Mon Sep 17 00:00:00 2001 From: Sergey Prokhorov Date: Wed, 20 Nov 2019 15:25:21 +0100 Subject: [PATCH] [incubator/kafka] Add loadBalancerSourceRanges option (#18551) * Add loadBalancerSourceRanges option to Load Balancer spec Signed-off-by: Sergey Prokhorov * bump chart version Signed-off-by: Sergey Prokhorov * chart version bump Signed-off-by: Sergey Prokhorov * bump chart version Signed-off-by: Sergey Prokhorov --- incubator/kafka/Chart.yaml | 2 +- incubator/kafka/README.md | 1 + incubator/kafka/templates/service-brokers-external.yaml | 6 ++++++ incubator/kafka/values.yaml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index 6ba3f0f11f..d2a6449263 100755 --- a/incubator/kafka/Chart.yaml +++ b/incubator/kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Apache Kafka is publish-subscribe messaging rethought as a distributed commit log. name: kafka -version: 0.20.3 +version: 0.20.4 appVersion: 5.0.1 keywords: - kafka diff --git a/incubator/kafka/README.md b/incubator/kafka/README.md index 218e2eb7d7..b63cb50579 100644 --- a/incubator/kafka/README.md +++ b/incubator/kafka/README.md @@ -83,6 +83,7 @@ following configurable parameters: | `external.distinct` | Distinct DNS entries for each created A record. | `false` | | `external.annotations` | Additional annotations for the external service. | `{}` | | `external.loadBalancerIP` | Add Static IP to the type Load Balancer. Depends on the provider if enabled | `[]` +| `external.loadBalancerSourceRanges` | Add IP ranges that are allowed to access the Load Balancer. | `[]` | `podAnnotations` | Annotation to be added to Kafka pods | `{}` | | `podLabels` | Labels to be added to Kafka pods | `{}` | | `podDisruptionBudget` | Define a Disruption Budget for the Kafka Pods | `{}` | diff --git a/incubator/kafka/templates/service-brokers-external.yaml b/incubator/kafka/templates/service-brokers-external.yaml index 49f6928fe3..3d35a8e3ff 100644 --- a/incubator/kafka/templates/service-brokers-external.yaml +++ b/incubator/kafka/templates/service-brokers-external.yaml @@ -61,6 +61,12 @@ spec: {{- if and (eq $root.Values.external.type "LoadBalancer") (eq $loadBalancerIPLen $replicas) }} loadBalancerIP: {{ index $root.Values.external.loadBalancerIP $i }} {{- end }} + {{- if $root.Values.external.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $root.Values.external.loadBalancerSourceRanges }} + - {{ . | quote}} + {{- end }} + {{- end }} selector: {{- include "kafka.broker.matchLabels" $root | nindent 4 }} statefulset.kubernetes.io/pod-name: {{ $responsiblePod | quote }} diff --git a/incubator/kafka/values.yaml b/incubator/kafka/values.yaml index 314ea51e3c..f0d20b11cb 100644 --- a/incubator/kafka/values.yaml +++ b/incubator/kafka/values.yaml @@ -153,6 +153,7 @@ external: firstListenerPort: 31090 domain: cluster.local loadBalancerIP: [] + loadBalancerSourceRanges: [] init: image: "lwolf/kubectl_deployer" imageTag: "0.4"