$ mkdir install && cd install
$ GOBIN=$(pwd)/ GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3
$ wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_linux_amd64.tar.gz
$ tar xvf kubebuilder_2.3.1_linux_amd64.tar.gz
$ mv kubebuilder_2.3.1_linux_amd64 kubebuilder
$ cp kustomize kubebuilder/bin/
$ chmod +x kubebuilder/bin/*
$ mv kubebuilder /usr/local/
$ echo 'export PATH=${PATH}:/usr/local/kubebuilder/bin' >> ~/.bashrc
$ source ~/.bashrc

# 初始化开发环境
$ kubebuilder init --domain com.bolingcavalry

# 创建 GVK
$ kubebuilder create api --group webapp --version v1 --kind Gustbook

# 生成相关文件
$ make generate
$ make all

# 将 crd 资源安装到集群中
$ make install

# 调试运行
$ make run

# 构建镜像并部署
$ make docker-build IMG=operator-demo:v1
$ make deploy IMG=operator-demo:v1

# 卸载(清理会清理掉 install 创建掉资源文件和 CRD)
$ make uninstall