4 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8 //Initial indicates the initial status of CollectdPlugin
10 //Created indicates the status of CollectdPlugin after first reconcile
12 //Enabled indicates the status of CollectdPlugin after all the pods are reloaded
16 //Deprecated state when a plugin with same name is created. Old plugin gets deprecated and deleted eventually.
17 Deprecated = "Deprecated"
20 // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
21 // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
23 // CollectdPluginSpec defines the desired state of CollectdPlugin
24 // +k8s:openapi-gen=true
25 type CollectdPluginSpec struct {
26 // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
27 // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
28 // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html
29 PluginName string `json:"pluginName"`
30 PluginConf string `json:"pluginConf"`
33 // CollectdPluginStatus defines the observed state of CollectdPlugin
34 // +k8s:openapi-gen=true
35 type CollectdPluginStatus struct {
36 // CollectdAgents are the collectd pods in the Daemonset
37 // Status can be one of "", Created, Deleting, Applied, Deprecated
38 CollectdAgents []string `json:"collectdAgents,omitempty"`
39 Status string `json:"status"`
42 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
44 // CollectdPlugin is the Schema for the collectdplugins API
45 // +k8s:openapi-gen=true
46 // +kubebuilder:subresource:status
47 type CollectdPlugin struct {
48 metav1.TypeMeta `json:",inline"`
49 metav1.ObjectMeta `json:"metadata,omitempty"`
51 Spec CollectdPluginSpec `json:"spec,omitempty"`
52 Status CollectdPluginStatus `json:"status,omitempty"`
55 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
57 // CollectdPluginList contains a list of CollectdPlugin
58 type CollectdPluginList struct {
59 metav1.TypeMeta `json:",inline"`
60 metav1.ListMeta `json:"metadata,omitempty"`
61 Items []CollectdPlugin `json:"items"`
65 SchemeBuilder.Register(&CollectdPlugin{}, &CollectdPluginList{})