oauth2-proxy / manifests

For hosting manifests to allow for the deployment of OAuth2-Proxy/OAuth2-Proxy
Apache License 2.0
170 stars 153 forks source link

Default service port not aligned to deployment port #129

Closed npapapietro closed 1 year ago

npapapietro commented 1 year ago

Been trying to install this chart with default values except for required inputs (OIDC info). One thing that I've noticed is in the deployment you have the default bind to port 4180 https://github.com/oauth2-proxy/manifests/blob/main/helm/oauth2-proxy/templates/deployment.yaml#L64 and expose it https://github.com/oauth2-proxy/manifests/blob/main/helm/oauth2-proxy/templates/deployment.yaml#L187 but the service defaulted to port 80 https://github.com/oauth2-proxy/manifests/blob/main/helm/oauth2-proxy/values.yaml#L116

I've had to set it with

service:
  portNumber: 4180
pierluigilenoci commented 1 year ago

The port of the container (targetPort) and the port on which the same is exposed within the cluster (port) are two different things. Ref: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service

nodePort is used only when you use a NodePort service. https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport OAuth2 Proxy use ClusterIP type. https://github.com/oauth2-proxy/manifests/blob/main/helm/oauth2-proxy/values.yaml#L109

The service is exposed according to this: https://github.com/oauth2-proxy/manifests/blob/main/helm/oauth2-proxy/values.yaml#L119

I suggest you take a look at how the service manifest is configured here: https://github.com/oauth2-proxy/manifests/blob/main/helm/oauth2-proxy/templates/service.yaml#L30-L40