oauth2-proxy-ingress

by itsmethemojo

Helm chartv1.1.0Apache-2.0Verified publisher

helm chart to create multiple ingresses to use with a single oauth2-proxy

About this chart

oauth2-proxy-ingress

helm chart to create multiple ingresses to use with a single oauth2-proxy

Configuring dex and oauth2-proxy

create a static client with multiple redirectURIs with the dex helm chart

config:
  staticClients:
    - id: oauth2-proxy
      redirectURIs:
        - 'https://subdomain1.example.com/oauth2/callback'
        - 'https://subdomain1.example.com/oauth2/callback'
      name: 'Login for everything'
      secret: XXXXXXXXXXXXXXXXX

then use rewriting in mutliple upstreams with the oauth2-proxy helm chart

ingress:
  enabled: false
config:
  configFile: {}
alphaConfig:
  enabled: true
  configData:
    providers:
      - provider: oidc
        id: dex
        clientID: oauth2-proxy
        clientSecret: XXXXXXXXXXXXXXXXX
        scope: openid email profile
        oidcConfig:
            userIDClaim: email
            emailClaim: email
            issuerURL: https://dex.example.com
            audienceClaims:
            - aud
            - email
    upstreamConfig:
        upstreams:
        - id: subdomain1
            path: '^/subdomain1/(.*)'
            rewriteTarget: '/$1'
            uri: http://service1.namespace1
        - id: subdomain2
            path: '^/subdomain2/(.*)'
            rewriteTarget: '/$1'
            uri: http://service2.namespace2

update docs

docker run --rm -v $(pwd):/app -w/app jnorwood/helm-docs -t helm-docs-template.gotmpl

additional links

Source Code

Values

KeyTypeDefaultDescription
annotationsobject{}additional ingress annotations
autoCreateTlsbooltruethis will create a default tls block for the ingress
domainBasestring"example.com"domain base all the subdomains share
externalDnsEnabledboolfalsethis will add the external-dns.alpha.kubernetes.io/hostname annotation
fullnameOverridestring""
ingressClassNamestring"nginx"
nameOverridestring""
oauth2proxy.service.namestring"oauth2-proxy"service name of the installed oauth2-proxy. ingress must be installed in the same namespace
oauth2proxy.service.portint80port of the installed oauth2-proxy
subdomainslist["subdomain1","subdomain2"]list of subdomains that will be hidden behind the oauth2-proxy
tlsobject{}if needed a custom tls block for every subdomain can bet set here, see values.yaml

Autogenerated from chart metadata using helm-docs v1.11.0

Deploy oauth2-proxy-ingress with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has oauth2-proxy-ingress on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartoauth2-proxy-ingress is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply