Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
Signed-off-by: Haywood Shannon <[email protected]>
  • Loading branch information
haywoodsh committed Aug 1, 2024
1 parent 80bf40f commit 7acc08f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
34 changes: 12 additions & 22 deletions examples/custom-resources/oidc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,7 @@ To set up Keycloak:
kubectl apply -f client-secret.yaml
```

## Step 6 - Deploy the OIDC Policy

Create a policy with the name `oidc-policy` that references the secret from the previous step:

```console
kubectl apply -f oidc.yaml
```

## Step 7 - Configure NGINX Plus Zone Synchronization and Resolver
## Step 6 - Configure NGINX Plus Zone Synchronization and Resolver

In this step we configure:

Expand All @@ -110,23 +102,19 @@ Steps:
kubectl apply -f nginx-ingress-headless.yaml
```

1. Get the cluster IP of the KubeDNS service:
1. Apply the ConfigMap `nginx-config.yaml`, which contains a stream snippet that enables zone synchronization and the resolver using the kube-dns service.

```console
kubectl -n kube-system get svc kube-dns
kubectl apply -f nginx-config.yaml
```

```text
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.4.0.10 <none> 53/UDP,53/TCP 9d
```
## Step 7 - Deploy the OIDC Policy

1. Edit the ConfigMap `nginx-config.yaml`, replacing the `<kube-dns-ip>` with the IP obtained in the previous step.
1. Apply the ConfigMap:
Create a policy with the name `oidc-policy` that references the secret from the previous step:

```console
kubectl apply -f nginx-config.yaml
```
```console
kubectl apply -f oidc.yaml
```

## Step 8 - Configure Load Balancing

Expand All @@ -149,5 +137,7 @@ in the response, this will match the ID for your user in Keycloak. ![webapp](./w

## Step 10 - Log Out

1. To log out, navigate to `https://webapp.example.com/logout`. Your session will be terminated and you will be
redirected to the default post logout URI `https://webapp.example.com/_logout`.
1. To log out, navigate to `https://webapp.example.com/logout`. Your session will be terminated, and you will be
redirected to the default post logout URI `https://webapp.example.com/_logout`.
1. To confirm that you have been logged out, navigate to `https://webapp.example.com`. You will be redirected to
Keycloak to log in again.
2 changes: 1 addition & 1 deletion examples/custom-resources/oidc/nginx-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ data:
zone_sync;
zone_sync_server nginx-ingress-headless.nginx-ingress.svc.cluster.local:12345 resolve;
}
resolver-addresses: <kube-dns-ip>
resolver-addresses: kube-dns.kube-system.svc.cluster.local
resolver-valid: 5s

0 comments on commit 7acc08f

Please sign in to comment.