crd-controller

Sample Controller

Clone this repository to this directory: $GOPATH/src/obaydullahmhs

To Clone Git with SSH:

git clone git@github.com:obaydullahmhs/crd-controller.git

Run this command to load/update package

go get all

go mod tidy ; go mod vendor

Run the following command to give permission to some bash scripts

chmod +x hack/update-codegen.sh

chmod +x vendor/k8s.io/code-generator/generate-groups.sh

To generate clientset, listers and informers, run this command, this will also generate the custom resource definition yaml

hack/update-codegen.sh

To deploy your CRD in kubernetes cluster,

kubectl apply -f manifests/aadee.apps_aadees.yaml

Now to run the controller, build the project and run it using the following command:

go build

./crd-controller

Now, all things are ready, You can deploy aadee type using kubectl apply -f <name>.yaml . Two demo yamls are in the manifests directory.

This resource handles deployments type in kubernetes clusters.