You can deploy the webhook to a Google cloud function using the following steps:
- Clone this repository and make it your working directory:
git clone https://github.com/secrethub/secrethub-kubernetes-mutating-webhook.git && cd secrethub-kubernetes-mutating-webhook
- Deploy the webhook to a Google Cloud Function:
gcloud functions deploy secrethub-mutating-webhook --runtime go113 --entry-point F --trigger-http --allow-unauthenticated
The function is configured to allow unauthenticated requests. The function doesn't give access to any resources or data. It only allows you to mutate provided data.
- Set the Google Cloud Function URL in the
config.yaml
:
URL=$(gcloud functions describe secrethub-mutating-webhook --format 'value(httpsTrigger.url)') sed -i "s|YOUR_CLOUD_FUNCTION_URL|$URL|" deploy/gcloud-function/config.yaml
- Enable the webhook on your Kubernetes cluster:
kubectl apply -f deploy/gcloud-function