diff --git a/charts/whizard/Chart.yaml b/charts/whizard/Chart.yaml index 9ce59fbe..a4111755 100644 --- a/charts/whizard/Chart.yaml +++ b/charts/whizard/Chart.yaml @@ -14,5 +14,5 @@ maintainers: email: junhaozhang@kubesphere.io - name: junot email: junotxiang@kubesphere.io -version: 0.9.3 +version: 0.9.4 appVersion: "latest" diff --git a/charts/whizard/crds/monitoring.whizard.io_queries.yaml b/charts/whizard/crds/monitoring.whizard.io_queries.yaml index 57270ef1..cc9df7da 100644 --- a/charts/whizard/crds/monitoring.whizard.io_queries.yaml +++ b/charts/whizard/crds/monitoring.whizard.io_queries.yaml @@ -1008,6 +1008,8 @@ spec: type: string description: Define which Nodes the Pods are scheduled on. type: object + promqlEngine: + type: string replicaLabelNames: description: Labels to treat as a replica indicator along which data is deduplicated. diff --git a/charts/whizard/templates/query/query.yaml b/charts/whizard/templates/query/query.yaml index 7639422a..56df14a8 100644 --- a/charts/whizard/templates/query/query.yaml +++ b/charts/whizard/templates/query/query.yaml @@ -19,6 +19,10 @@ spec: {{- end }} replicas: {{ .Values.query.replicas }} + {{- if .Values.query.promqlEngine }} + promqlEngine: {{ .Values.query.promqlEngine }} + {{- end }} + {{- with .Values.query.nodeSelector }} nodeSelector: {{- toYaml . | nindent 4 }} diff --git a/charts/whizard/values.yaml b/charts/whizard/values.yaml index 72a526b2..0b22c6ac 100644 --- a/charts/whizard/values.yaml +++ b/charts/whizard/values.yaml @@ -435,6 +435,8 @@ query: # repository: thanosio/thanos # tag: v0.28.0 + promqlEngine: thanos + resources: {} securityContext: {} nodeSelector: {} diff --git a/config/bundle.yaml b/config/bundle.yaml index 2bf2645a..549fb229 100644 --- a/config/bundle.yaml +++ b/config/bundle.yaml @@ -3285,6 +3285,8 @@ spec: type: string description: Define which Nodes the Pods are scheduled on. type: object + promqlEngine: + type: string replicaLabelNames: description: Labels to treat as a replica indicator along which data is deduplicated. items: diff --git a/config/crd/bases/monitoring.whizard.io_queries.yaml b/config/crd/bases/monitoring.whizard.io_queries.yaml index 57270ef1..cc9df7da 100644 --- a/config/crd/bases/monitoring.whizard.io_queries.yaml +++ b/config/crd/bases/monitoring.whizard.io_queries.yaml @@ -1008,6 +1008,8 @@ spec: type: string description: Define which Nodes the Pods are scheduled on. type: object + promqlEngine: + type: string replicaLabelNames: description: Labels to treat as a replica indicator along which data is deduplicated. diff --git a/pkg/api/monitoring/v1alpha1/types.go b/pkg/api/monitoring/v1alpha1/types.go index 74626702..7b43c192 100644 --- a/pkg/api/monitoring/v1alpha1/types.go +++ b/pkg/api/monitoring/v1alpha1/types.go @@ -238,6 +238,8 @@ type QuerySpec struct { HTTPServerTLSConfig *HTTPServerTLSConfig `json:"httpServerTLSConfig,omitempty"` + PromqlEngine string `json:"promqlEngine,omitempty"` + // Additional StoreApi servers from which Query component queries from Stores []QueryStores `json:"stores,omitempty"` // Selector labels that will be exposed in info endpoint. diff --git a/pkg/api/monitoring/v1alpha1/zz_generated.deepcopy.go b/pkg/api/monitoring/v1alpha1/zz_generated.deepcopy.go index 798182fb..833662dd 100644 --- a/pkg/api/monitoring/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/api/monitoring/v1alpha1/zz_generated.deepcopy.go @@ -61,6 +61,23 @@ func (in *AutoScaler) DeepCopy() *AutoScaler { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BasicAuth) DeepCopyInto(out *BasicAuth) { + *out = *in + in.Username.DeepCopyInto(&out.Username) + in.Password.DeepCopyInto(&out.Password) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth. +func (in *BasicAuth) DeepCopy() *BasicAuth { + if in == nil { + return nil + } + out := new(BasicAuth) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BlockGC) DeepCopyInto(out *BlockGC) { *out = *in @@ -146,6 +163,11 @@ func (in *CommonSpec) DeepCopyInto(out *CommonSpec) { } } in.Resources.DeepCopyInto(&out.Resources) + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(corev1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } if in.Replicas != nil { in, out := &in.Replicas, &out.Replicas *out = new(int32) @@ -341,6 +363,11 @@ func (in *GatewayList) DeepCopyObject() runtime.Object { func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { *out = *in in.CommonSpec.DeepCopyInto(&out.CommonSpec) + if in.WebConfig != nil { + in, out := &in.WebConfig, &out.WebConfig + *out = new(WebConfig) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec. @@ -368,6 +395,21 @@ func (in *GatewayStatus) DeepCopy() *GatewayStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPServerConfig) DeepCopyInto(out *HTTPServerConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPServerConfig. +func (in *HTTPServerConfig) DeepCopy() *HTTPServerConfig { + if in == nil { + return nil + } + out := new(HTTPServerConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HTTPServerTLSConfig) DeepCopyInto(out *HTTPServerTLSConfig) { *out = *in @@ -1728,3 +1770,35 @@ func (in *TimeRange) DeepCopy() *TimeRange { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebConfig) DeepCopyInto(out *WebConfig) { + *out = *in + if in.HTTPServerTLSConfig != nil { + in, out := &in.HTTPServerTLSConfig, &out.HTTPServerTLSConfig + *out = new(HTTPServerTLSConfig) + (*in).DeepCopyInto(*out) + } + if in.HTTPServerConfig != nil { + in, out := &in.HTTPServerConfig, &out.HTTPServerConfig + *out = new(HTTPServerConfig) + **out = **in + } + if in.BasicAuthUsers != nil { + in, out := &in.BasicAuthUsers, &out.BasicAuthUsers + *out = make([]BasicAuth, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebConfig. +func (in *WebConfig) DeepCopy() *WebConfig { + if in == nil { + return nil + } + out := new(WebConfig) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/controllers/monitoring/resources/query/deployment.go b/pkg/controllers/monitoring/resources/query/deployment.go index 2b9ffb04..2d763b0e 100644 --- a/pkg/controllers/monitoring/resources/query/deployment.go +++ b/pkg/controllers/monitoring/resources/query/deployment.go @@ -157,6 +157,10 @@ func (q *Query) deployment() (runtime.Object, resources.Operation, error) { d.Spec.Template.Spec.Volumes = append(d.Spec.Template.Spec.Volumes, volumes...) } + if q.query.Spec.PromqlEngine != "" { + queryContainer.Args = append(queryContainer.Args, "--query.promql-engine="+q.query.Spec.PromqlEngine) + } + if q.query.Spec.LogLevel != "" { queryContainer.Args = append(queryContainer.Args, "--log.level="+q.query.Spec.LogLevel) }