Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions bundle/manifests/monitoring.rhobs_monitoringstacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ spec:
type: string
description: Define ExternalLabels for prometheus
type: object
nodeSelector:
additionalProperties:
type: string
description: Define which Nodes the Pods are scheduled on.
type: object
persistentVolumeClaim:
description: Define persistent volume claim for prometheus
properties:
Expand Down Expand Up @@ -882,6 +887,47 @@ spec:
description: Default interval between scrapes.
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
type: string
tolerations:
description: If specified, the pod's tolerations.
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified, allowed
values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: Key is the taint key that the toleration applies
to. Empty means match all taint keys. If the key is empty,
operator must be Exists; this combination means to match
all values and all keys.
type: string
operator:
description: Operator represents a key's relationship to
the value. Valid operators are Exists and Equal. Defaults
to Equal. Exists is equivalent to wildcard for value,
so that a pod can tolerate all taints of a particular
category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period of
time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the taint
forever (do not evict). Zero and negative values will
be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration matches
to. If the operator is Exists, the value should be empty,
otherwise just a regular string.
type: string
type: object
type: array
type: object
resourceSelector:
description: 'Label selector for Monitoring Stack Resources. To monitor
Expand Down
46 changes: 46 additions & 0 deletions deploy/crds/common/monitoring.rhobs_monitoringstacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ spec:
type: string
description: Define ExternalLabels for prometheus
type: object
nodeSelector:
additionalProperties:
type: string
description: Define which Nodes the Pods are scheduled on.
type: object
persistentVolumeClaim:
description: Define persistent volume claim for prometheus
properties:
Expand Down Expand Up @@ -883,6 +888,47 @@ spec:
description: Default interval between scrapes.
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
type: string
tolerations:
description: If specified, the pod's tolerations.
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified, allowed
values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: Key is the taint key that the toleration applies
to. Empty means match all taint keys. If the key is empty,
operator must be Exists; this combination means to match
all values and all keys.
type: string
operator:
description: Operator represents a key's relationship to
the value. Valid operators are Exists and Equal. Defaults
to Equal. Exists is equivalent to wildcard for value,
so that a pod can tolerate all taints of a particular
category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period of
time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the taint
forever (do not evict). Zero and negative values will
be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration matches
to. If the operator is Exists, the value should be empty,
otherwise just a regular string.
type: string
type: object
type: array
type: object
resourceSelector:
description: 'Label selector for Monitoring Stack Resources. To monitor
Expand Down
71 changes: 71 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ Define prometheus config
Define ExternalLabels for prometheus<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>nodeSelector</b></td>
<td>map[string]string</td>
<td>
Define which Nodes the Pods are scheduled on.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#monitoringstackspecprometheusconfigpersistentvolumeclaim">persistentVolumeClaim</a></b></td>
<td>object</td>
Expand Down Expand Up @@ -315,6 +322,13 @@ Define prometheus config
Default interval between scrapes.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#monitoringstackspecprometheusconfigtolerationsindex">tolerations</a></b></td>
<td>[]object</td>
<td>
If specified, the pod's tolerations.<br/>
</td>
<td>false</td>
</tr></tbody>
</table>

Expand Down Expand Up @@ -1848,6 +1862,63 @@ RelabelConfig allows dynamic rewriting of the label set, being applied to sample
</table>


### MonitoringStack.spec.prometheusConfig.tolerations[index]
<sup><sup>[↩ Parent](#monitoringstackspecprometheusconfig)</sup></sup>



The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>effect</b></td>
<td>string</td>
<td>
Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>key</b></td>
<td>string</td>
<td>
Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>operator</b></td>
<td>string</td>
<td>
Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>tolerationSeconds</b></td>
<td>integer</td>
<td>
TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.<br/>
<br/>
<i>Format</i>: int64<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>value</b></td>
<td>string</td>
<td>
Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.<br/>
</td>
<td>false</td>
</tr></tbody>
</table>


### MonitoringStack.spec.resourceSelector
<sup><sup>[↩ Parent](#monitoringstackspec)</sup></sup>

Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/monitoring/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ type PrometheusConfig struct {
// Default interval between scrapes.
// +optional
ScrapeInterval *monv1.Duration `json:"scrapeInterval,omitempty"`
// Define which Nodes the Pods are scheduled on.
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// If specified, the pod's tolerations.
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

type AlertmanagerConfig struct {
Expand Down
14 changes: 14 additions & 0 deletions pkg/apis/monitoring/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/controllers/monitoring/monitoring-stack/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ func newPrometheus(
RemoteWrite: config.RemoteWrite,
ExternalLabels: config.ExternalLabels,
EnableRemoteWriteReceiver: config.EnableRemoteWriteReceiver,
NodeSelector: config.NodeSelector,
Tolerations: config.Tolerations,
Comment on lines +175 to +176
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bng0y , Like @simonpasquier suggested, lets make this global and apply the same to all resources that ObO creates.

},
Retention: ms.Spec.Retention,
RuleSelector: prometheusSelector,
Expand Down