From 7619867452edeb7a70b855fbc016bcc5f3ca9af6 Mon Sep 17 00:00:00 2001 From: Peter Moffatt <44172972+peter-moffatt@users.noreply.github.com> Date: Tue, 9 Jul 2019 11:12:01 +0100 Subject: [PATCH] [stable/mongodb] loadBalancerSourceRanges can be specified for mongodb Helm chart (#15324) * loadBalancerSourceRanges can be specified for mongodb Helm chart Signed-off-by: Peter Moffatt * Bump chart version Signed-off-by: Peter Moffatt * Minor change to formatting Signed-off-by: Peter Moffatt --- stable/mongodb/Chart.yaml | 2 +- stable/mongodb/README.md | 1 + stable/mongodb/templates/svc-primary-rs.yaml | 3 +++ stable/mongodb/templates/svc-standalone.yaml | 3 +++ stable/mongodb/values-production.yaml | 5 +++++ stable/mongodb/values.yaml | 5 +++++ 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/stable/mongodb/Chart.yaml b/stable/mongodb/Chart.yaml index d7aa8dea46..60e99a4485 100644 --- a/stable/mongodb/Chart.yaml +++ b/stable/mongodb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: mongodb -version: 6.0.0 +version: 6.1.0 appVersion: 4.0.10 description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. keywords: diff --git a/stable/mongodb/README.md b/stable/mongodb/README.md index c2b39d7e3a..46332c3482 100644 --- a/stable/mongodb/README.md +++ b/stable/mongodb/README.md @@ -73,6 +73,7 @@ The following table lists the configurable parameters of the MongoDB chart and t | `service.nodePort` | Port to bind to for NodePort service type | `nil` | | `service.loadBalancerIP` | Static IP Address to use for LoadBalancer service type | `nil` | | `service.externalIPs` | External IP list to use with ClusterIP service type | `[]` | +| `service.loadBalancerSourceRanges` | List of IP ranges allowed access to load balancer (if supported) | `[]` (does not add IP range restrictions to the service)| | `port` | MongoDB service port | `27017` | | `replicaSet.enabled` | Switch to enable/disable replica set configuration | `false` | | `replicaSet.name` | Name of the replica set | `rs0` | diff --git a/stable/mongodb/templates/svc-primary-rs.yaml b/stable/mongodb/templates/svc-primary-rs.yaml index 556cd22c8b..4d372f793b 100644 --- a/stable/mongodb/templates/svc-primary-rs.yaml +++ b/stable/mongodb/templates/svc-primary-rs.yaml @@ -22,6 +22,9 @@ spec: {{- if .Values.service.externalIPs }} externalIPs: {{ toYaml .Values.service.externalIPs | nindent 4 }} {{- end }} + {{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} + {{- end }} ports: - name: mongodb port: 27017 diff --git a/stable/mongodb/templates/svc-standalone.yaml b/stable/mongodb/templates/svc-standalone.yaml index 1f9e779b65..73a3951f2e 100644 --- a/stable/mongodb/templates/svc-standalone.yaml +++ b/stable/mongodb/templates/svc-standalone.yaml @@ -22,6 +22,9 @@ spec: {{- if .Values.service.externalIPs }} externalIPs: {{ toYaml .Values.service.externalIPs | nindent 4 }} {{- end }} + {{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} + {{- end }} ports: - name: mongodb port: 27017 diff --git a/stable/mongodb/values-production.yaml b/stable/mongodb/values-production.yaml index ef63a3d3d9..b1dec316ee 100644 --- a/stable/mongodb/values-production.yaml +++ b/stable/mongodb/values-production.yaml @@ -108,6 +108,11 @@ service: ## # loadBalancerIP: + ## Specify the loadBalancerSourceRanges value for LoadBalancer service types. + ## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service + ## + # loadBalancerSourceRanges: [] + ## Setting up replication ## ref: https://github.com/bitnami/bitnami-docker-mongodb#setting-up-a-replication # diff --git a/stable/mongodb/values.yaml b/stable/mongodb/values.yaml index c256580608..2a19f31f58 100644 --- a/stable/mongodb/values.yaml +++ b/stable/mongodb/values.yaml @@ -108,6 +108,11 @@ service: ## # loadBalancerIP: + ## Specify the loadBalancerSourceRanges value for LoadBalancer service types. + ## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service + ## + # loadBalancerSourceRanges: [] + ## Setting up replication ## ref: https://github.com/bitnami/bitnami-docker-mongodb#setting-up-a-replication #