Documentation ¶
Index ¶
- Variables
- func DeploymentSynchronize(client kubernetes.Interface)
- func GetDeploymentInformer(client kubernetes.Interface) cache.SharedIndexInformer
- func GetIngressInformer(client kubernetes.Interface) cache.SharedIndexInformer
- func GetKubernetesClient() kubernetes.Interface
- func GetNamespaceInformer(client kubernetes.Interface) cache.SharedIndexInformer
- func GetPodInformer(client kubernetes.Interface) cache.SharedIndexInformer
- func GetReplicaSetInformer(client kubernetes.Interface) cache.SharedIndexInformer
- func GetServiceInformer(client kubernetes.Interface) cache.SharedIndexInformer
- func GetStatefulSetInformer(client kubernetes.Interface) cache.SharedIndexInformer
- func IngressSynchronize(client kubernetes.Interface)
- func NamespaceSynchronize(client kubernetes.Interface)
- func PodSynchronize(client kubernetes.Interface)
- func ReplicaSetSynchronize(client kubernetes.Interface)
- func SendDeleteRequest(url string) (int, []byte)
- func SendJSONQuery(obj interface{}, url string) (int, []byte)
- func SendJSONQueryWithRetries(obj interface{}, url string) ([]byte, error)
- func ServiceSynchronize(client kubernetes.Interface)
- func StatefulSetSynchronize(client kubernetes.Interface)
- func ValidateDeployment(deployment *v1beta2.Deployment) bool
- func ValidateNamespace(namespace *core_v1.Namespace) bool
- func ValidatePod(pod *core_v1.Pod) bool
- func ValidateReplicaSet(replicaset *v1beta2.ReplicaSet) bool
- func ValidateService(service *core_v1.Service) bool
- func ValidateStatefulSet(sts *appsv1.StatefulSet) bool
- type DeploymentHandler
- type Handler
- type IngressHandler
- type NamespaceHandler
- type PodHandler
- type ReplicaSetHandler
- type ServiceHandler
- type StatefulSetHandler
Constants ¶
This section is empty.
Variables ¶
var AppNamespace string
AppNamespace used for only monitor assets in a specific namespace otherwise AppNamespace will refer to all namespaces that the controller has access to
var ClusterName = os.Getenv("CLUSTER_NAME")
ClusterName for running in a cluster
var RestSvcEndpoint = os.Getenv("TARGET_URL")
RestSvcEndpoint the URL that k8s data will send to
Functions ¶
func DeploymentSynchronize ¶
func DeploymentSynchronize(client kubernetes.Interface)
DeploymentSynchronize sync all Deployments periodically in case missing events
func GetDeploymentInformer ¶
func GetDeploymentInformer(client kubernetes.Interface) cache.SharedIndexInformer
GetDeploymentInformer get index Informer to watch Deployment
func GetIngressInformer ¶
func GetIngressInformer(client kubernetes.Interface) cache.SharedIndexInformer
GetIngressInformer get index Informer to watch Ingress
func GetKubernetesClient ¶
func GetKubernetesClient() kubernetes.Interface
GetKubernetesClient retrieve the Kubernetes cluster client from outside of the cluster
func GetNamespaceInformer ¶
func GetNamespaceInformer(client kubernetes.Interface) cache.SharedIndexInformer
GetNamespaceInformer get index Informer to watch Namespace
func GetPodInformer ¶
func GetPodInformer(client kubernetes.Interface) cache.SharedIndexInformer
GetPodInformer get index Informer to watch Pod
func GetReplicaSetInformer ¶
func GetReplicaSetInformer(client kubernetes.Interface) cache.SharedIndexInformer
GetReplicaSetInformer get index Informer to watch ReplicaSet
func GetServiceInformer ¶
func GetServiceInformer(client kubernetes.Interface) cache.SharedIndexInformer
GetServiceInformer get index Informer to watch Service
func GetStatefulSetInformer ¶
func GetStatefulSetInformer(client kubernetes.Interface) cache.SharedIndexInformer
GetStatefulSetInformer get index Informer to watch StatefulSet
func IngressSynchronize ¶
func IngressSynchronize(client kubernetes.Interface)
IngressSynchronize sync all Ingresses periodically in case missing events
func NamespaceSynchronize ¶
func NamespaceSynchronize(client kubernetes.Interface)
NamespaceSynchronize sync all Namespaces periodically in case missing events
func PodSynchronize ¶
func PodSynchronize(client kubernetes.Interface)
PodSynchronize synchronize the objects in dgraph with the cluster to account for drift e.g. if there were network issues and some events weren't received, or if the api crashes while processing some events
func ReplicaSetSynchronize ¶
func ReplicaSetSynchronize(client kubernetes.Interface)
ReplicaSetSynchronize sync all ReplicaSets periodically in case missing events
func SendDeleteRequest ¶
SendDeleteRequest send request to delete k8s objects
func SendJSONQuery ¶
SendJSONQuery send requests to REST api
func SendJSONQueryWithRetries ¶
SendJSONQueryWithRetries retry requests if error occurs
func ServiceSynchronize ¶
func ServiceSynchronize(client kubernetes.Interface)
ServiceSynchronize sync all Services periodically in case missing events
func StatefulSetSynchronize ¶
func StatefulSetSynchronize(client kubernetes.Interface)
StatefulSetSynchronize sync all StatefulSets periodically in case missing events
func ValidateDeployment ¶
func ValidateDeployment(deployment *v1beta2.Deployment) bool
ValidateDeployment to check deployment required attributes
func ValidateNamespace ¶
ValidateNamespace check required attributes
func ValidatePod ¶
ValidatePod verify that the object has at least these fields
func ValidateReplicaSet ¶
func ValidateReplicaSet(replicaset *v1beta2.ReplicaSet) bool
ValidateReplicaSet check required fields
func ValidateService ¶
ValidateService check required fields
func ValidateStatefulSet ¶
func ValidateStatefulSet(sts *appsv1.StatefulSet) bool
ValidateStatefulSet to check required fields
Types ¶
type DeploymentHandler ¶
type DeploymentHandler struct{}
DeploymentHandler is a sample implementation of Handler
func (*DeploymentHandler) Init ¶
func (t *DeploymentHandler) Init() error
Init handles any handler initialization a method of DeploymentHandler returns type error func (<object>) <name>(<params>) <return>
func (*DeploymentHandler) ObjectCreated ¶
func (t *DeploymentHandler) ObjectCreated(obj interface{}) error
ObjectCreated is called when an object is created
func (*DeploymentHandler) ObjectDeleted ¶
func (t *DeploymentHandler) ObjectDeleted(obj interface{}, key string) error
ObjectDeleted is called when an object is deleted
func (*DeploymentHandler) ObjectUpdated ¶
func (t *DeploymentHandler) ObjectUpdated(objOld, objNew interface{}) error
ObjectUpdated is called when an object is updated
type Handler ¶
type Handler interface { Init() error ObjectCreated(obj interface{}) error ObjectDeleted(obj interface{}, key string) error ObjectUpdated(objOld, objNew interface{}) error }
Handler interface contains the methods that are required
type IngressHandler ¶
type IngressHandler struct{}
IngressHandler is a sample implementation of Handler
func (*IngressHandler) Init ¶
func (t *IngressHandler) Init() error
Init handles any handler initialization a method of IngressHandler returns type error func (<object>) <name>(<params>) <return>
func (*IngressHandler) ObjectCreated ¶
func (t *IngressHandler) ObjectCreated(obj interface{}) error
ObjectCreated is called when an object is created
func (*IngressHandler) ObjectDeleted ¶
func (t *IngressHandler) ObjectDeleted(obj interface{}, key string) error
ObjectDeleted is called when an object is deleted
func (*IngressHandler) ObjectUpdated ¶
func (t *IngressHandler) ObjectUpdated(objOld, objNew interface{}) error
ObjectUpdated is called when an object is updated
type NamespaceHandler ¶
type NamespaceHandler struct{}
NamespaceHandler is a sample implementation of Handler
func (*NamespaceHandler) Init ¶
func (t *NamespaceHandler) Init() error
Init handles any handler initialization a method of NamespaceHandler returns type error func (<object>) <name>(<params>) <return>
func (*NamespaceHandler) ObjectCreated ¶
func (t *NamespaceHandler) ObjectCreated(obj interface{}) error
ObjectCreated is called when an object is created
func (*NamespaceHandler) ObjectDeleted ¶
func (t *NamespaceHandler) ObjectDeleted(obj interface{}, key string) error
ObjectDeleted is called when an object is deleted
func (*NamespaceHandler) ObjectUpdated ¶
func (t *NamespaceHandler) ObjectUpdated(objOld, objNew interface{}) error
ObjectUpdated is called when an object is updated
type PodHandler ¶
type PodHandler struct{}
PodHandler is a sample implementation of Handler
func (*PodHandler) Init ¶
func (t *PodHandler) Init() error
Init handles any handler initialization a method of PodHandler returns type error func (<object>) <name>(<params>) <return>
func (*PodHandler) ObjectCreated ¶
func (t *PodHandler) ObjectCreated(obj interface{}) error
ObjectCreated is called when an object is created
func (*PodHandler) ObjectDeleted ¶
func (t *PodHandler) ObjectDeleted(obj interface{}, key string) error
ObjectDeleted is called when an object is deleted
func (*PodHandler) ObjectUpdated ¶
func (t *PodHandler) ObjectUpdated(objOld, objNew interface{}) error
ObjectUpdated is called when an object is updated
type ReplicaSetHandler ¶
type ReplicaSetHandler struct{}
ReplicaSetHandler is a sample implementation of Handler
func (*ReplicaSetHandler) Init ¶
func (t *ReplicaSetHandler) Init() error
Init handles any handler initialization a method of ReplicaSetHandler returns type error func (<object>) <name>(<params>) <return>
func (*ReplicaSetHandler) ObjectCreated ¶
func (t *ReplicaSetHandler) ObjectCreated(obj interface{}) error
ObjectCreated is called when an object is created
func (*ReplicaSetHandler) ObjectDeleted ¶
func (t *ReplicaSetHandler) ObjectDeleted(obj interface{}, key string) error
ObjectDeleted is called when an object is deleted
func (*ReplicaSetHandler) ObjectUpdated ¶
func (t *ReplicaSetHandler) ObjectUpdated(objOld, objNew interface{}) error
ObjectUpdated is called when an object is updated
type ServiceHandler ¶
type ServiceHandler struct{}
ServiceHandler is a sample implementation of Handler
func (*ServiceHandler) Init ¶
func (t *ServiceHandler) Init() error
Init handles any handler initialization a method of ServiceHandler returns type error func (<object>) <name>(<params>) <return>
func (*ServiceHandler) ObjectCreated ¶
func (t *ServiceHandler) ObjectCreated(obj interface{}) error
ObjectCreated is called when an object is created
func (*ServiceHandler) ObjectDeleted ¶
func (t *ServiceHandler) ObjectDeleted(obj interface{}, key string) error
ObjectDeleted is called when an object is deleted
func (*ServiceHandler) ObjectUpdated ¶
func (t *ServiceHandler) ObjectUpdated(objOld, objNew interface{}) error
ObjectUpdated is called when an object is updated
type StatefulSetHandler ¶
type StatefulSetHandler struct{}
StatefulSetHandler is a sample implementation of Handler
func (*StatefulSetHandler) Init ¶
func (t *StatefulSetHandler) Init() error
Init handles any handler initialization a method of StatefulSetHandler returns type error func (<object>) <name>(<params>) <return>
func (*StatefulSetHandler) ObjectCreated ¶
func (t *StatefulSetHandler) ObjectCreated(obj interface{}) error
ObjectCreated is called when an object is created
func (*StatefulSetHandler) ObjectDeleted ¶
func (t *StatefulSetHandler) ObjectDeleted(obj interface{}, key string) error
ObjectDeleted is called when an object is deleted
func (*StatefulSetHandler) ObjectUpdated ¶
func (t *StatefulSetHandler) ObjectUpdated(objOld, objNew interface{}) error
ObjectUpdated is called when an object is updated