Skip to content

Commit b6f4156

Browse files
committed
Added better support for LoadBalancer service
1 parent c1e8e27 commit b6f4156

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ However, keep in mind that the persitant volumes of the mongodb container don't
119119
| `image.repository` | OPC-Router image registry. | `opcrouter/service` |
120120
| `image.tag` | OPC-Router image tag (immutable tags are recommended). | `""` |
121121
| `image.pullPolicy` | OPC-Router image pull policy. | `IfNotPresent` |
122-
| `envVars` | Array of environment variables for the opc router container. | `[]]` |
122+
| `envVars` | Array of environment variables for the opc router container. | `[]` |
123123
| `serviceAccount.create` | Specifies whether a service account should be created. | `true` |
124124
| `serviceAccount.annotations` | Annotations to add to the service account. | `{}` |
125125
| `serviceAccount.name` | Name of the service account to use. If not set and create is true, it is generated using the fullname. | `""` |
@@ -142,6 +142,8 @@ However, keep in mind that the persitant volumes of the mongodb container don't
142142
| `service.type` | Type of the service. Possible values: ClusterIP, NodePort, LoadBalancer. | `ClusterIP` |
143143
| `service.port` | Internal port. The service will be reachable under this port inside the cluster. | `27017` |
144144
| `service.nodePort` | External port. When NodePort, this port will allow external access to the service. | `""` |
145+
| `service.externalIPs` | External IPs. Reachable under these IPs, when traffic ingresses into cluster with IPs as destination. | `[]` |
146+
| `service.loadBalancerIP` | LoadBalancer IP. Used by some cloud providers to add external load balancers. | `""` |
145147

146148
## **WARNING: MongoDB root password and replica key set**
147149

charts/opc-router/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.1
18+
version: 0.1.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/opc-router/templates/service.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ spec:
1515
targetPort: mongodb
1616
protocol: TCP
1717
name: mongodb
18+
{{- with .Values.service.externalIPs }}
19+
externalIPs:
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
{{- with .Values.service.loadBalancerIP }}
23+
loadBalancerIP: {{ . }}
24+
{{- end }}
1825
selector:
1926
{{- include "opc-router.selectorLabels" . | nindent 4 }}
2027
{{- end }}

charts/opc-router/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ service:
8383
# When list left blank, NodePort will chose a random port itself.
8484
# nodePort need to be in range 30000 to 32768.
8585
nodePort:
86+
# External IPs. The serice will be reachable under these IPs from outside the cluser,
87+
# when traffic ingresses into the cluster with the IPs as destination.
88+
externalIPs: []
89+
# LoadBalancer IP. Only used when LoadBalancer.
90+
# Used by some cloud providers to add external load balancers.
91+
# If not supported, it is just ignored.
92+
loadBalancerIP:
8693

8794
ingress:
8895
enabled: false

0 commit comments

Comments
 (0)