Skip to content

sostheim/cluster-controller

 
 

Repository files navigation

cluster-controller

This repository implements a controller for watching Cluster resources as defined with a CustomResourceDefinition (CRD).

This is a WIP repo for a POC, TODO alter directory structure and create a CI job to handle codegen, see: https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/

Purpose

This custom controller manages a custom resource of type Cluster.

Deploy CRD and create a resource

Creating the KrakenCluster CRD object that defines the schema of a kraken cluster and the resource to be consumed by the controller:

kubectl create -f assets/KrakenClusterCRD.yaml

You may then create a sample resource by running

kubectl create -f assets/test-cluster.yaml

Running

# assumes you have a working kubeconfig, not required if operating in-cluster
$ go run *.go -kubeconfig=$HOME/.kube/config -logtostderr=true

Changing the Specification for KrakenCluster

vi pkg/apis/clustercontroller/v1alpha1/types.go
hack/update-codegen.sh

About

Kubernetes custom controller for managing Kubernetes clusters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 86.0%
  • Shell 11.6%
  • Python 1.8%
  • Smarty 0.6%