Skip to content

Commit

Permalink
Merge pull request #270 from truvity/main
Browse files Browse the repository at this point in the history
feat: add possibility to route requests to sidecar container
  • Loading branch information
pierluigilenoci authored Dec 30, 2024
2 parents a405fbc + 01147b8 commit 76e6b86
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions helm/oauth2-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: oauth2-proxy
version: 7.8.3
version: 7.9.0
apiVersion: v2
appVersion: 7.7.1
home: https://oauth2-proxy.github.io/oauth2-proxy/
Expand Down Expand Up @@ -35,7 +35,7 @@ kubeVersion: ">=1.16.0-0"
annotations:
artifacthub.io/changes: |
- kind: added
description: allow templates in annotations
description: allow requests to be directed to sidecar first
links:
- name: Github PR
url: https://github.com/oauth2-proxy/manifests/pull/256
url: https://github.com/oauth2-proxy/manifests/pull/270
4 changes: 4 additions & 0 deletions helm/oauth2-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart
| `service.loadBalancerIP` | ip of load balancer | `nil` |
| `service.loadBalancerSourceRanges` | allowed source ranges in load balancer | `nil` |
| `service.nodePort` | external port number for the service when service.type is `NodePort` | `nil` |
| `service.targetPort` | (optional) a numeric port number (e.g., 80) or a port name defined in the pod's container(s) (e.g., http) | `""`
| `serviceAccount.enabled` | create a service account | `true` |
| `serviceAccount.name` | the service account name | `` |
| `serviceAccount.annotations` | (optional) annotations for the service account | `{}` |
Expand Down Expand Up @@ -357,3 +358,6 @@ config:
whitelist_domains = [ ".domain.com", ".example.io"]
provider = "google"
```
## Route requests to sidecar container
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.
2 changes: 1 addition & 1 deletion helm/oauth2-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
{{- end }}
ports:
- port: {{ .Values.service.portNumber }}
targetPort: {{ .Values.httpScheme }}
targetPort: {{ .Values.service.targetPort | default .Values.httpScheme }}
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions helm/oauth2-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ service:
externalTrafficPolicy: ""
# configure internalTrafficPolicy
internalTrafficPolicy: ""
# configure service target port
targetPort: ""

## Create or use ServiceAccount
serviceAccount:
Expand Down

0 comments on commit 76e6b86

Please sign in to comment.