This repository implements a cpaas controller for watching ControlPlane resources as defined with a CustomResourceDefinition (CRD).
Note: go-get or vendor this package as github.com/c-paas/cpaas-controller
.
The update-codegen
script will automatically generate the following files &
directories:
pkg/apis/samplecontroller/v1alpha1/zz_generated.deepcopy.go
pkg/generated/
Changes should not be made to these files manually, and when creating your own
controller based off of this implementation you should not copy these files and
instead run the update-codegen
script to generate your own.
Issue the following commands --- starting in whatever working directory you like.
git clone https://github.com/c-paas/cpaas-controller
cd cpaas-controller
# to create and populate the `vendor` directory.
go mod vendor
# create working cluster (with kind for example)
kind create --config=./kind.yaml cluster
# assumes you have a working kubeconfig, not required if operating in-cluster
make run
# deploy keys for kube-apiserver
./hack/certs-configmaps.sh
# deploy CRD and CR
make deploy
# check deployments created through the custom resource
kubectl get controlplanes
kubectl get pods
You can clean up the created CustomResourceDefinition with:
kubectl delete crd controlplanes.cpaascontroller.cpaas.io
Based on sample-controller