You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A mutating webhook that will patch any pods in your kubernetes cluster with GCP credentials (whose location is currently hardcoded to /var/lib/minikube/google_application_credentials.json)
3
2
4
-
Use the image gcr.io/k8s-minikube/gcp-auth-webhook as the image for a Deployment in your Kubernetes manifest and add that to a MutatingWebhookConfiguration.
3
+
A server that includes:
4
+
* A mutating webhook that will patch any newly created pods in your Kubernetes cluster with GCP credentials (whose location is currently hardcoded to /var/lib/minikube/google_application_credentials.json).
5
+
* A mutating webhook that will patch any newly created service accounts in your Kubernetes cluster with an image pull secret.
6
+
* A thread that monitors namespaces to make sure all namespaces include a image pull secret to be able to pull from GCR and AR.
7
+
8
+
## Deployment
9
+
Use the image `gcr.io/k8s-minikube/gcp-auth-webhook` as the image for a Deployment in your Kubernetes manifest and add that to a MutatingWebhookConfiguration. See [minikube](https://github.com/kubernetes/minikube/blob/master/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl) for details.
10
+
11
+
## Running Locally
12
+
The easiest way to run the server locally is:
13
+
* Remove `FROM scratch` in the Dockerfile and replace it with the following to ensure https requests work properly locally:
14
+
```
15
+
FROM alpine
16
+
RUN apk --no-cache add ca-certificates
17
+
```
18
+
* Modify [minikube's](https://github.com/kubernetes/minikube/blob/master/deploy/addons/gcp-auth/gcp-auth-webhook.yaml.tmpl) gcp-auth Deployment image to be `local/gcp-auth-webhook:$(VERSION)` (replace `$(VERSION)` with your version)
19
+
* Build and run minikube
20
+
* Run `eval $(path_to_minikube/minikube docker-env)` and then `make local-image` to make the image available from within minikube
21
+
* Run `path_to_minikube/minikube addons enable gcp-auth` to enable the addon, which creates a pod in the `gcp-auth` namespace with the gcp-auth-webhook server
0 commit comments