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

Commit 30bfc04

Browse files
committed
Adds docs on development testing
Signed-off-by: JoshVanL <[email protected]>
1 parent 95a426d commit 30bfc04

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,7 @@ users:
132132

133133
## Development
134134
*NOTE*: building kube-oidc-proxy requires Go version 1.12 or higher.
135+
136+
To help with development, there is a suite of tools you can use to deploy a
137+
functioning proxy from source locally. You can read more
138+
[here](./docs/tasks/development-testing.md).

docs/tasks/development-testing.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Development Testing
2+
3+
In order to help development for the proxy, there are a few tools in place for
4+
quick testing.
5+
6+
# Creating a Cluster
7+
8+
Use `make dev_cluster_create` to spin up a kind cluster locally. This will also
9+
build the proxy and other tooling from source, build their images, and load them
10+
onto each node.
11+
12+
# Deploying the Proxy
13+
14+
Use `make dev_cluster_deploy` to build the proxy and other tooling from source,
15+
build the images, and load them onto each node. This will then deploy the proxy
16+
alongside a fake OIDC issuer so that the proxy is fully functional. The proxy
17+
will then be reachable from a node port service in the cluster.
18+
19+
This command will output a signed OIDC token that is valid for the proxy. You
20+
can then make calls to the proxy, like the following:
21+
22+
```bash
23+
curl -k https://172.17.0.2:30226 -H 'Authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.ewoJImlzcyI6Imh0dHBzOi8vb2lkYy1pc3N1ZXItZTJlLmt1YmUtb2lkYy1wcm94eS1lMmUtNmhiNGcuc3ZjLmNsdXN0ZXIubG9jYWw6NjQ0MyIsCgkiYXVkIjpbImt1YmUtb2lkYy1wcm94eS1lMmUtY2xpZW50LWlkIiwiYXVkLTIiXSwKCSJlbWFpbCI6InVzZXJAZXhhbXBsZS5jb20iLAoJImdyb3VwcyI6WyJncm91cC0xIiwiZ3JvdXAtMiJdLAoJImV4cCI6MTU4MjU1NTYzMQoJfQ.qWCM5zUHGslmwbgyZnMjhVeCLJd3R3c7xjtatjT_pv1VY-PpJ8IGBsbcCpur1fAm2CAbr0juM3yzwV1S3TUjhNhE8Wo6rxjA2Flnmwj7Nn2Got6T_cMFHQ_3A6YC72qkMwH-7SvXFB-C5Bk96vi9-clrxJ_b1XjfMPViZEVCJphh9HVzrZ5DPOAR0PDl-qnVys_CRkF0NEwEvAZL5SFumBqjtLBI9XUlWbB6VTljPOExL1zkv8NevZF8DxVsYFaW9HOYH8vNgC07kj_oUVkmAjP-2tVngcBKka0IBmuz2r-RfWNy9VJ-yb19AbtJNw6fjASy7O6VifuH4ZpjP5JSIg'
24+
```
25+
26+
You are also able to deploy a server that the proxy connects to. This is useful
27+
for checking the headers and request body sent to the target server by the
28+
proxy which are present in the server logs. To enable this, set the following
29+
environment variable:
30+
31+
```bash
32+
KUBE_OIDC_PROXY_FAKE_APISERVER=true make dev_cluster_deploy
33+
```
34+
35+
# Delete the cluster
36+
37+
To delete the test kind cluster, use `make dev_cluster_destroy`.

0 commit comments

Comments
 (0)