Skip to content

Commit c0c15f8

Browse files
authored
Optional nodePort selection for the service (#118)
* Optional nodePort selection * bump minor version of chart * better naming * fix bumping minor version of chart
1 parent 38cad94 commit c0c15f8

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 6.3.1
2+
version: 6.4.0
33
apiVersion: v2
44
appVersion: 7.3.0
55
home: https://oauth2-proxy.github.io/oauth2-proxy/

helm/oauth2-proxy/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ Parameter | Description | Default
159159
`service.clusterIP` | cluster ip address | `nil`
160160
`service.loadBalancerIP` | ip of load balancer | `nil`
161161
`service.loadBalancerSourceRanges` | allowed source ranges in load balancer | `nil`
162+
`service.nodePort` | external port number for the service when service.type is `NodePort` | `nil`
162163
`serviceAccount.enabled` | create a service account | `true`
163164
`serviceAccount.name` | the service account name | ``
164165
`serviceAccount.annotations` | (optional) annotations for the service account | `{}`
@@ -180,6 +181,7 @@ Parameter | Description | Default
180181
`checkDeprecation` | Enable deprecation checks | `true`
181182
`metrics.enabled` | Enable Prometheus metrics endpoint | `true`
182183
`metrics.port` | Serve Prometheus metrics on this port | `44180`
184+
`metrics.nodePort` | External port for the metrics when service.type is `NodePort` | `nil`
183185
`metrics.servicemonitor.enabled` | Enable Prometheus Operator ServiceMonitor | `false`
184186
`metrics.servicemonitor.namespace` | Define the namespace where to deploy the ServiceMonitor resource | `""`
185187
`metrics.servicemonitor.prometheusInstance` | Prometheus Instance definition | `default`

helm/oauth2-proxy/templates/service.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,18 @@ spec:
3030
ports:
3131
- port: {{ .Values.service.portNumber }}
3232
targetPort: {{ .Values.httpScheme }}
33+
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
34+
nodePort: {{ .Values.service.nodePort }}
35+
{{- end }}
3336
protocol: TCP
3437
name: {{ .Values.httpScheme }}
3538
{{- if and .Values.metrics.enabled .Values.metrics.port }}
3639
- port: {{ .Values.metrics.port }}
3740
protocol: TCP
3841
targetPort: metrics
42+
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.metrics.nodePort))) }}
43+
nodePort: {{ .Values.metrics.nodePort }}
44+
{{- end }}
3945
name: metrics
4046
{{- end }}
4147
selector:

helm/oauth2-proxy/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ service:
104104
# when service.type is LoadBalancer ...
105105
# loadBalancerIP: 198.51.100.40
106106
# loadBalancerSourceRanges: 203.0.113.0/24
107+
# when service.type is NodePort ...
108+
# nodePort: 80
107109
portNumber: 80
108110
annotations: {}
109111
# foo.io/bar: "true"
@@ -283,6 +285,8 @@ metrics:
283285
enabled: true
284286
# Serve Prometheus metrics on this port
285287
port: 44180
288+
# when service.type is NodePort ...
289+
# nodePort: 44180
286290
servicemonitor:
287291
# Enable Prometheus Operator ServiceMonitor
288292
enabled: false

0 commit comments

Comments
 (0)