Skip to content

Commit 76e6b86

Browse files
Merge pull request #270 from truvity/main
feat: add possibility to route requests to sidecar container
2 parents a405fbc + 01147b8 commit 76e6b86

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 7.8.3
2+
version: 7.9.0
33
apiVersion: v2
44
appVersion: 7.7.1
55
home: https://oauth2-proxy.github.io/oauth2-proxy/
@@ -35,7 +35,7 @@ kubeVersion: ">=1.16.0-0"
3535
annotations:
3636
artifacthub.io/changes: |
3737
- kind: added
38-
description: allow templates in annotations
38+
description: allow requests to be directed to sidecar first
3939
links:
4040
- name: Github PR
41-
url: https://github.com/oauth2-proxy/manifests/pull/256
41+
url: https://github.com/oauth2-proxy/manifests/pull/270

helm/oauth2-proxy/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart
196196
| `service.loadBalancerIP` | ip of load balancer | `nil` |
197197
| `service.loadBalancerSourceRanges` | allowed source ranges in load balancer | `nil` |
198198
| `service.nodePort` | external port number for the service when service.type is `NodePort` | `nil` |
199+
| `service.targetPort` | (optional) a numeric port number (e.g., 80) or a port name defined in the pod's container(s) (e.g., http) | `""`
199200
| `serviceAccount.enabled` | create a service account | `true` |
200201
| `serviceAccount.name` | the service account name | `` |
201202
| `serviceAccount.annotations` | (optional) annotations for the service account | `{}` |
@@ -357,3 +358,6 @@ config:
357358
whitelist_domains = [ ".domain.com", ".example.io"]
358359
provider = "google"
359360
```
361+
362+
## Route requests to sidecar container
363+
You can route requests to a sidecar container first by setting the `service.targetPort` variable. The possible values for the targetPort field of a Kubernetes Service can be either a port number or the name of a port defined in the pod. By default, the service's `targetPort` value equals to `httpSchema`'s.

helm/oauth2-proxy/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
{{- end }}
3737
ports:
3838
- port: {{ .Values.service.portNumber }}
39-
targetPort: {{ .Values.httpScheme }}
39+
targetPort: {{ .Values.service.targetPort | default .Values.httpScheme }}
4040
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
4141
nodePort: {{ .Values.service.nodePort }}
4242
{{- end }}

helm/oauth2-proxy/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ service:
153153
externalTrafficPolicy: ""
154154
# configure internalTrafficPolicy
155155
internalTrafficPolicy: ""
156+
# configure service target port
157+
targetPort: ""
156158

157159
## Create or use ServiceAccount
158160
serviceAccount:

0 commit comments

Comments
 (0)