1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

chore: improve ThanosRuler documentation

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier 2024-11-15 15:10:32 +01:00
parent 0b804775b8
commit a53f3f89df
No known key found for this signature in database
GPG key ID: 0190A66C0A10FC4F
10 changed files with 631 additions and 232 deletions

232
Documentation/api.md generated
View file

@ -3849,6 +3849,7 @@ string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Version of Thanos to be deployed.</p>
</td>
</tr>
@ -3862,6 +3863,7 @@ EmbeddedObjectMetadata
</em>
</td>
<td>
<em>(Optional)</em>
<p>PodMetadata configures labels and annotations which are propagated to the ThanosRuler pods.</p>
<p>The following items are reserved and cannot be overridden:
* &ldquo;app.kubernetes.io/name&rdquo; label, set to &ldquo;thanos-ruler&rdquo;.
@ -3906,6 +3908,7 @@ See <a href="https://kubernetes.io/docs/concepts/containers/images/#image-pull-p
</em>
</td>
<td>
<em>(Optional)</em>
<p>An optional list of references to secrets in the same namespace
to use for pulling thanos images from registries
see <a href="http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod">http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod</a></p>
@ -3931,6 +3934,7 @@ int32
</em>
</td>
<td>
<em>(Optional)</em>
<p>Number of thanos ruler instances to deploy.</p>
</td>
</tr>
@ -3942,6 +3946,7 @@ map[string]string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Define which Nodes the Pods are scheduled on.</p>
</td>
</tr>
@ -3969,6 +3974,7 @@ Kubernetes core/v1.Affinity
</em>
</td>
<td>
<em>(Optional)</em>
<p>If specified, the pod&rsquo;s scheduling constraints.</p>
</td>
</tr>
@ -3982,6 +3988,7 @@ Kubernetes core/v1.Affinity
</em>
</td>
<td>
<em>(Optional)</em>
<p>If specified, the pod&rsquo;s tolerations.</p>
</td>
</tr>
@ -3995,6 +4002,7 @@ Kubernetes core/v1.Affinity
</em>
</td>
<td>
<em>(Optional)</em>
<p>If specified, the pod&rsquo;s topology spread constraints.</p>
</td>
</tr>
@ -4008,6 +4016,7 @@ Kubernetes core/v1.PodSecurityContext
</em>
</td>
<td>
<em>(Optional)</em>
<p>SecurityContext holds pod-level security attributes and common container settings.
This defaults to the default PodSecurityContext.</p>
</td>
@ -4073,6 +4082,7 @@ StorageSpec
</em>
</td>
<td>
<em>(Optional)</em>
<p>Storage spec to specify how storage shall be used.</p>
</td>
</tr>
@ -4086,6 +4096,7 @@ StorageSpec
</em>
</td>
<td>
<em>(Optional)</em>
<p>Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will
be appended to other volumes that are generated as a result of StorageSpec objects.</p>
</td>
@ -4100,6 +4111,7 @@ be appended to other volumes that are generated as a result of StorageSpec objec
</em>
</td>
<td>
<em>(Optional)</em>
<p>VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition.
VolumeMounts specified will be appended to other VolumeMounts in the ruler container,
that are generated as a result of StorageSpec objects.</p>
@ -4115,8 +4127,11 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>ObjectStorageConfig configures object storage in Thanos.
Alternative to ObjectStorageConfigFile, and lower order priority.</p>
<em>(Optional)</em>
<p>Configures object storage.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage">https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage</a></p>
<p>The operator performs no validation of the configuration.</p>
<p><code>objectStorageConfigFile</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -4127,8 +4142,11 @@ string
</em>
</td>
<td>
<p>ObjectStorageConfigFile specifies the path of the object storage configuration file.
When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.</p>
<em>(Optional)</em>
<p>Configures the path of the object storage configuration file.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage">https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage</a></p>
<p>The operator performs no validation of the configuration file.</p>
<p>This field takes precedence over <code>objectStorageConfig</code>.</p>
</td>
</tr>
<tr>
@ -4151,8 +4169,10 @@ does not bind against the Pod IP.</p>
</em>
</td>
<td>
<p>QueryEndpoints defines Thanos querier endpoints from which to query metrics.
Maps to the &ndash;query flag of thanos ruler.</p>
<em>(Optional)</em>
<p>Configures the list of Thanos Query endpoints from which to query metrics.</p>
<p>For Thanos &gt;= v0.11.0, it is recommended to use <code>queryConfig</code> instead.</p>
<p><code>queryConfig</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -4165,10 +4185,12 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>Define configuration for connecting to thanos query instances.
If this is defined, the QueryEndpoints field will be ignored.
Maps to the <code>query.config</code> CLI argument.
Only available with thanos v0.11.0 and higher.</p>
<em>(Optional)</em>
<p>Configures the list of Thanos Query endpoints from which to query metrics.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/components/rule.md/#query-api">https://thanos.io/tip/components/rule.md/#query-api</a></p>
<p>It requires Thanos &gt;= v0.11.0.</p>
<p>The operator performs no validation of the configuration.</p>
<p>This field takes precedence over <code>queryEndpoints</code>.</p>
</td>
</tr>
<tr>
@ -4179,10 +4201,10 @@ Only available with thanos v0.11.0 and higher.</p>
</em>
</td>
<td>
<p>Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher,
AlertManagersConfig should be used instead. Note: this field will be ignored
if AlertManagersConfig is specified.
Maps to the <code>alertmanagers.url</code> arg.</p>
<em>(Optional)</em>
<p>Configures the list of Alertmanager endpoints to send alerts to.</p>
<p>For Thanos &gt;= v0.10.0, it is recommended to use <code>alertmanagersConfig</code> instead.</p>
<p><code>alertmanagersConfig</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -4195,8 +4217,12 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>Define configuration for connecting to alertmanager. Only available with thanos v0.10.0
and higher. Maps to the <code>alertmanagers.config</code> arg.</p>
<em>(Optional)</em>
<p>Configures the list of Alertmanager endpoints to send alerts to.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/components/rule.md/#alertmanager">https://thanos.io/tip/components/rule.md/#alertmanager</a>.</p>
<p>It requires Thanos &gt;= v0.10.0.</p>
<p>The operator performs no validation of the configuration.</p>
<p>This field takes precedence over <code>alertmanagersUrl</code>.</p>
</td>
</tr>
<tr>
@ -4209,8 +4235,10 @@ Kubernetes meta/v1.LabelSelector
</em>
</td>
<td>
<p>A label selector to select which PrometheusRules to mount for alerting and
recording.</p>
<em>(Optional)</em>
<p>PrometheusRule objects to be selected for rule evaluation. An empty
label selector matches all objects. A null label selector matches no
objects.</p>
</td>
</tr>
<tr>
@ -4223,6 +4251,7 @@ Kubernetes meta/v1.LabelSelector
</em>
</td>
<td>
<em>(Optional)</em>
<p>Namespaces to be selected for Rules discovery. If unspecified, only
the same namespace as the ThanosRuler object is in is used.</p>
</td>
@ -4250,6 +4279,7 @@ being created.</p>
</em>
</td>
<td>
<em>(Optional)</em>
<p>List of references to PrometheusRule objects
to be excluded from enforcing a namespace label of origin.
Applies only if enforcedNamespaceLabel set to true.</p>
@ -4265,6 +4295,7 @@ Applies only if enforcedNamespaceLabel set to true.</p>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PrometheusRulesExcludedFromEnforce - list of Prometheus rules to be excluded from enforcing
of adding namespace labels. Works only if enforcedNamespaceLabel set to true.
Make sure both ruleNamespace and ruleName are set for each pair
@ -4342,6 +4373,7 @@ and must match the regular expression <code>[0-9]+(ms|s|m|h|d|w|y)</code> (milli
</em>
</td>
<td>
<em>(Optional)</em>
<p>Containers allows injecting additional containers or modifying operator generated
containers. This can be used to allow adding an authentication proxy to a ThanosRuler pod or
to change the behavior of an operator generated container. Containers described here modify
@ -4361,6 +4393,7 @@ so, you accept that this behaviour may break at any time without notice.</p>
</em>
</td>
<td>
<em>(Optional)</em>
<p>InitContainers allows adding initContainers to the pod definition. Those can be used to e.g.
fetch secrets for injection into the ThanosRuler configuration from external sources. Any
errors during the execution of an initContainer will lead to a restart of the Pod.
@ -4381,10 +4414,12 @@ Kubernetes core/v1.SecretKeySelector
</td>
<td>
<em>(Optional)</em>
<p>TracingConfig configures tracing in Thanos.</p>
<p><code>tracingConfigFile</code> takes precedence over this field.</p>
<p>Configures tracing.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/tracing.md/#configuration">https://thanos.io/tip/thanos/tracing.md/#configuration</a></p>
<p>This is an <em>experimental feature</em>, it may change in any upcoming release
in a breaking way.</p>
<p>The operator performs no validation of the configuration.</p>
<p><code>tracingConfigFile</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -4396,10 +4431,12 @@ string
</td>
<td>
<em>(Optional)</em>
<p>TracingConfig specifies the path of the tracing configuration file.</p>
<p>This field takes precedence over <code>tracingConfig</code>.</p>
<p>Configures the path of the tracing configuration file.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/tracing.md/#configuration">https://thanos.io/tip/thanos/tracing.md/#configuration</a></p>
<p>This is an <em>experimental feature</em>, it may change in any upcoming release
in a breaking way.</p>
<p>The operator performs no validation of the configuration file.</p>
<p>This field takes precedence over <code>tracingConfig</code>.</p>
</td>
</tr>
<tr>
@ -4410,8 +4447,10 @@ map[string]string
</em>
</td>
<td>
<p>Labels configure the external label pairs to ThanosRuler. A default replica label
<code>thanos_ruler_replica</code> will be always added as a label with the value of the pod&rsquo;s name and it will be dropped in the alerts.</p>
<em>(Optional)</em>
<p>Configures the external label pairs of the ThanosRuler resource.</p>
<p>A default replica label <code>thanos_ruler_replica</code> will be always added as a
label with the value of the pod&rsquo;s name.</p>
</td>
</tr>
<tr>
@ -4422,8 +4461,10 @@ map[string]string
</em>
</td>
<td>
<p>AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.
The replica label <code>thanos_ruler_replica</code> will always be dropped in alerts.</p>
<em>(Optional)</em>
<p>Configures the label names which should be dropped in Thanos Ruler
alerts.</p>
<p>The replica label <code>thanos_ruler_replica</code> will always be dropped from the alerts.</p>
</td>
</tr>
<tr>
@ -4460,6 +4501,7 @@ TLSConfig
</em>
</td>
<td>
<em>(Optional)</em>
<p>GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads
recorded rule data.
Note: Currently only the CAFile, CertFile, and KeyFile fields are supported.
@ -4504,10 +4546,13 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>AlertRelabelConfigs configures alert relabeling in ThanosRuler.
Alert relabel configurations must have the form as specified in the official Prometheus documentation:
<a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs">https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs</a>
Alternative to AlertRelabelConfigFile, and lower order priority.</p>
<em>(Optional)</em>
<p>Configures alert relabeling in Thanos Ruler.</p>
<p>Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
<a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs">https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs</a></p>
<p>The operator performs no validation of the configuration.</p>
<p><code>alertRelabelConfigFile</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -4518,8 +4563,13 @@ string
</em>
</td>
<td>
<p>AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.
When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.</p>
<em>(Optional)</em>
<p>Configures the path to the alert relabeling configuration file.</p>
<p>Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
<a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs">https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs</a></p>
<p>The operator performs no validation of the configuration file.</p>
<p>This field takes precedence over <code>alertRelabelConfig</code>.</p>
</td>
</tr>
<tr>
@ -4545,6 +4595,7 @@ When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes prece
</em>
</td>
<td>
<em>(Optional)</em>
<p>AdditionalArgs allows setting additional arguments for the ThanosRuler container.
It is intended for e.g. activating hidden flags which are not supported by
the dedicated configuration options yet. The arguments are passed as-is to the
@ -4565,6 +4616,7 @@ ThanosRulerWebSpec
</em>
</td>
<td>
<em>(Optional)</em>
<p>Defines the configuration of the ThanosRuler web server.</p>
</td>
</tr>
@ -15825,6 +15877,7 @@ string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Version of Thanos to be deployed.</p>
</td>
</tr>
@ -15838,6 +15891,7 @@ EmbeddedObjectMetadata
</em>
</td>
<td>
<em>(Optional)</em>
<p>PodMetadata configures labels and annotations which are propagated to the ThanosRuler pods.</p>
<p>The following items are reserved and cannot be overridden:
* &ldquo;app.kubernetes.io/name&rdquo; label, set to &ldquo;thanos-ruler&rdquo;.
@ -15882,6 +15936,7 @@ See <a href="https://kubernetes.io/docs/concepts/containers/images/#image-pull-p
</em>
</td>
<td>
<em>(Optional)</em>
<p>An optional list of references to secrets in the same namespace
to use for pulling thanos images from registries
see <a href="http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod">http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod</a></p>
@ -15907,6 +15962,7 @@ int32
</em>
</td>
<td>
<em>(Optional)</em>
<p>Number of thanos ruler instances to deploy.</p>
</td>
</tr>
@ -15918,6 +15974,7 @@ map[string]string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Define which Nodes the Pods are scheduled on.</p>
</td>
</tr>
@ -15945,6 +16002,7 @@ Kubernetes core/v1.Affinity
</em>
</td>
<td>
<em>(Optional)</em>
<p>If specified, the pod&rsquo;s scheduling constraints.</p>
</td>
</tr>
@ -15958,6 +16016,7 @@ Kubernetes core/v1.Affinity
</em>
</td>
<td>
<em>(Optional)</em>
<p>If specified, the pod&rsquo;s tolerations.</p>
</td>
</tr>
@ -15971,6 +16030,7 @@ Kubernetes core/v1.Affinity
</em>
</td>
<td>
<em>(Optional)</em>
<p>If specified, the pod&rsquo;s topology spread constraints.</p>
</td>
</tr>
@ -15984,6 +16044,7 @@ Kubernetes core/v1.PodSecurityContext
</em>
</td>
<td>
<em>(Optional)</em>
<p>SecurityContext holds pod-level security attributes and common container settings.
This defaults to the default PodSecurityContext.</p>
</td>
@ -16049,6 +16110,7 @@ StorageSpec
</em>
</td>
<td>
<em>(Optional)</em>
<p>Storage spec to specify how storage shall be used.</p>
</td>
</tr>
@ -16062,6 +16124,7 @@ StorageSpec
</em>
</td>
<td>
<em>(Optional)</em>
<p>Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will
be appended to other volumes that are generated as a result of StorageSpec objects.</p>
</td>
@ -16076,6 +16139,7 @@ be appended to other volumes that are generated as a result of StorageSpec objec
</em>
</td>
<td>
<em>(Optional)</em>
<p>VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition.
VolumeMounts specified will be appended to other VolumeMounts in the ruler container,
that are generated as a result of StorageSpec objects.</p>
@ -16091,8 +16155,11 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>ObjectStorageConfig configures object storage in Thanos.
Alternative to ObjectStorageConfigFile, and lower order priority.</p>
<em>(Optional)</em>
<p>Configures object storage.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage">https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage</a></p>
<p>The operator performs no validation of the configuration.</p>
<p><code>objectStorageConfigFile</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -16103,8 +16170,11 @@ string
</em>
</td>
<td>
<p>ObjectStorageConfigFile specifies the path of the object storage configuration file.
When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.</p>
<em>(Optional)</em>
<p>Configures the path of the object storage configuration file.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage">https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage</a></p>
<p>The operator performs no validation of the configuration file.</p>
<p>This field takes precedence over <code>objectStorageConfig</code>.</p>
</td>
</tr>
<tr>
@ -16127,8 +16197,10 @@ does not bind against the Pod IP.</p>
</em>
</td>
<td>
<p>QueryEndpoints defines Thanos querier endpoints from which to query metrics.
Maps to the &ndash;query flag of thanos ruler.</p>
<em>(Optional)</em>
<p>Configures the list of Thanos Query endpoints from which to query metrics.</p>
<p>For Thanos &gt;= v0.11.0, it is recommended to use <code>queryConfig</code> instead.</p>
<p><code>queryConfig</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -16141,10 +16213,12 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>Define configuration for connecting to thanos query instances.
If this is defined, the QueryEndpoints field will be ignored.
Maps to the <code>query.config</code> CLI argument.
Only available with thanos v0.11.0 and higher.</p>
<em>(Optional)</em>
<p>Configures the list of Thanos Query endpoints from which to query metrics.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/components/rule.md/#query-api">https://thanos.io/tip/components/rule.md/#query-api</a></p>
<p>It requires Thanos &gt;= v0.11.0.</p>
<p>The operator performs no validation of the configuration.</p>
<p>This field takes precedence over <code>queryEndpoints</code>.</p>
</td>
</tr>
<tr>
@ -16155,10 +16229,10 @@ Only available with thanos v0.11.0 and higher.</p>
</em>
</td>
<td>
<p>Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher,
AlertManagersConfig should be used instead. Note: this field will be ignored
if AlertManagersConfig is specified.
Maps to the <code>alertmanagers.url</code> arg.</p>
<em>(Optional)</em>
<p>Configures the list of Alertmanager endpoints to send alerts to.</p>
<p>For Thanos &gt;= v0.10.0, it is recommended to use <code>alertmanagersConfig</code> instead.</p>
<p><code>alertmanagersConfig</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -16171,8 +16245,12 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>Define configuration for connecting to alertmanager. Only available with thanos v0.10.0
and higher. Maps to the <code>alertmanagers.config</code> arg.</p>
<em>(Optional)</em>
<p>Configures the list of Alertmanager endpoints to send alerts to.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/components/rule.md/#alertmanager">https://thanos.io/tip/components/rule.md/#alertmanager</a>.</p>
<p>It requires Thanos &gt;= v0.10.0.</p>
<p>The operator performs no validation of the configuration.</p>
<p>This field takes precedence over <code>alertmanagersUrl</code>.</p>
</td>
</tr>
<tr>
@ -16185,8 +16263,10 @@ Kubernetes meta/v1.LabelSelector
</em>
</td>
<td>
<p>A label selector to select which PrometheusRules to mount for alerting and
recording.</p>
<em>(Optional)</em>
<p>PrometheusRule objects to be selected for rule evaluation. An empty
label selector matches all objects. A null label selector matches no
objects.</p>
</td>
</tr>
<tr>
@ -16199,6 +16279,7 @@ Kubernetes meta/v1.LabelSelector
</em>
</td>
<td>
<em>(Optional)</em>
<p>Namespaces to be selected for Rules discovery. If unspecified, only
the same namespace as the ThanosRuler object is in is used.</p>
</td>
@ -16226,6 +16307,7 @@ being created.</p>
</em>
</td>
<td>
<em>(Optional)</em>
<p>List of references to PrometheusRule objects
to be excluded from enforcing a namespace label of origin.
Applies only if enforcedNamespaceLabel set to true.</p>
@ -16241,6 +16323,7 @@ Applies only if enforcedNamespaceLabel set to true.</p>
</em>
</td>
<td>
<em>(Optional)</em>
<p>PrometheusRulesExcludedFromEnforce - list of Prometheus rules to be excluded from enforcing
of adding namespace labels. Works only if enforcedNamespaceLabel set to true.
Make sure both ruleNamespace and ruleName are set for each pair
@ -16318,6 +16401,7 @@ and must match the regular expression <code>[0-9]+(ms|s|m|h|d|w|y)</code> (milli
</em>
</td>
<td>
<em>(Optional)</em>
<p>Containers allows injecting additional containers or modifying operator generated
containers. This can be used to allow adding an authentication proxy to a ThanosRuler pod or
to change the behavior of an operator generated container. Containers described here modify
@ -16337,6 +16421,7 @@ so, you accept that this behaviour may break at any time without notice.</p>
</em>
</td>
<td>
<em>(Optional)</em>
<p>InitContainers allows adding initContainers to the pod definition. Those can be used to e.g.
fetch secrets for injection into the ThanosRuler configuration from external sources. Any
errors during the execution of an initContainer will lead to a restart of the Pod.
@ -16357,10 +16442,12 @@ Kubernetes core/v1.SecretKeySelector
</td>
<td>
<em>(Optional)</em>
<p>TracingConfig configures tracing in Thanos.</p>
<p><code>tracingConfigFile</code> takes precedence over this field.</p>
<p>Configures tracing.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/tracing.md/#configuration">https://thanos.io/tip/thanos/tracing.md/#configuration</a></p>
<p>This is an <em>experimental feature</em>, it may change in any upcoming release
in a breaking way.</p>
<p>The operator performs no validation of the configuration.</p>
<p><code>tracingConfigFile</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -16372,10 +16459,12 @@ string
</td>
<td>
<em>(Optional)</em>
<p>TracingConfig specifies the path of the tracing configuration file.</p>
<p>This field takes precedence over <code>tracingConfig</code>.</p>
<p>Configures the path of the tracing configuration file.</p>
<p>The configuration format is defined at <a href="https://thanos.io/tip/thanos/tracing.md/#configuration">https://thanos.io/tip/thanos/tracing.md/#configuration</a></p>
<p>This is an <em>experimental feature</em>, it may change in any upcoming release
in a breaking way.</p>
<p>The operator performs no validation of the configuration file.</p>
<p>This field takes precedence over <code>tracingConfig</code>.</p>
</td>
</tr>
<tr>
@ -16386,8 +16475,10 @@ map[string]string
</em>
</td>
<td>
<p>Labels configure the external label pairs to ThanosRuler. A default replica label
<code>thanos_ruler_replica</code> will be always added as a label with the value of the pod&rsquo;s name and it will be dropped in the alerts.</p>
<em>(Optional)</em>
<p>Configures the external label pairs of the ThanosRuler resource.</p>
<p>A default replica label <code>thanos_ruler_replica</code> will be always added as a
label with the value of the pod&rsquo;s name.</p>
</td>
</tr>
<tr>
@ -16398,8 +16489,10 @@ map[string]string
</em>
</td>
<td>
<p>AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.
The replica label <code>thanos_ruler_replica</code> will always be dropped in alerts.</p>
<em>(Optional)</em>
<p>Configures the label names which should be dropped in Thanos Ruler
alerts.</p>
<p>The replica label <code>thanos_ruler_replica</code> will always be dropped from the alerts.</p>
</td>
</tr>
<tr>
@ -16436,6 +16529,7 @@ TLSConfig
</em>
</td>
<td>
<em>(Optional)</em>
<p>GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads
recorded rule data.
Note: Currently only the CAFile, CertFile, and KeyFile fields are supported.
@ -16480,10 +16574,13 @@ Kubernetes core/v1.SecretKeySelector
</em>
</td>
<td>
<p>AlertRelabelConfigs configures alert relabeling in ThanosRuler.
Alert relabel configurations must have the form as specified in the official Prometheus documentation:
<a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs">https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs</a>
Alternative to AlertRelabelConfigFile, and lower order priority.</p>
<em>(Optional)</em>
<p>Configures alert relabeling in Thanos Ruler.</p>
<p>Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
<a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs">https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs</a></p>
<p>The operator performs no validation of the configuration.</p>
<p><code>alertRelabelConfigFile</code> takes precedence over this field.</p>
</td>
</tr>
<tr>
@ -16494,8 +16591,13 @@ string
</em>
</td>
<td>
<p>AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.
When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.</p>
<em>(Optional)</em>
<p>Configures the path to the alert relabeling configuration file.</p>
<p>Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
<a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs">https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs</a></p>
<p>The operator performs no validation of the configuration file.</p>
<p>This field takes precedence over <code>alertRelabelConfig</code>.</p>
</td>
</tr>
<tr>
@ -16521,6 +16623,7 @@ When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes prece
</em>
</td>
<td>
<em>(Optional)</em>
<p>AdditionalArgs allows setting additional arguments for the ThanosRuler container.
It is intended for e.g. activating hidden flags which are not supported by
the dedicated configuration options yet. The arguments are passed as-is to the
@ -16541,6 +16644,7 @@ ThanosRulerWebSpec
</em>
</td>
<td>
<em>(Optional)</em>
<p>Defines the configuration of the ThanosRuler web server.</p>
</td>
</tr>

113
bundle.yaml generated
View file

@ -58250,8 +58250,10 @@ spec:
type: object
alertDropLabels:
description: |-
AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.
The replica label `thanos_ruler_replica` will always be dropped in alerts.
Configures the label names which should be dropped in Thanos Ruler
alerts.
The replica label `thanos_ruler_replica` will always be dropped from the alerts.
items:
type: string
type: array
@ -58263,15 +58265,27 @@ spec:
type: string
alertRelabelConfigFile:
description: |-
AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.
When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.
Configures the path to the alert relabeling configuration file.
Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
The operator performs no validation of the configuration file.
This field takes precedence over `alertRelabelConfig`.
type: string
alertRelabelConfigs:
description: |-
AlertRelabelConfigs configures alert relabeling in ThanosRuler.
Alert relabel configurations must have the form as specified in the official Prometheus documentation:
Configures alert relabeling in Thanos Ruler.
Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
Alternative to AlertRelabelConfigFile, and lower order priority.
The operator performs no validation of the configuration.
`alertRelabelConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -58295,8 +58309,15 @@ spec:
x-kubernetes-map-type: atomic
alertmanagersConfig:
description: |-
Define configuration for connecting to alertmanager. Only available with thanos v0.10.0
and higher. Maps to the `alertmanagers.config` arg.
Configures the list of Alertmanager endpoints to send alerts to.
The configuration format is defined at https://thanos.io/tip/components/rule.md/#alertmanager.
It requires Thanos >= v0.10.0.
The operator performs no validation of the configuration.
This field takes precedence over `alertmanagersUrl`.
properties:
key:
description: The key of the secret to select from. Must be a
@ -58320,10 +58341,11 @@ spec:
x-kubernetes-map-type: atomic
alertmanagersUrl:
description: |-
Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher,
AlertManagersConfig should be used instead. Note: this field will be ignored
if AlertManagersConfig is specified.
Maps to the `alertmanagers.url` arg.
Configures the list of Alertmanager endpoints to send alerts to.
For Thanos >= v0.10.0, it is recommended to use `alertmanagersConfig` instead.
`alertmanagersConfig` takes precedence over this field.
items:
type: string
type: array
@ -61527,8 +61549,10 @@ spec:
additionalProperties:
type: string
description: |-
Labels configure the external label pairs to ThanosRuler. A default replica label
`thanos_ruler_replica` will be always added as a label with the value of the pod's name and it will be dropped in the alerts.
Configures the external label pairs of the ThanosRuler resource.
A default replica label `thanos_ruler_replica` will be always added as a
label with the value of the pod's name.
type: object
listenLocal:
description: |-
@ -61566,8 +61590,13 @@ spec:
type: object
objectStorageConfig:
description: |-
ObjectStorageConfig configures object storage in Thanos.
Alternative to ObjectStorageConfigFile, and lower order priority.
Configures object storage.
The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
The operator performs no validation of the configuration.
`objectStorageConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -61591,8 +61620,13 @@ spec:
x-kubernetes-map-type: atomic
objectStorageConfigFile:
description: |-
ObjectStorageConfigFile specifies the path of the object storage configuration file.
When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.
Configures the path of the object storage configuration file.
The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
The operator performs no validation of the configuration file.
This field takes precedence over `objectStorageConfig`.
type: string
paused:
description: |-
@ -61672,10 +61706,15 @@ spec:
type: array
queryConfig:
description: |-
Define configuration for connecting to thanos query instances.
If this is defined, the QueryEndpoints field will be ignored.
Maps to the `query.config` CLI argument.
Only available with thanos v0.11.0 and higher.
Configures the list of Thanos Query endpoints from which to query metrics.
The configuration format is defined at https://thanos.io/tip/components/rule.md/#query-api
It requires Thanos >= v0.11.0.
The operator performs no validation of the configuration.
This field takes precedence over `queryEndpoints`.
properties:
key:
description: The key of the secret to select from. Must be a
@ -61699,8 +61738,11 @@ spec:
x-kubernetes-map-type: atomic
queryEndpoints:
description: |-
QueryEndpoints defines Thanos querier endpoints from which to query metrics.
Maps to the --query flag of thanos ruler.
Configures the list of Thanos Query endpoints from which to query metrics.
For Thanos >= v0.11.0, it is recommended to use `queryConfig` instead.
`queryConfig` takes precedence over this field.
items:
type: string
type: array
@ -61830,8 +61872,9 @@ spec:
x-kubernetes-map-type: atomic
ruleSelector:
description: |-
A label selector to select which PrometheusRules to mount for alerting and
recording.
PrometheusRule objects to be selected for rule evaluation. An empty
label selector matches all objects. A null label selector matches no
objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
@ -63028,12 +63071,16 @@ spec:
type: array
tracingConfig:
description: |-
TracingConfig configures tracing in Thanos.
Configures tracing.
`tracingConfigFile` takes precedence over this field.
The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
This is an *experimental feature*, it may change in any upcoming release
in a breaking way.
The operator performs no validation of the configuration.
`tracingConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -63057,12 +63104,16 @@ spec:
x-kubernetes-map-type: atomic
tracingConfigFile:
description: |-
TracingConfig specifies the path of the tracing configuration file.
Configures the path of the tracing configuration file.
This field takes precedence over `tracingConfig`.
The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
This is an *experimental feature*, it may change in any upcoming release
in a breaking way.
The operator performs no validation of the configuration file.
This field takes precedence over `tracingConfig`.
type: string
version:
description: Version of Thanos to be deployed.

View file

@ -1024,8 +1024,10 @@ spec:
type: object
alertDropLabels:
description: |-
AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.
The replica label `thanos_ruler_replica` will always be dropped in alerts.
Configures the label names which should be dropped in Thanos Ruler
alerts.
The replica label `thanos_ruler_replica` will always be dropped from the alerts.
items:
type: string
type: array
@ -1037,15 +1039,27 @@ spec:
type: string
alertRelabelConfigFile:
description: |-
AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.
When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.
Configures the path to the alert relabeling configuration file.
Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
The operator performs no validation of the configuration file.
This field takes precedence over `alertRelabelConfig`.
type: string
alertRelabelConfigs:
description: |-
AlertRelabelConfigs configures alert relabeling in ThanosRuler.
Alert relabel configurations must have the form as specified in the official Prometheus documentation:
Configures alert relabeling in Thanos Ruler.
Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
Alternative to AlertRelabelConfigFile, and lower order priority.
The operator performs no validation of the configuration.
`alertRelabelConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -1069,8 +1083,15 @@ spec:
x-kubernetes-map-type: atomic
alertmanagersConfig:
description: |-
Define configuration for connecting to alertmanager. Only available with thanos v0.10.0
and higher. Maps to the `alertmanagers.config` arg.
Configures the list of Alertmanager endpoints to send alerts to.
The configuration format is defined at https://thanos.io/tip/components/rule.md/#alertmanager.
It requires Thanos >= v0.10.0.
The operator performs no validation of the configuration.
This field takes precedence over `alertmanagersUrl`.
properties:
key:
description: The key of the secret to select from. Must be a
@ -1094,10 +1115,11 @@ spec:
x-kubernetes-map-type: atomic
alertmanagersUrl:
description: |-
Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher,
AlertManagersConfig should be used instead. Note: this field will be ignored
if AlertManagersConfig is specified.
Maps to the `alertmanagers.url` arg.
Configures the list of Alertmanager endpoints to send alerts to.
For Thanos >= v0.10.0, it is recommended to use `alertmanagersConfig` instead.
`alertmanagersConfig` takes precedence over this field.
items:
type: string
type: array
@ -4301,8 +4323,10 @@ spec:
additionalProperties:
type: string
description: |-
Labels configure the external label pairs to ThanosRuler. A default replica label
`thanos_ruler_replica` will be always added as a label with the value of the pod's name and it will be dropped in the alerts.
Configures the external label pairs of the ThanosRuler resource.
A default replica label `thanos_ruler_replica` will be always added as a
label with the value of the pod's name.
type: object
listenLocal:
description: |-
@ -4340,8 +4364,13 @@ spec:
type: object
objectStorageConfig:
description: |-
ObjectStorageConfig configures object storage in Thanos.
Alternative to ObjectStorageConfigFile, and lower order priority.
Configures object storage.
The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
The operator performs no validation of the configuration.
`objectStorageConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -4365,8 +4394,13 @@ spec:
x-kubernetes-map-type: atomic
objectStorageConfigFile:
description: |-
ObjectStorageConfigFile specifies the path of the object storage configuration file.
When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.
Configures the path of the object storage configuration file.
The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
The operator performs no validation of the configuration file.
This field takes precedence over `objectStorageConfig`.
type: string
paused:
description: |-
@ -4446,10 +4480,15 @@ spec:
type: array
queryConfig:
description: |-
Define configuration for connecting to thanos query instances.
If this is defined, the QueryEndpoints field will be ignored.
Maps to the `query.config` CLI argument.
Only available with thanos v0.11.0 and higher.
Configures the list of Thanos Query endpoints from which to query metrics.
The configuration format is defined at https://thanos.io/tip/components/rule.md/#query-api
It requires Thanos >= v0.11.0.
The operator performs no validation of the configuration.
This field takes precedence over `queryEndpoints`.
properties:
key:
description: The key of the secret to select from. Must be a
@ -4473,8 +4512,11 @@ spec:
x-kubernetes-map-type: atomic
queryEndpoints:
description: |-
QueryEndpoints defines Thanos querier endpoints from which to query metrics.
Maps to the --query flag of thanos ruler.
Configures the list of Thanos Query endpoints from which to query metrics.
For Thanos >= v0.11.0, it is recommended to use `queryConfig` instead.
`queryConfig` takes precedence over this field.
items:
type: string
type: array
@ -4604,8 +4646,9 @@ spec:
x-kubernetes-map-type: atomic
ruleSelector:
description: |-
A label selector to select which PrometheusRules to mount for alerting and
recording.
PrometheusRule objects to be selected for rule evaluation. An empty
label selector matches all objects. A null label selector matches no
objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
@ -5802,12 +5845,16 @@ spec:
type: array
tracingConfig:
description: |-
TracingConfig configures tracing in Thanos.
Configures tracing.
`tracingConfigFile` takes precedence over this field.
The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
This is an *experimental feature*, it may change in any upcoming release
in a breaking way.
The operator performs no validation of the configuration.
`tracingConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -5831,12 +5878,16 @@ spec:
x-kubernetes-map-type: atomic
tracingConfigFile:
description: |-
TracingConfig specifies the path of the tracing configuration file.
Configures the path of the tracing configuration file.
This field takes precedence over `tracingConfig`.
The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
This is an *experimental feature*, it may change in any upcoming release
in a breaking way.
The operator performs no validation of the configuration file.
This field takes precedence over `tracingConfig`.
type: string
version:
description: Version of Thanos to be deployed.

View file

@ -1025,8 +1025,10 @@ spec:
type: object
alertDropLabels:
description: |-
AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.
The replica label `thanos_ruler_replica` will always be dropped in alerts.
Configures the label names which should be dropped in Thanos Ruler
alerts.
The replica label `thanos_ruler_replica` will always be dropped from the alerts.
items:
type: string
type: array
@ -1038,15 +1040,27 @@ spec:
type: string
alertRelabelConfigFile:
description: |-
AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.
When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.
Configures the path to the alert relabeling configuration file.
Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
The operator performs no validation of the configuration file.
This field takes precedence over `alertRelabelConfig`.
type: string
alertRelabelConfigs:
description: |-
AlertRelabelConfigs configures alert relabeling in ThanosRuler.
Alert relabel configurations must have the form as specified in the official Prometheus documentation:
Configures alert relabeling in Thanos Ruler.
Alert relabel configuration must have the form as specified in the
official Prometheus documentation:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
Alternative to AlertRelabelConfigFile, and lower order priority.
The operator performs no validation of the configuration.
`alertRelabelConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -1070,8 +1084,15 @@ spec:
x-kubernetes-map-type: atomic
alertmanagersConfig:
description: |-
Define configuration for connecting to alertmanager. Only available with thanos v0.10.0
and higher. Maps to the `alertmanagers.config` arg.
Configures the list of Alertmanager endpoints to send alerts to.
The configuration format is defined at https://thanos.io/tip/components/rule.md/#alertmanager.
It requires Thanos >= v0.10.0.
The operator performs no validation of the configuration.
This field takes precedence over `alertmanagersUrl`.
properties:
key:
description: The key of the secret to select from. Must be a
@ -1095,10 +1116,11 @@ spec:
x-kubernetes-map-type: atomic
alertmanagersUrl:
description: |-
Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher,
AlertManagersConfig should be used instead. Note: this field will be ignored
if AlertManagersConfig is specified.
Maps to the `alertmanagers.url` arg.
Configures the list of Alertmanager endpoints to send alerts to.
For Thanos >= v0.10.0, it is recommended to use `alertmanagersConfig` instead.
`alertmanagersConfig` takes precedence over this field.
items:
type: string
type: array
@ -4302,8 +4324,10 @@ spec:
additionalProperties:
type: string
description: |-
Labels configure the external label pairs to ThanosRuler. A default replica label
`thanos_ruler_replica` will be always added as a label with the value of the pod's name and it will be dropped in the alerts.
Configures the external label pairs of the ThanosRuler resource.
A default replica label `thanos_ruler_replica` will be always added as a
label with the value of the pod's name.
type: object
listenLocal:
description: |-
@ -4341,8 +4365,13 @@ spec:
type: object
objectStorageConfig:
description: |-
ObjectStorageConfig configures object storage in Thanos.
Alternative to ObjectStorageConfigFile, and lower order priority.
Configures object storage.
The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
The operator performs no validation of the configuration.
`objectStorageConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -4366,8 +4395,13 @@ spec:
x-kubernetes-map-type: atomic
objectStorageConfigFile:
description: |-
ObjectStorageConfigFile specifies the path of the object storage configuration file.
When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.
Configures the path of the object storage configuration file.
The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
The operator performs no validation of the configuration file.
This field takes precedence over `objectStorageConfig`.
type: string
paused:
description: |-
@ -4447,10 +4481,15 @@ spec:
type: array
queryConfig:
description: |-
Define configuration for connecting to thanos query instances.
If this is defined, the QueryEndpoints field will be ignored.
Maps to the `query.config` CLI argument.
Only available with thanos v0.11.0 and higher.
Configures the list of Thanos Query endpoints from which to query metrics.
The configuration format is defined at https://thanos.io/tip/components/rule.md/#query-api
It requires Thanos >= v0.11.0.
The operator performs no validation of the configuration.
This field takes precedence over `queryEndpoints`.
properties:
key:
description: The key of the secret to select from. Must be a
@ -4474,8 +4513,11 @@ spec:
x-kubernetes-map-type: atomic
queryEndpoints:
description: |-
QueryEndpoints defines Thanos querier endpoints from which to query metrics.
Maps to the --query flag of thanos ruler.
Configures the list of Thanos Query endpoints from which to query metrics.
For Thanos >= v0.11.0, it is recommended to use `queryConfig` instead.
`queryConfig` takes precedence over this field.
items:
type: string
type: array
@ -4605,8 +4647,9 @@ spec:
x-kubernetes-map-type: atomic
ruleSelector:
description: |-
A label selector to select which PrometheusRules to mount for alerting and
recording.
PrometheusRule objects to be selected for rule evaluation. An empty
label selector matches all objects. A null label selector matches no
objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
@ -5803,12 +5846,16 @@ spec:
type: array
tracingConfig:
description: |-
TracingConfig configures tracing in Thanos.
Configures tracing.
`tracingConfigFile` takes precedence over this field.
The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
This is an *experimental feature*, it may change in any upcoming release
in a breaking way.
The operator performs no validation of the configuration.
`tracingConfigFile` takes precedence over this field.
properties:
key:
description: The key of the secret to select from. Must be a
@ -5832,12 +5879,16 @@ spec:
x-kubernetes-map-type: atomic
tracingConfigFile:
description: |-
TracingConfig specifies the path of the tracing configuration file.
Configures the path of the tracing configuration file.
This field takes precedence over `tracingConfig`.
The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
This is an *experimental feature*, it may change in any upcoming release
in a breaking way.
The operator performs no validation of the configuration file.
This field takes precedence over `tracingConfig`.
type: string
version:
description: Version of Thanos to be deployed.

View file

@ -864,7 +864,7 @@
"type": "object"
},
"alertDropLabels": {
"description": "AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.\nThe replica label `thanos_ruler_replica` will always be dropped in alerts.",
"description": "Configures the label names which should be dropped in Thanos Ruler\nalerts.\n\nThe replica label `thanos_ruler_replica` will always be dropped from the alerts.",
"items": {
"type": "string"
},
@ -875,11 +875,11 @@
"type": "string"
},
"alertRelabelConfigFile": {
"description": "AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.\nWhen used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.",
"description": "Configures the path to the alert relabeling configuration file.\n\nAlert relabel configuration must have the form as specified in the\nofficial Prometheus documentation:\nhttps://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs\n\nThe operator performs no validation of the configuration file.\n\nThis field takes precedence over `alertRelabelConfig`.",
"type": "string"
},
"alertRelabelConfigs": {
"description": "AlertRelabelConfigs configures alert relabeling in ThanosRuler.\nAlert relabel configurations must have the form as specified in the official Prometheus documentation:\nhttps://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs\nAlternative to AlertRelabelConfigFile, and lower order priority.",
"description": "Configures alert relabeling in Thanos Ruler.\n\nAlert relabel configuration must have the form as specified in the\nofficial Prometheus documentation:\nhttps://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs\n\nThe operator performs no validation of the configuration.\n\n`alertRelabelConfigFile` takes precedence over this field.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
@ -902,7 +902,7 @@
"x-kubernetes-map-type": "atomic"
},
"alertmanagersConfig": {
"description": "Define configuration for connecting to alertmanager. Only available with thanos v0.10.0\nand higher. Maps to the `alertmanagers.config` arg.",
"description": "Configures the list of Alertmanager endpoints to send alerts to.\n\nThe configuration format is defined at https://thanos.io/tip/components/rule.md/#alertmanager.\n\nIt requires Thanos >= v0.10.0.\n\nThe operator performs no validation of the configuration.\n\nThis field takes precedence over `alertmanagersUrl`.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
@ -925,7 +925,7 @@
"x-kubernetes-map-type": "atomic"
},
"alertmanagersUrl": {
"description": "Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher,\nAlertManagersConfig should be used instead. Note: this field will be ignored\nif AlertManagersConfig is specified.\nMaps to the `alertmanagers.url` arg.",
"description": "Configures the list of Alertmanager endpoints to send alerts to.\n\nFor Thanos >= v0.10.0, it is recommended to use `alertmanagersConfig` instead.\n\n`alertmanagersConfig` takes precedence over this field.",
"items": {
"type": "string"
},
@ -3813,7 +3813,7 @@
"additionalProperties": {
"type": "string"
},
"description": "Labels configure the external label pairs to ThanosRuler. A default replica label\n`thanos_ruler_replica` will be always added as a label with the value of the pod's name and it will be dropped in the alerts.",
"description": "Configures the external label pairs of the ThanosRuler resource.\n\nA default replica label `thanos_ruler_replica` will be always added as a\nlabel with the value of the pod's name.",
"type": "object"
},
"listenLocal": {
@ -3853,7 +3853,7 @@
"type": "object"
},
"objectStorageConfig": {
"description": "ObjectStorageConfig configures object storage in Thanos.\nAlternative to ObjectStorageConfigFile, and lower order priority.",
"description": "Configures object storage.\n\nThe configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage\n\nThe operator performs no validation of the configuration.\n\n`objectStorageConfigFile` takes precedence over this field.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
@ -3876,7 +3876,7 @@
"x-kubernetes-map-type": "atomic"
},
"objectStorageConfigFile": {
"description": "ObjectStorageConfigFile specifies the path of the object storage configuration file.\nWhen used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.",
"description": "Configures the path of the object storage configuration file.\n\nThe configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage\n\nThe operator performs no validation of the configuration file.\n\nThis field takes precedence over `objectStorageConfig`.",
"type": "string"
},
"paused": {
@ -3939,7 +3939,7 @@
"type": "array"
},
"queryConfig": {
"description": "Define configuration for connecting to thanos query instances.\nIf this is defined, the QueryEndpoints field will be ignored.\nMaps to the `query.config` CLI argument.\nOnly available with thanos v0.11.0 and higher.",
"description": "Configures the list of Thanos Query endpoints from which to query metrics.\n\nThe configuration format is defined at https://thanos.io/tip/components/rule.md/#query-api\n\nIt requires Thanos >= v0.11.0.\n\nThe operator performs no validation of the configuration.\n\nThis field takes precedence over `queryEndpoints`.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
@ -3962,7 +3962,7 @@
"x-kubernetes-map-type": "atomic"
},
"queryEndpoints": {
"description": "QueryEndpoints defines Thanos querier endpoints from which to query metrics.\nMaps to the --query flag of thanos ruler.",
"description": "Configures the list of Thanos Query endpoints from which to query metrics.\n\nFor Thanos >= v0.11.0, it is recommended to use `queryConfig` instead.\n\n`queryConfig` takes precedence over this field.",
"items": {
"type": "string"
},
@ -4092,7 +4092,7 @@
"x-kubernetes-map-type": "atomic"
},
"ruleSelector": {
"description": "A label selector to select which PrometheusRules to mount for alerting and\nrecording.",
"description": "PrometheusRule objects to be selected for rule evaluation. An empty\nlabel selector matches all objects. A null label selector matches no\nobjects.",
"properties": {
"matchExpressions": {
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
@ -4946,7 +4946,7 @@
"type": "array"
},
"tracingConfig": {
"description": "TracingConfig configures tracing in Thanos.\n\n`tracingConfigFile` takes precedence over this field.\n\nThis is an *experimental feature*, it may change in any upcoming release\nin a breaking way.",
"description": "Configures tracing.\n\nThe configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration\n\nThis is an *experimental feature*, it may change in any upcoming release\nin a breaking way.\n\nThe operator performs no validation of the configuration.\n\n`tracingConfigFile` takes precedence over this field.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
@ -4969,7 +4969,7 @@
"x-kubernetes-map-type": "atomic"
},
"tracingConfigFile": {
"description": "TracingConfig specifies the path of the tracing configuration file.\n\nThis field takes precedence over `tracingConfig`.\n\nThis is an *experimental feature*, it may change in any upcoming release\nin a breaking way.",
"description": "Configures the path of the tracing configuration file.\n\nThe configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration\n\nThis is an *experimental feature*, it may change in any upcoming release\nin a breaking way.\n\nThe operator performs no validation of the configuration file.\n\nThis field takes precedence over `tracingConfig`.",
"type": "string"
},
"version": {

View file

@ -71,7 +71,9 @@ type ThanosRulerList struct {
// +k8s:openapi-gen=true
type ThanosRulerSpec struct {
// Version of Thanos to be deployed.
Version string `json:"version,omitempty"`
// +optional
Version *string `json:"version,omitempty"`
// PodMetadata configures labels and annotations which are propagated to the ThanosRuler pods.
//
// The following items are reserved and cannot be overridden:
@ -80,7 +82,9 @@ type ThanosRulerSpec struct {
// * "app.kubernetes.io/instance" label, set to the name of the ThanosRuler instance.
// * "thanos-ruler" label, set to the name of the ThanosRuler instance.
// * "kubectl.kubernetes.io/default-container" annotation, set to "thanos-ruler".
// +optional
PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"`
// Thanos container image URL.
Image string `json:"image,omitempty"`
// Image pull policy for the 'thanos', 'init-config-reloader' and 'config-reloader' containers.
@ -90,26 +94,40 @@ type ThanosRulerSpec struct {
// An optional list of references to secrets in the same namespace
// to use for pulling thanos images from registries
// see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
// +optional
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// When a ThanosRuler deployment is paused, no actions except for deletion
// will be performed on the underlying objects.
Paused bool `json:"paused,omitempty"`
// Number of thanos ruler instances to deploy.
// +optional
Replicas *int32 `json:"replicas,omitempty"`
// Define which Nodes the Pods are scheduled on.
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Resources defines the resource requirements for single Pods.
// If not provided, no requests/limits will be set
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// If specified, the pod's scheduling constraints.
// +optional
Affinity *v1.Affinity `json:"affinity,omitempty"`
// If specified, the pod's tolerations.
// +optional
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// If specified, the pod's topology spread constraints.
// +optional
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// This defaults to the default PodSecurityContext.
// +optional
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
// Defines the DNS policy for the pods.
//
// +optional
@ -121,49 +139,104 @@ type ThanosRulerSpec struct {
// Priority class assigned to the Pods
PriorityClassName string `json:"priorityClassName,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the
// Thanos Ruler Pods.
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// Storage spec to specify how storage shall be used.
// +optional
Storage *StorageSpec `json:"storage,omitempty"`
// Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will
// be appended to other volumes that are generated as a result of StorageSpec objects.
// +optional
Volumes []v1.Volume `json:"volumes,omitempty"`
// VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition.
// VolumeMounts specified will be appended to other VolumeMounts in the ruler container,
// that are generated as a result of StorageSpec objects.
// +optional
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// ObjectStorageConfig configures object storage in Thanos.
// Alternative to ObjectStorageConfigFile, and lower order priority.
// Configures object storage.
//
// The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
//
// The operator performs no validation of the configuration.
//
// `objectStorageConfigFile` takes precedence over this field.
//
// +optional
ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"`
// ObjectStorageConfigFile specifies the path of the object storage configuration file.
// When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.
// Configures the path of the object storage configuration file.
//
// The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
//
// The operator performs no validation of the configuration file.
//
// This field takes precedence over `objectStorageConfig`.
//
// +optional
ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"`
// ListenLocal makes the Thanos ruler listen on loopback, so that it
// does not bind against the Pod IP.
ListenLocal bool `json:"listenLocal,omitempty"`
// QueryEndpoints defines Thanos querier endpoints from which to query metrics.
// Maps to the --query flag of thanos ruler.
// Configures the list of Thanos Query endpoints from which to query metrics.
//
// For Thanos >= v0.11.0, it is recommended to use `queryConfig` instead.
//
// `queryConfig` takes precedence over this field.
//
// +optional
QueryEndpoints []string `json:"queryEndpoints,omitempty"`
// Define configuration for connecting to thanos query instances.
// If this is defined, the QueryEndpoints field will be ignored.
// Maps to the `query.config` CLI argument.
// Only available with thanos v0.11.0 and higher.
// Configures the list of Thanos Query endpoints from which to query metrics.
//
// The configuration format is defined at https://thanos.io/tip/components/rule.md/#query-api
//
// It requires Thanos >= v0.11.0.
//
// The operator performs no validation of the configuration.
//
// This field takes precedence over `queryEndpoints`.
//
// +optional
QueryConfig *v1.SecretKeySelector `json:"queryConfig,omitempty"`
// Define URLs to send alerts to Alertmanager. For Thanos v0.10.0 and higher,
// AlertManagersConfig should be used instead. Note: this field will be ignored
// if AlertManagersConfig is specified.
// Maps to the `alertmanagers.url` arg.
// Configures the list of Alertmanager endpoints to send alerts to.
//
// For Thanos >= v0.10.0, it is recommended to use `alertmanagersConfig` instead.
//
// `alertmanagersConfig` takes precedence over this field.
//
// +optional
AlertManagersURL []string `json:"alertmanagersUrl,omitempty"`
// Define configuration for connecting to alertmanager. Only available with thanos v0.10.0
// and higher. Maps to the `alertmanagers.config` arg.
// Configures the list of Alertmanager endpoints to send alerts to.
//
// The configuration format is defined at https://thanos.io/tip/components/rule.md/#alertmanager.
//
// It requires Thanos >= v0.10.0.
//
// The operator performs no validation of the configuration.
//
// This field takes precedence over `alertmanagersUrl`.
//
// +optional
AlertManagersConfig *v1.SecretKeySelector `json:"alertmanagersConfig,omitempty"`
// A label selector to select which PrometheusRules to mount for alerting and
// recording.
// PrometheusRule objects to be selected for rule evaluation. An empty
// label selector matches all objects. A null label selector matches no
// objects.
//
// +optional
RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"`
// Namespaces to be selected for Rules discovery. If unspecified, only
// the same namespace as the ThanosRuler object is in is used.
//
// +optional
RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"`
// EnforcedNamespaceLabel enforces adding a namespace label of origin for each alert
// and metric that is user created. The label value will always be the namespace of the object that is
// being created.
@ -171,29 +244,36 @@ type ThanosRulerSpec struct {
// List of references to PrometheusRule objects
// to be excluded from enforcing a namespace label of origin.
// Applies only if enforcedNamespaceLabel set to true.
// +optional
ExcludedFromEnforcement []ObjectReference `json:"excludedFromEnforcement,omitempty"`
// PrometheusRulesExcludedFromEnforce - list of Prometheus rules to be excluded from enforcing
// of adding namespace labels. Works only if enforcedNamespaceLabel set to true.
// Make sure both ruleNamespace and ruleName are set for each pair
// Deprecated: use excludedFromEnforcement instead.
// +optional
PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfig `json:"prometheusRulesExcludedFromEnforce,omitempty"`
// Log level for ThanosRuler to be configured with.
// +kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for ThanosRuler to be configured with.
// +kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// Port name used for the pods and governing service.
// Defaults to `web`.
// +kubebuilder:default:="web"
PortName string `json:"portName,omitempty"`
// Interval between consecutive evaluations.
// +kubebuilder:default:="15s"
EvaluationInterval Duration `json:"evaluationInterval,omitempty"`
// Time duration ThanosRuler shall retain data for. Default is '24h',
// and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days weeks years).
// +kubebuilder:default:="24h"
Retention Duration `json:"retention,omitempty"`
// Containers allows injecting additional containers or modifying operator generated
// containers. This can be used to allow adding an authentication proxy to a ThanosRuler pod or
// to change the behavior of an operator generated container. Containers described here modify
@ -201,6 +281,7 @@ type ThanosRulerSpec struct {
// strategic merge patch. The current container names are: `thanos-ruler` and `config-reloader`.
// Overriding containers is entirely outside the scope of what the maintainers will support and by doing
// so, you accept that this behaviour may break at any time without notice.
// +optional
Containers []v1.Container `json:"containers,omitempty"`
// InitContainers allows adding initContainers to the pod definition. Those can be used to e.g.
// fetch secrets for injection into the ThanosRuler configuration from external sources. Any
@ -209,64 +290,108 @@ type ThanosRulerSpec struct {
// Using initContainers for any use case other then secret fetching is entirely outside the scope
// of what the maintainers will support and by doing so, you accept that this behaviour may break
// at any time without notice.
// +optional
InitContainers []v1.Container `json:"initContainers,omitempty"`
// TracingConfig configures tracing in Thanos.
// Configures tracing.
//
// The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
//
// This is an *experimental feature*, it may change in any upcoming release
// in a breaking way.
//
// The operator performs no validation of the configuration.
//
// `tracingConfigFile` takes precedence over this field.
//
//+optional
TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"`
// Configures the path of the tracing configuration file.
//
// The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
//
// This is an *experimental feature*, it may change in any upcoming release
// in a breaking way.
//
//+optional
TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"`
// TracingConfig specifies the path of the tracing configuration file.
// The operator performs no validation of the configuration file.
//
// This field takes precedence over `tracingConfig`.
//
// This is an *experimental feature*, it may change in any upcoming release
// in a breaking way.
//
//+optional
TracingConfigFile string `json:"tracingConfigFile,omitempty"`
// Labels configure the external label pairs to ThanosRuler. A default replica label
// `thanos_ruler_replica` will be always added as a label with the value of the pod's name and it will be dropped in the alerts.
// Configures the external label pairs of the ThanosRuler resource.
//
// A default replica label `thanos_ruler_replica` will be always added as a
// label with the value of the pod's name.
//
// +optional
Labels map[string]string `json:"labels,omitempty"`
// AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.
// The replica label `thanos_ruler_replica` will always be dropped in alerts.
// Configures the label names which should be dropped in Thanos Ruler
// alerts.
//
// The replica label `thanos_ruler_replica` will always be dropped from the alerts.
//
// +optional
AlertDropLabels []string `json:"alertDropLabels,omitempty"`
// The external URL the Thanos Ruler instances will be available under. This is
// necessary to generate correct URLs. This is necessary if Thanos Ruler is not
// served from root of a DNS name.
ExternalPrefix string `json:"externalPrefix,omitempty"`
// The route prefix ThanosRuler registers HTTP handlers for. This allows thanos UI to be served on a sub-path.
RoutePrefix string `json:"routePrefix,omitempty"`
// GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads
// recorded rule data.
// Note: Currently only the CAFile, CertFile, and KeyFile fields are supported.
// Maps to the '--grpc-server-tls-*' CLI args.
// +optional
GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"`
// The external Query URL the Thanos Ruler will set in the 'Source' field
// of all alerts.
// Maps to the '--alert.query-url' CLI arg.
AlertQueryURL string `json:"alertQueryUrl,omitempty"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
// +optional
MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"`
// AlertRelabelConfigs configures alert relabeling in ThanosRuler.
// Alert relabel configurations must have the form as specified in the official Prometheus documentation:
// Configures alert relabeling in Thanos Ruler.
//
// Alert relabel configuration must have the form as specified in the
// official Prometheus documentation:
// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
// Alternative to AlertRelabelConfigFile, and lower order priority.
//
// The operator performs no validation of the configuration.
//
// `alertRelabelConfigFile` takes precedence over this field.
//
// +optional
AlertRelabelConfigs *v1.SecretKeySelector `json:"alertRelabelConfigs,omitempty"`
// AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.
// When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.
// Configures the path to the alert relabeling configuration file.
//
// Alert relabel configuration must have the form as specified in the
// official Prometheus documentation:
// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
//
// The operator performs no validation of the configuration file.
//
// This field takes precedence over `alertRelabelConfig`.
//
// +optional
AlertRelabelConfigFile *string `json:"alertRelabelConfigFile,omitempty"`
// Pods' hostAliases configuration
// +listType=map
// +listMapKey=ip
HostAliases []HostAlias `json:"hostAliases,omitempty"`
// AdditionalArgs allows setting additional arguments for the ThanosRuler container.
// It is intended for e.g. activating hidden flags which are not supported by
// the dedicated configuration options yet. The arguments are passed as-is to the
@ -275,8 +400,11 @@ type ThanosRulerSpec struct {
// In case of an argument conflict (e.g. an argument which is already set by the
// operator itself) or when providing an invalid argument the reconciliation will
// fail and an error will be logged.
// +optional
AdditionalArgs []Argument `json:"additionalArgs,omitempty"`
// Defines the configuration of the ThanosRuler web server.
// +optional
Web *ThanosRulerWebSpec `json:"web,omitempty"`
}

View file

@ -3259,6 +3259,11 @@ func (in *ThanosRulerList) DeepCopy() *ThanosRulerList {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ThanosRulerSpec) DeepCopyInto(out *ThanosRulerSpec) {
*out = *in
if in.Version != nil {
in, out := &in.Version, &out.Version
*out = new(string)
**out = **in
}
if in.PodMetadata != nil {
in, out := &in.PodMetadata, &out.PodMetadata
*out = new(EmbeddedObjectMetadata)

View file

@ -22,6 +22,7 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
"github.com/prometheus-operator/prometheus-operator/internal/util"
"github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring"
@ -58,7 +59,7 @@ func (o *Operator) createOrUpdateRuleConfigMaps(ctx context.Context, t *monitori
)
logger := o.logger.With("thanos", t.Name, "namespace", t.Namespace)
thanosVersion := operator.StringValOrDefault(t.Spec.Version, operator.DefaultThanosVersion)
thanosVersion := operator.StringValOrDefault(ptr.Deref(t.Spec.Version, ""), operator.DefaultThanosVersion)
promRuleSelector, err := operator.NewPrometheusRuleSelector(operator.ThanosFormat, thanosVersion, t.Spec.RuleSelector, nsLabeler, o.ruleInfs, o.eventRecorder, logger)
if err != nil {

View file

@ -19,6 +19,7 @@ import (
"fmt"
"net/url"
"path"
"path/filepath"
"github.com/blang/semver/v4"
appsv1 "k8s.io/api/apps/v1"
@ -135,7 +136,7 @@ func makeStatefulSetSpec(tr *monitoringv1.ThanosRuler, config Config, ruleConfig
return nil, errors.New(tr.GetName() + ": thanos ruler requires query config or at least one query endpoint to be specified")
}
thanosVersion := operator.StringValOrDefault(tr.Spec.Version, operator.DefaultThanosVersion)
thanosVersion := operator.StringValOrDefault(ptr.Deref(tr.Spec.Version, ""), operator.DefaultThanosVersion)
version, err := semver.ParseTolerant(thanosVersion)
if err != nil {
@ -211,7 +212,8 @@ func makeStatefulSetSpec(tr *monitoringv1.ThanosRuler, config Config, ruleConfig
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "rule-file", Value: rulePath})
if tr.Spec.QueryConfig != nil {
fullPath := mountSecret(tr.Spec.QueryConfig, "query-config", &trVolumes, &trVolumeMounts)
var fullPath string
trVolumes, trVolumeMounts, fullPath = mountSecretKey(trVolumes, trVolumeMounts, tr.Spec.QueryConfig, "query-config")
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "query.config-file", Value: fullPath})
} else if len(tr.Spec.QueryEndpoints) > 0 {
for _, endpoint := range tr.Spec.QueryEndpoints {
@ -220,7 +222,8 @@ func makeStatefulSetSpec(tr *monitoringv1.ThanosRuler, config Config, ruleConfig
}
if tr.Spec.AlertManagersConfig != nil {
fullPath := mountSecret(tr.Spec.AlertManagersConfig, "alertmanager-config", &trVolumes, &trVolumeMounts)
var fullPath string
trVolumes, trVolumeMounts, fullPath = mountSecretKey(trVolumes, trVolumeMounts, tr.Spec.AlertManagersConfig, "alertmanager-config")
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "alertmanagers.config-file", Value: fullPath})
} else if len(tr.Spec.AlertManagersURL) > 0 {
for _, url := range tr.Spec.AlertManagersURL {
@ -231,21 +234,24 @@ func makeStatefulSetSpec(tr *monitoringv1.ThanosRuler, config Config, ruleConfig
if tr.Spec.ObjectStorageConfigFile != nil {
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "objstore.config-file", Value: *tr.Spec.ObjectStorageConfigFile})
} else if tr.Spec.ObjectStorageConfig != nil {
fullPath := mountSecret(tr.Spec.ObjectStorageConfig, "objstorage-config", &trVolumes, &trVolumeMounts)
var fullPath string
trVolumes, trVolumeMounts, fullPath = mountSecretKey(trVolumes, trVolumeMounts, tr.Spec.ObjectStorageConfig, "objstorage-config")
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "objstore.config-file", Value: fullPath})
}
if tr.Spec.TracingConfigFile != "" {
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "tracing.config-file", Value: tr.Spec.TracingConfigFile})
} else if tr.Spec.TracingConfig != nil {
fullPath := mountSecret(tr.Spec.TracingConfig, "tracing-config", &trVolumes, &trVolumeMounts)
var fullPath string
trVolumes, trVolumeMounts, fullPath = mountSecretKey(trVolumes, trVolumeMounts, tr.Spec.TracingConfig, "tracing-config")
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "tracing.config-file", Value: fullPath})
}
if tr.Spec.AlertRelabelConfigFile != nil {
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "alert.relabel-config-file", Value: *tr.Spec.AlertRelabelConfigFile})
} else if tr.Spec.AlertRelabelConfigs != nil {
fullPath := mountSecret(tr.Spec.AlertRelabelConfigs, "alertrelabel-config", &trVolumes, &trVolumeMounts)
var fullPath string
trVolumes, trVolumeMounts, fullPath = mountSecretKey(trVolumes, trVolumeMounts, tr.Spec.AlertRelabelConfigs, "alertrelabel-config")
trCLIArgs = append(trCLIArgs, monitoringv1.Argument{Name: "alert.relabel-config-file", Value: fullPath})
}
@ -538,26 +544,28 @@ func webConfigSecretName(name string) string {
return fmt.Sprintf("%s-web-config", prefixedName(name))
}
func mountSecret(secretSelector *v1.SecretKeySelector, volumeName string, trVolumes *[]v1.Volume, trVolumeMounts *[]v1.VolumeMount) string {
path := secretSelector.Key
*trVolumes = append(*trVolumes, v1.Volume{
Name: volumeName,
VolumeSource: v1.VolumeSource{
Secret: &v1.SecretVolumeSource{
SecretName: secretSelector.Name,
Items: []v1.KeyToPath{
{
Key: secretSelector.Key,
Path: path,
// mountSecretKey adds the secret key to the mounted volumes and returns the
// full path of the file on disk.
func mountSecretKey(vols []v1.Volume, vmounts []v1.VolumeMount, secretSelector *v1.SecretKeySelector, volumeName string) ([]v1.Volume, []v1.VolumeMount, string) {
mountpath := filepath.Join(configDir, volumeName)
return append(vols, v1.Volume{
Name: volumeName,
VolumeSource: v1.VolumeSource{
Secret: &v1.SecretVolumeSource{
SecretName: secretSelector.Name,
Items: []v1.KeyToPath{
{
Key: secretSelector.Key,
Path: secretSelector.Key,
},
},
},
},
},
})
mountpath := configDir + "/" + volumeName
*trVolumeMounts = append(*trVolumeMounts, v1.VolumeMount{
Name: volumeName,
MountPath: mountpath,
})
return mountpath + "/" + path
}),
append(vmounts, v1.VolumeMount{
Name: volumeName,
MountPath: mountpath,
}),
filepath.Join(mountpath, secretSelector.Key)
}

View file

@ -967,7 +967,7 @@ func TestThanosVersion(t *testing.T) {
sset, err := makeStatefulSet(&monitoringv1.ThanosRuler{
Spec: monitoringv1.ThanosRulerSpec{
QueryEndpoints: emptyQueryEndpoints,
Version: tc.version,
Version: ptr.To(tc.version),
},
}, defaultTestConfig, nil, "", &operator.ShardedSecret{})