4 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
7 // PrometheusRemoteEndpointSpec defines the desired state of PrometheusRemoteEndpoint
8 // +k8s:openapi-gen=true
9 type PrometheusRemoteEndpointSpec struct {
10 AdapterURL string `json:"adapterURL"`
11 FilterSelector *metav1.LabelSelector `json:"filterSelector,omitempty"`
12 Type string `json:"type"`
13 KafkaConfig string `json:"kafkaConfig,omitempty"`
14 QueueConfig QueueConfig `json:"queueConfig,omitempty"`
15 RemoteTimeout string `json:"remoteTimeout,omitempty"`
18 // KafkaConfig - defines the desired remote kafka writer configurations
19 type KafkaConfig struct {
20 BrokerURL string `json:"bootstrap.servers"`
21 Topic string `json:"topic"`
22 UsePartition bool `json:"usePartition"`
23 BatchMsgNum int `json:"batch.num.messages,omitempty`
24 Compression string `json:"compression.codec,omitempty`
27 // QueueConfig - defines the prometheus remote write queue configurations
28 type QueueConfig struct {
29 BatchSendDeadline string `json:"batchSendDeadline,omitempty"`
30 Capacity string `json:"capacity,omitempty"`
31 MaxBackoff string `json:"maxBackoff,omitempty"`
32 MaxRetries string `json:"maxRetries,omitempty"`
33 MaxSamplesPerSend string `json:"maxSamplesPerSend,omitempty"`
34 MaxShards string `json:"maxShards,omitempty"`
35 MinBackoff string `json:"minBackoff,omitempty"`
36 MinShards string `json:"minShards,omitempty"`
39 // PrometheusRemoteEndpointStatus defines the observed state of PrometheusRemoteEndpoint
40 // +k8s:openapi-gen=true
41 // +kubebuilder:subresource:status
42 type PrometheusRemoteEndpointStatus struct {
43 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
44 // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
45 // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
46 // Status can be Error, Enabled
47 PrometheusInstance string `json:"prometheusInstance,omitempty"`
48 Status string `json:"status"`
49 KafkaWriterID string `json:"kafkaWriterID,omitempty"`
50 RemoteURL string `json:"remoteURL,omitempty"`
53 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
55 // PrometheusRemoteEndpoint is the Schema for the prometheusremoteendpoints API
56 // +k8s:openapi-gen=true
57 // +kubebuilder:subresource:status
58 // +kubebuilder:resource:path=prometheusremoteendpoints,scope=Namespaced
59 type PrometheusRemoteEndpoint struct {
60 metav1.TypeMeta `json:",inline"`
61 metav1.ObjectMeta `json:"metadata,omitempty"`
63 Spec PrometheusRemoteEndpointSpec `json:"spec,omitempty"`
64 Status PrometheusRemoteEndpointStatus `json:"status,omitempty"`
67 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
69 // PrometheusRemoteEndpointList contains a list of PrometheusRemoteEndpoint
70 type PrometheusRemoteEndpointList struct {
71 metav1.TypeMeta `json:",inline"`
72 metav1.ListMeta `json:"metadata,omitempty"`
73 Items []PrometheusRemoteEndpoint `json:"items"`
77 SchemeBuilder.Register(&PrometheusRemoteEndpoint{}, &PrometheusRemoteEndpointList{})