|
| 1 | +--- |
| 2 | +title: Okta |
| 3 | +description: Centralizing Kubernetes Authentication with Okta and Plural |
| 4 | +--- |
| 5 | + |
| 6 | +## What You'll Get |
| 7 | + |
| 8 | +Plural's OIDC integration with Okta provides: |
| 9 | + |
| 10 | +* Centralized authentication for all Kubernetes clusters managed by Plural |
| 11 | +* Group-based access control that maps Okta groups to Kubernetes RBAC roles |
| 12 | +* GitOps-friendly configuration for consistent, auditable identity management |
| 13 | +* Automated onboarding and offboarding by updating group membership in Okta |
| 14 | +* Full auditability via Okta login logs and Kubernetes audit logs |
| 15 | + |
| 16 | +Once configured, your Plural Console login page will include **Log in with OIDC**, and group membership in Okta will directly control cluster access. |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +- An Okta admin account (trial: [Okta Free Trial](https://www.okta.com/free-trial/)) |
| 21 | +- A Plural-managed Kubernetes cluster |
| 22 | +- Basic knowledge of [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) |
| 23 | + |
| 24 | +## Step 1: Register an OIDC Application in Okta[text](../../../public/assets/oidc-integration) |
| 25 | + |
| 26 | +1. Log into **Okta Admin Console** → **Applications → Create App Integration**. |
| 27 | +2. Select **OIDC** and **Web Application**. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +3. Configure redirect URIs for your Plural console domain. |
| 32 | +4. Save and copy: |
| 33 | + - **Client ID** |
| 34 | + - **Client Secret** |
| 35 | + - **Issuer URL** (e.g., `https://<org>.okta.com`) |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +## Step 2: Configure Plural to Use Okta |
| 40 | + |
| 41 | +1. In [Plural Console](https://app.plural.sh), open your management cluster. |
| 42 | +2. Under **Login Settings**, enable **External OIDC**. |
| 43 | +3. Enter the Okta **Issuer URL**, **Client ID**, and **Client Secret**. |
| 44 | +4. Save changes. |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +Plural now delegates login to Okta. You should see a **Log in with OIDC** button. |
| 49 | + |
| 50 | +## Step 3: Map Okta Groups to Kubernetes RBAC |
| 51 | + |
| 52 | +1. In Okta Admin Console, create groups (e.g., `sre`, `developer`). |
| 53 | +2. Assign users to groups. |
| 54 | +3. Bind groups to RBAC roles in Kubernetes via GitOps: |
| 55 | + |
| 56 | +```yaml |
| 57 | +# sre group → cluster-admin |
| 58 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 59 | +kind: ClusterRoleBinding |
| 60 | +metadata: |
| 61 | + name: sre-binding |
| 62 | +roleRef: |
| 63 | + kind: ClusterRole |
| 64 | + name: cluster-admin |
| 65 | + apiGroup: rbac.authorization.k8s.io |
| 66 | +subjects: |
| 67 | +- kind: Group |
| 68 | + name: sre |
| 69 | + apiGroup: rbac.authorization.k8s.io |
| 70 | +``` |
| 71 | +
|
| 72 | +```yaml |
| 73 | +# developer group → view (read-only) |
| 74 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 75 | +kind: ClusterRoleBinding |
| 76 | +metadata: |
| 77 | + name: developer-binding |
| 78 | +roleRef: |
| 79 | + kind: ClusterRole |
| 80 | + name: view |
| 81 | + apiGroup: rbac.authorization.k8s.io |
| 82 | +subjects: |
| 83 | +- kind: Group |
| 84 | + name: developer |
| 85 | + apiGroup: rbac.authorization.k8s.io |
| 86 | +``` |
| 87 | +
|
| 88 | +Plural's GitOps pipeline syncs these bindings to all managed clusters automatically. |
| 89 | +
|
| 90 | +## Verifying Access |
| 91 | +
|
| 92 | +After configuring Okta integration, you should confirm that group-to-RBAC mappings are working correctly. The simplest way to validate RBAC is with `kubectl auth can-i`. This command lets you impersonate a group and test whether specific actions are allowed. |
| 93 | + |
| 94 | +```bash |
| 95 | +# SRE group should have full admin rights |
| 96 | +kubectl auth can-i create pods --as-group=sre |
| 97 | +
|
| 98 | +# Developer group should only have read-only permissions |
| 99 | +kubectl auth can-i delete pods --as-group=developer |
| 100 | +``` |
| 101 | + |
| 102 | +Expected results: |
| 103 | +- The first command should return yes (SREs are bound to cluster-admin). |
| 104 | +- The second should return no (Developers only have view role). |
0 commit comments