Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit bedaf65

Browse files
authored
Merge pull request #44 from jetstack/update-readme
Updates the quick start guide to reflect the changed yamls
2 parents 05d307b + 3e3a253 commit bedaf65

File tree

3 files changed

+22
-38
lines changed

3 files changed

+22
-38
lines changed

README.md

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# kube-oidc-proxy
1+
# kube-oidc-proxy
22

33
`kube-oidc-proxy` is a reverse proxy server to authenticate users using OIDC to
44
Kubernetes API servers where OIDC authentication is not available (i.e. managed
@@ -20,7 +20,13 @@ API server.
2020
The following is a diagram of the request flow for a user request.
2121
![kube-oidc-proxy request flow](/img/kube-oidc-proxy.png)
2222

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+
2430
This quickstart demo will assume you have a Kubernetes cluster without OIDC
2531
authentication, as well as an OIDC client created with your chosen
2632
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
3238
the newly created `kube-oidc-proxy` Namespace.
3339

3440
```
35-
$ kubectl apply -f ./demo/kube-oidc-proxy.yaml
41+
$ kubectl apply -f ./demo/yaml/kube-oidc-proxy.yaml
3642
$ kubectl get all --namespace kube-oidc-proxy
3743
```
3844

@@ -46,34 +52,12 @@ We now wait until we have an external IP address provisioned.
4652
$ kubectl get service --namespace kube-oidc-proxy
4753
```
4854

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).
7458

7559
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
7761
different depending on which provider you are using. The easiest way to obtain
7862
the correct certificate bundle is often by opening the providers URL into a
7963
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
8266
`https://www.googleapis.com/oauth2/v3/certs`.
8367

8468

85-
Apply the two secret manifests.
69+
Apply the secret manifests.
8670

8771
```
88-
kubectl apply -f ./demo/secrets.yaml
72+
kubectl apply -f ./demo/yaml/secrets.yaml
8973
```
9074

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
9276
now they are available.
9377

9478
```
9579
kubectl delete pod --namespace kube-oidc-proxy kube-oidc-proxy-*
9680
```
9781

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.
10084

10185
```
10286
apiVersion: v1

demo/yaml/kube-oidc-proxy.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ spec:
6666
- name: kube-oidc-proxy-config
6767
mountPath: /etc/oidc
6868
readOnly: true
69-
- name: kube-oidc-proxy-serving
69+
- name: kube-oidc-proxy-tls
7070
mountPath: /etc/oidc/tls
7171
readOnly: true
7272
volumes:
@@ -76,9 +76,9 @@ spec:
7676
items:
7777
- key: oidc.ca-pem
7878
path: oidc-ca.pem
79-
- name: kube-oidc-proxy-serving
79+
- name: kube-oidc-proxy-tls
8080
secret:
81-
secretName: kube-oidc-proxy-serving
81+
secretName: kube-oidc-proxy-tls
8282
items:
8383
- key: tls.crt
8484
path: crt.pem

demo/yaml/secrets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ data:
44
tls.key: {{ SERVING_TLS_KEY }}
55
kind: Secret
66
metadata:
7-
name: kube-oidc-proxy-serving
7+
name: kube-oidc-proxy-tls
88
namespace: kube-oidc-proxy
99
type: kubernetes.io/tls
1010
---

0 commit comments

Comments
 (0)