An open API service indexing awesome lists of open source software.

https://github.com/developer-guy/gophercon-turkiye-2021-hands-on

GopherCon Turkiye 2021 - Kubernetes'i kendi ihtiyaçlarımıza göre nasıl özelleştirdik ?
https://github.com/developer-guy/gophercon-turkiye-2021-hands-on

gcloud gke gke-cluster go golang google-cloud-function google-cloud-functions google-kubernetes-engine kubernetes validating-admission-webhook validating-webhook

Last synced: about 1 year ago
JSON representation

GopherCon Turkiye 2021 - Kubernetes'i kendi ihtiyaçlarımıza göre nasıl özelleştirdik ?

Awesome Lists containing this project

README

          

## GopherCon Turkiye 2021 - Kubernetes'i kendi ihtiyaçlarımıza göre nasıl özelleştirdik ?

![webhook](./assets/validating_webhook.png)

> Slides: https://docs.google.com/presentation/d/1v-pwXe5izWIF9v_pkpsjqb2c-2CZe9EEDda17tqaVgg/edit?usp=sharing

### Prerequisites

* gcloud 342.0.0
* Kubernetes v1.19.9
* kubectl v1.21.1

### Tutorial

Start with defining the name of GKE (Google Kubernetes Engine) Cluster as an environment variable.

```bash
$ export GKE_DEMO_CLUSTER_NAME=gophercon-turkiye-2021-hands-on
```

Let's create the GKE Cluster.
```bash
$ gcloud container clusters create $GKE_DEMO_CLUSTER_NAME --num-nodes=2
```

Once it's created, fetch the cluster credentials in order to work properly with `kubectl` a CLI tool for interacting with Kubernetes.
```bash
$ gcloud container clusters get-credentials $GKE_DEMO_CLUSTER_NAME
```

Verify if everything is working before move on to the next step.

```bash
$ kubectl get nodes -o wide
```

Now, it is time for deploying our first Google Cloud Function.

```bash
$ gcloud functions deploy Validate --runtime go113 --trigger-http --allow-unauthenticated
```

Once it's deployed, let's grap the url of the function for later use.
```bash
$ CLOUD_FUNCTION_URL=$(gcloud functions describe --format=json Validate | jq -r '.httpsTrigger.url')
$ echo $CLOUD_FUNCTION_URL
```

Now we are ready to register this functions as a `ValidatingWebhookConfiguration` in our cluster.

```bash
$ cat <