Docs
Live demo

Put a web application behind Principal sign-in

Protect a Kubernetes web app (such as Grafana) behind Principal sign-in so only matched users enter.

On this page

Before you start: Admin role, managed Kubernetes target with Principal sign-in, and an ingress-nginx Ingress.

  1. Open Resources → cluster → Applications and click Add application.
  2. Pick the Ingress (Rescan cluster if new) and confirm Add this application?.
  3. Open the app → Sign-in, pick a mode below, check preview and confirm. For Native OIDC, copy client ID and one-time secret.
  4. Click Add rule, pick group/person and template (or Create template: one fits all apps), then click Create and apply.
Mode Effect
Ingress SSO gate
Principal sign-in in front of the Ingress.
Native OIDC
App signs users in directly via Dex.
Ingress SSO gate + Native OIDC
Gate protects Ingress, app shares the Dex client.

Matched users sign in. Others see No access to and the app name.

One group on many applications#

  1. Tick apps in Applications, click Give sign-in and pick the group.
  2. Review preview (Nested groups on, Nested groups off, No Principal sign-in yet).
  3. Click Give sign-in to N applications (up to 500).

Remove sign-in reverses this and ends open sessions (skips apps where the group has multiple rules).

Protect new Ingresses#

Enable Protect new Ingresses in cluster settings to lock new Ingresses behind the SSO gate automatically (exemptions).

Move the application to another ingress class#

The cluster refuses another spec.ingressClassName on a gated Ingress. Keep the SSO gate and change the class in this order:

  1. In Applications, open the application and click Edit in Dex OAuth client. In SSO gate options, pick the new class in Ingress class and apply.
  2. Change spec.ingressClassName of the application’s Ingress to the same class.

Rules stay as they are. If the new class is served from another address, point the application’s DNS name there too. Between the two steps, and until DNS points there, nobody can sign in and the application stays closed.

Only ingress-nginx can run the SSO gate. Delete client removes the gate and keeps the rules: a new client lets the same people in.

↑ ↓ to moveEnter to openEsc to close