/
querier_types.go
112 lines (88 loc) · 4.36 KB
/
querier_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
Copyright 2019 Gavin Zhou.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// QuerierSpec defines the desired state of Querier
type QuerierSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
// Metadata Labels and Annotations gets propagated to the prometheus pods.
PodMetadata *metav1.ObjectMeta `json:"podMetadata,omitempty"`
// ServiceMonitors to be selected for target discovery.
ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
// Namespaces to be selected for ServiceMonitor discovery. If nil, only
// check own namespace.
ServiceMonitorNamespaceSelector *metav1.LabelSelector `json:"serviceMonitorNamespaceSelector,omitempty"`
// Define resources requests and limits for single Pods.
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
// Number of instances to deploy for a Prometheus deployment.
Replicas *int32 `json:"replicas,omitempty"`
// replicaLabel set query replica-label
ReplicaLabel string `json:"replicaLabel,omitempty"`
// storeDNS is storage gateway
StoreDNS string `json:"storeDNS,omitempty"`
// Image if specified has precedence over baseImage, tag and sha
// combinations. Specifying the version is still necessary to ensure the
// Prometheus Operator knows what version of Prometheus is being
// configured.
Image *string `json:"image,omitempty"`
// Log level for Prometheus to be configured with.
LogLevel string `json:"logLevel,omitempty"`
}
// QuerierStatus defines the observed state of Querier
type QuerierStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
DeploymentStatus appsv1.DeploymentStatus `json:"deploymentStatus,omitempty"`
// serviceStatus contains the status of the Service managed by thanos reciver
ServiceStatus corev1.ServiceStatus `json:"serviceStatus,omitempty"`
// Total number of non-terminated pods targeted by this Prometheus deployment
// that have the desired version spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this Prometheus deployment.
AvailableReplicas int32 `json:"availableReplicas"`
// Total number of unavailable pods targeted by this Prometheus deployment.
UnavailableReplicas int32 `json:"unavailableReplicas"`
}
// +kubebuilder:printcolumn:name="storage",type="string",JSONPath=".spec.storage",format="byte"
// +kubebuilder:printcolumn:name="ready replicas",type="integer",JSONPath=".status.Deployment.readyReplicas",format="int32"
// +kubebuilder:printcolumn:name="current replicas",type="integer",JSONPath=".status.Deployment.currentReplicas",format="int32"
// +kubebuilder:object:root=true
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.Deployment.replicas
// +kubebuilder:subresource:status
// Querier is the Schema for the queriers API
type Querier struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec QuerierSpec `json:"spec,omitempty"`
Status QuerierStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// QuerierList contains a list of Querier
type QuerierList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Querier `json:"items"`
}
func init() {
SchemeBuilder.Register(&Querier{}, &QuerierList{})
}