dex

by Helm

Helm chartv0.4.2App 0.7.0

OpenID Connect Identity (OIDC) and OAuth 2.0 Provider with Pluggable Connectors

About this chart

Dexidp dex chart

Installing the Chart

helm repo add banzaicloud-stable http://kubernetes-charts.banzaicloud.com/branch/master
helm install --name dex banzaicloud-stable/dex

Configuration

The following table lists configurable parameters of the dex chart and their default values.

ParameterDescriptionDefault
imagedex imagebanzaicloud/dex-shim
imageTagimage tag0.6.0
imagePullPolicyimage pull policyIfNotPresent
replicasnumber of replicas1
postgresql.enableddeploy postgresqltrue
postgresql.postgresqlUsernamepostgresql usernamedex
postgresql.postgresqlPasswordpostgresql passwordfoo
postgresql.postgresqlDatabasepostgresql databasedex_db
cloudsql.enabledcloudsqlfalse
cloudsql.instancecloudsql instance host""
cloudsql.image.repositorycloudsql proxy image repositorygcr.io/cloudsql-docker/gce-proxy
cloudsql.image.tagcloudsql proxy image tag1.11
cloudsql.image.pullPolicycloudsql proxy image pull policyIfNotPresent
ports[0].nameport 0 namehttp
ports[0].containerPortport 0 port5556
posts[0].protocolport 0 protocolTCP
service.typeservice typeClusterIP
service.annotationsservice annotattions{}
certs.tlsNametls secret namedex-web-server-tls
certs.caNameCA secret namedex-web-server-ca
envenvironment variables[]
extraSecretsextra secret files{}
extraVolumesextra pod volumes[]
extraVolumeMountsextra pod volume mounts[]
rbac.createRBAC resources should be createdtrue
serviceAccount.createserviceAccount should be createdtrue
serviceAccount.namename of the ServiceAccount to usedefault
config.issuerissuer urlhttp://127.0.0.1:5556/dex
config.oauth2oauth2 setting{ skipApprovalScreen: false }
config.logger.levellogger leveldebug
config.web.httpdex host and port0.0.0.0:5556
config.storage.typestorage typepostgresql
config.storage.config.databasestorage db{{ postgresql.postgresqlDatabase }}
config.storage.config.userstorage user{{ postgresql.postgresqlUsername }}
config.storage.config.passwordstorage password{{ postgresql.postgresqlPassword }}
config.storage.config.hoststorage hostRelease.Name-postgresql.Release.Namespace..svc.cluster.local:5432
config.storage.config.ssl.modestorage ssl modedisable
config.staticClientsclient config (use config file see below)[]
config.connectorsconnectors config (use config file see below)[]
nodeSelectornodeselector{}
affinitytemplated affinity configuration{}
ingress.enabledingress enabledfalse
ingress.annotationsingress annotations{}
ingress.hostsingress hosts["/"]
ingress.tlsingress TLS[]

An example static client config:

config:
  staticClients:
  - id: example-app
    redirectURIs:
    - 'http://127.0.0.1:9000/auth/dex/callback'
    - 'http://localhost:9000/auth/dex/callback'
    name: 'Example App'
    secret: example-secret

An example connector config:

config:
  connectors:
    github:
      type: github
      id: github
      name: GitHub
      config:
        loadAllGroups: true
        clientID: <github-client-id>
        clientSecret: <fithub-client-secret>
        redirectURI: http://127.0.0.1:5556/dex/callback

    ldap:
      type: ldap
      name: OpenLDAP
      id: ldap
      config:
        host: <ladp-ip>:<ldap-port>
        # No TLS for this setup.
        insecureNoSSL: true
        # This would normally be a read-only user.
        bindDN: cn=admin,dc=example,dc=org
        bindPW: admin
        usernamePrompt: Email Address
        userSearch:
          baseDN: ou=People,dc=example,dc=org
          filter: "(objectClass=person)"
          username: mail
          # "DN" (case sensitive) is a special attribute name. It indicates that
          # this value should be taken from the entity's DN not an attribute on
          # the entity.
          idAttr: DN
          emailAttr: mail
          nameAttr: cn
        groupSearch:
          baseDN: ou=Groups,dc=example,dc=org
          filter: "(objectClass=groupOfNames)"
          # A user is a member of a group when their DN matches
          # the value of a "member" attribute on the group entity.
          userAttr: DN
          groupAttr: member
          # The group name should be the "cn" value.
          nameAttr: cn

An example affinity config that distributes pods accross AWS availability zones:

affinity: |
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchLabels:
              app: {{ template "dex.name" . }}
              release: {{ .Release.Name }}
            topologyKey: failure-domain.beta.kubernetes.io/zone

Deploy dex with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has dex 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 chartdex is pinned at v0.4.2 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