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

Pass oauth2-proxy config through helm templating #132

Closed jkroepke closed 1 year ago

jkroepke commented 1 year ago

This PR enabled passing configuration through the helm templating engine again.

Use cases: We have a umbrella helm charts which bundles all helm charts together in one release. Using the pattern, we are able to establish a single configuration plane for multiple components.

In this case, we would like to share some configuration between oauth2-proxy and dex idp. For example dexidp and oauth-proxy shares the same issuer config, client id, client secret.

oauth2-proxy also shares some configuration with grafana, e.g. ingress hostname.

The grafana and kube-prometheus-stack already allows use similar configurations.

Giving an example for values files

oauth2-proxy:
  checkDeprecation: false
  config:
    clientSecret: '{{ $.Values.global.features.auth.secrets.proxyClientSecret }}'
    configFile: |
      oidc_issuer_url = "https://{{ $.Values.global.features.auth.hostname }}/dex"
  ingress:
    enabled: ture
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt
    className: nginx
    path: /oauth2/
    pathType: Prefix
    hosts:
      - '{{ $.Values.global.features.grafana.hostname }}'
    tls:
      - secretName: tls-secret-grafana
        hosts:
          - '{{ $.Values.global.features.grafana.hostname }}'
pierluigilenoci commented 1 year ago

@jkroepke I'm sorry if I haven't been kind... I forgot to thank you for your contribution. šŸ˜› So thank you! šŸš€ ā¤ļø

pierluigilenoci commented 1 year ago

@desaintmartin could you please take a look?

jkroepke commented 1 year ago

@desaintmartin Tests added!

I agree about helmfile works better in that scenario, but looking forward to GitOps ArgoCD or flux, helmfile does not fit here anymore.

desaintmartin commented 1 year ago

Hehe, the config file actually needs to be valid for the test to pass.

jkroepke commented 1 year ago

@desaintmartin At least the tests covers only, if the tpl function is working..

tim-jagenberg-piscada commented 1 year ago

This created problems with boolean values: https://github.com/oauth2-proxy/manifests/issues/133

jkroepke commented 1 year ago

I will setup a pr in for fix this