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

Commit 9df6489

Browse files
committed
Updates dev cluster docs and fixes GOOS target for image
Signed-off-by: JoshVanL <[email protected]>
1 parent 957138e commit 9df6489

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
*
2-
!/bin/kube-oidc-proxy
2+
!/bin/kube-oidc-proxy-linux

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ LABEL description="OIDC reverse proxy authenticator based on Kubernetes"
44

55
RUN apk --no-cache --update add ca-certificates
66

7-
COPY ./bin/kube-oidc-proxy /usr/bin/kube-oidc-proxy
7+
COPY ./bin/kube-oidc-proxy-linux /usr/bin/kube-oidc-proxy
88

99
CMD ["/usr/bin/kube-oidc-proxy"]

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,18 @@ build: generate ## build kube-oidc-proxy
9999
CGO_ENABLED=0 go build -ldflags '-w $(shell hack/version-ldflags.sh)' -o ./bin/kube-oidc-proxy ./cmd/.
100100

101101
docker_build: generate test build ## build docker image
102+
GOOS=linux CGO_ENABLED=0 go build -ldflags '-w $(shell hack/version-ldflags.sh)' -o ./bin/kube-oidc-proxy-linux ./cmd/.
102103
docker build -t kube-oidc-proxy .
103104

104105
all: test build ## runs tests, build
105106

106107
image: all docker_build ## runs tests, build and docker build
107108

108-
dev_cluster_create: ## create dev cluster for development testing
109+
dev_cluster_create: depend ## create dev cluster for development testing
109110
KUBE_OIDC_PROXY_ROOT_PATH="$$(pwd)" go run -v ./test/environment/dev create
110111

111-
dev_cluster_deploy: ## deploy into dev cluster
112+
dev_cluster_deploy: depend ## deploy into dev cluster
112113
KUBE_OIDC_PROXY_ROOT_PATH="$$(pwd)" go run -v ./test/environment/dev deploy
113114

114-
dev_cluster_destroy: ## destroy dev cluster
115+
dev_cluster_destroy: depend ## destroy dev cluster
115116
KUBE_OIDC_PROXY_ROOT_PATH="$$(pwd)" go run -v ./test/environment/dev destroy

docs/tasks/development-testing.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ onto each node.
1111

1212
# Deploying the Proxy
1313

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.
14+
This will build the proxy and other tooling from source,build the images, and
15+
load them onto each node. This will then deploy the proxy alongside a fake OIDC
16+
issuer so that the proxy is fully functional. The proxy will then be reachable
17+
from a node port service in the cluster.
18+
19+
20+
```bash
21+
make dev_cluster_deploy
22+
```
1823

1924
This command will output a signed OIDC token that is valid for the proxy. You
2025
can then make calls to the proxy, like the following:

test/kind/image.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ func (k *Kind) LoadAllImages() error {
3232
}
3333

3434
func (k *Kind) LoadKubeOIDCProxy() error {
35-
binPath := filepath.Join(k.rootPath, "./bin/kube-oidc-proxy")
35+
binPath := filepath.Join(k.rootPath, "./bin/kube-oidc-proxy-linux")
3636
mainPath := filepath.Join(k.rootPath, "./cmd/.")
3737
image := "kube-oidc-proxy-e2e"
3838

3939
return k.loadImage(binPath, mainPath, image, k.rootPath)
4040
}
4141

4242
func (k *Kind) LoadIssuer() error {
43-
binPath := filepath.Join(k.rootPath, "./test/tools/issuer/bin/oidc-issuer")
43+
binPath := filepath.Join(k.rootPath, "./test/tools/issuer/bin/oidc-issuer-linux")
4444
dockerfilePath := filepath.Join(k.rootPath, "./test/tools/issuer")
4545
mainPath := filepath.Join(dockerfilePath, "cmd")
4646
image := "oidc-issuer-e2e"
@@ -49,7 +49,7 @@ func (k *Kind) LoadIssuer() error {
4949
}
5050

5151
func (k *Kind) LoadFakeAPIServer() error {
52-
binPath := filepath.Join(k.rootPath, "./test/tools/fake-apiserver/bin/fake-apiserver")
52+
binPath := filepath.Join(k.rootPath, "./test/tools/fake-apiserver/bin/fake-apiserver-linux")
5353
dockerfilePath := filepath.Join(k.rootPath, "./test/tools/fake-apiserver")
5454
mainPath := filepath.Join(dockerfilePath, "cmd")
5555
image := "fake-apiserver-e2e"
@@ -127,7 +127,8 @@ func (k *Kind) runCmdWithOut(w io.Writer, command string, args ...string) error
127127
cmd.Stdout = w
128128
cmd.Env = append(cmd.Env,
129129
"GO111MODULE=on", "CGO_ENABLED=0", "HOME="+os.Getenv("HOME"),
130-
"PATH="+os.Getenv("PATH"))
130+
"PATH="+os.Getenv("PATH"),
131+
"GOOS=linux")
131132

132133
if err := cmd.Start(); err != nil {
133134
return err

test/tools/fake-apiserver/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ LABEL description="A fake API server that will respond to requests with the same
55

66
RUN apk --no-cache --update add ca-certificates
77

8-
COPY ./bin/fake-apiserver /usr/bin/fake-apiserver
8+
COPY ./bin/fake-apiserver-linux /usr/bin/fake-apiserver
99

1010
CMD ["/usr/bin/fake-apiserver"]

test/tools/issuer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ LABEL description="A basic OIDC issuer that prsents a well-known and certs endpo
55

66
RUN apk --no-cache --update add ca-certificates
77

8-
COPY ./bin/oidc-issuer /usr/bin/oidc-issuer
8+
COPY ./bin/oidc-issuer-linux /usr/bin/oidc-issuer
99

1010
CMD ["/usr/bin/oidc-issuer"]

0 commit comments

Comments
 (0)