Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Client KubeClient //client for talking with kubernetes // contains filtered or unexported fields }
Controller implements a valid crwatcher.ResourceController that will manage resources in kubernetes based on the provided template files.
func NewController ¶
func NewController(tmplDir string, kubeCfg string, logger *zap.SugaredLogger) *Controller
NewController will return a configured Controller
func (Controller) ResourceAdded ¶
func (c Controller) ResourceAdded(r *unstructured.Unstructured)
ResourceAdded is called when a custom resource is created and will generate the template files and apply them to Kubernetes
func (Controller) ResourceDeleted ¶
func (c Controller) ResourceDeleted(r *unstructured.Unstructured)
ResourceDeleted is called when a custom resource is created and will generate the template files and delete them from Kubernetes
func (Controller) ResourceUpdated ¶
func (c Controller) ResourceUpdated(oldR, newR *unstructured.Unstructured)
ResourceUpdated is called when a custom resource is updated or during a resync and will generate the template files and apply them to Kubernetes
type KubeClient ¶
type KubeClient interface { Apply(file string) (string, error) Delete(file string) (string, error) }
KubeClient is an interface that implements an Apply() and Delete() for our K8s templates
type Kubectl ¶
type Kubectl struct {
ConfigFile string //config file for kubectl
}
Kubectl provides a simple wrapper around calling the needed kubectl commands TODO: This should be revisited when https://github.com/kubernetes/kubernetes/issues/15894 is completed. #15894 will move the apply logic from kubectl into the API