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