Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add possibility to route requests to sidecar container #270

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please 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` | name for the service's `targetPort` | `""`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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; by default, the service's `targetPort` value equals to the `httpSchema`'s.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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
3 changes: 3 additions & 0 deletions helm/oauth2-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ service:
externalTrafficPolicy: ""
# configure internalTrafficPolicy
internalTrafficPolicy: ""
# configure service target port
# useful when there's need to route requests to sidecar containers first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this comment.

targetPort: ""

## Create or use ServiceAccount
serviceAccount:
Expand Down
Loading