# Kubernetes Operators
## Topics
* [KinD](https://kind.sigs.k8s.io/)
* [lens](https://k8slens.dev/) Kubernetes IDE
* Review API Server and etcd3
* [Operator SDK](https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/) and [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)
* Example: [memcached-operator](https://github.com/mchirico/memcached-operator)
## KinD
Kubernetes in Docker, KinD allows you to quickly build kubernetes clusters in docker. You can also build from source.
```bash=
go get sigs.k8s.io/kind # Will need to be in path
git clone https://github.com/kubernetes/kubernetes.git
cd kubernetes
git tag|grep v1.20.5
# v1.20.5
# v1.20.5-rc.0
git checkout v1.20.5
kind build node-image --image=v1.20.5 --kube-root=~/playground/kubernetes
# Create image
kind create cluster --name v1.20.5 --image=v1.20.5
# Or, more complex
kind create cluster --name v1.20.5 --image=v1.20.5 --config configs/kind_basic.yaml
# To delete the cluster
kind delete --name v1.20.5 cluster
# Example of loading images into KinD
kind --name v1.20.5 load docker-image memcached-operator:v0.0.1
```
Here's a link to
[configs/kind_basic.yaml](https://github.com/mchirico/k8s/blob/main/configs/kind_basic.yaml)
## Kubebuilder
Yes, you'll want to install both.
```bash=
os=$(go env GOOS)
arch=$(go env GOARCH)
# download kubebuilder and extract it to tmp
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/
# move to a long-term location and put it on your path
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
```
This will give you the following:
```bash=
ls /usr/local/kubebuilder/bin/
etcd kube-apiserver kubebuilder kubectl
```
## Reconcile Loop



Reference:

## memcached-operator