1
- # kube-oidc-proxy
1
+ # kube-oidc-proxy
2
2
3
3
` kube-oidc-proxy ` is a reverse proxy server to authenticate users using OIDC to
4
4
Kubernetes API servers where OIDC authentication is not available (i.e. managed
@@ -20,7 +20,13 @@ API server.
20
20
The following is a diagram of the request flow for a user request.
21
21
![ kube-oidc-proxy request flow] ( /img/kube-oidc-proxy.png )
22
22
23
- ## Quickstart
23
+ ## Tutorial
24
+
25
+ ### Quickstart
26
+
27
+ Deployment yamls can be found in ` ./demo/yaml ` and will require configuration to
28
+ an exiting OIDC issuer.
29
+
24
30
This quickstart demo will assume you have a Kubernetes cluster without OIDC
25
31
authentication, as well as an OIDC client created with your chosen
26
32
provider. We will be using a Service with type ` LoadBalancer ` to expose it to
@@ -32,7 +38,7 @@ This will create it's Deployment, Service Account and required permissions into
32
38
the newly created ` kube-oidc-proxy ` Namespace.
33
39
34
40
```
35
- $ kubectl apply -f ./demo/kube-oidc-proxy.yaml
41
+ $ kubectl apply -f ./demo/yaml/ kube-oidc-proxy.yaml
36
42
$ kubectl get all --namespace kube-oidc-proxy
37
43
```
38
44
@@ -46,34 +52,12 @@ We now wait until we have an external IP address provisioned.
46
52
$ kubectl get service --namespace kube-oidc-proxy
47
53
```
48
54
49
- We need to generate certificates for the ` kube-oidc-proxy ` to securely serve.
50
- We will be creating self-signed certificates which are tied to either it's IP
51
- address or a domain name that has been configured to point to this address.
52
- These certificates could also be generated through ` cert-manager ` , more
53
- information about this project found
54
- [ here] ( https://github.com/jetstack/cert-manager ) .
55
-
56
- ```
57
- $ ./demo/gencreds.sh kube-oidc-proxy ${kube-oidc-proxy_IP}
58
- ```
59
-
60
- or
61
-
62
- ```
63
- $ ./demo/gencreds.sh k8s.my-domain.com
64
- ```
65
-
66
- This should generate a certificate authority along with a signed key pair for
67
- use by ` kube-oidc-proxy ` in ` ./demo/generated ` . Enter the TLS key and certificate
68
- into the secure serving Kubernetes Secret manifest.
69
-
70
- ```
71
- $ SERVING_TLS_CERT=$(cat ./demo/generated/kube-oidc-proxy-cert.pem | base64 -w0); sed -i -e "s/SERVING_TLS_CERT/${SERVING_TLS_CERT}/g" ./demo/secrets.yaml
72
- $ SERVING_TLS_KEY=$(cat ./demo/generated/kube-oidc-proxy-key.pem | base64 -w0); sed -i -e "s/SERVING_TLS_KEY/${SERVING_TLS_KEY}/g" ./demo/secrets.yaml
73
- ```
55
+ We need to generate certificates for ` kube-oidc-proxy ` to securely serve. These
56
+ certificates can be generated through ` cert-manager ` , more information about
57
+ this project found [ here] ( https://github.com/jetstack/cert-manager ) .
74
58
75
59
Next, populate the OIDC authenticator Secret using the secrets given to you
76
- by your OIDC provider in ` ./demo/secrets.yaml ` . The OIDC provider CA will be
60
+ by your OIDC provider in ` ./demo/yaml/ secrets.yaml ` . The OIDC provider CA will be
77
61
different depending on which provider you are using. The easiest way to obtain
78
62
the correct certificate bundle is often by opening the providers URL into a
79
63
browser and fetching them there (typically output by clicking the lock icon on
@@ -82,21 +66,21 @@ your address bar). Google's OIDC provider for example requires CAs from both
82
66
` https://www.googleapis.com/oauth2/v3/certs ` .
83
67
84
68
85
- Apply the two secret manifests.
69
+ Apply the secret manifests.
86
70
87
71
```
88
- kubectl apply -f ./demo/secrets.yaml
72
+ kubectl apply -f ./demo/yaml/ secrets.yaml
89
73
```
90
74
91
- You may need to also recreate the ` kube-oidc-proxy ` pod to use these new secrets
75
+ You can restart the ` kube-oidc-proxy ` pod to use these new secrets
92
76
now they are available.
93
77
94
78
```
95
79
kubectl delete pod --namespace kube-oidc-proxy kube-oidc-proxy-*
96
80
```
97
81
98
- Finally, create a Kubeconfig to now point to ` kube-oidc-proxy ` as well as setting
99
- up your OIDC authenticated Kubernetes user.
82
+ Finally, create a Kubeconfig to point to ` kube-oidc-proxy ` and set up your OIDC
83
+ authenticated Kubernetes user.
100
84
101
85
```
102
86
apiVersion: v1
0 commit comments