Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tolerations support in otelcol CRD #302

Merged
merged 5 commits into from
Jun 7, 2021
Merged
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions api/v1alpha1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
@@ -87,6 +87,11 @@ type OpenTelemetryCollectorSpec struct {
// +optional
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
Resources v1.ResourceRequirements `json:"resources,omitempty"`

// Toleration to schedule OpenTelemetry Collector pods.
// +optional
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
}

// OpenTelemetryCollectorStatus defines the observed state of OpenTelemetryCollector.
40 changes: 40 additions & 0 deletions config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
@@ -280,6 +280,46 @@ spec:
description: ServiceAccount indicates the name of an existing service
account to use with this instance.
type: string
tolerations:
description: Toleration to schedule OpenTelemetry Collector pods.
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
volumeClaimTemplates:
description: VolumeClaimTemplates will provide stable storage using
PersistentVolumes. Only available when the mode=statefulset.
1 change: 1 addition & 0 deletions pkg/collector/daemonset.go
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@ func DaemonSet(cfg config.Config, logger logr.Logger, otelcol v1alpha1.OpenTelem
ServiceAccountName: ServiceAccountName(otelcol),
Containers: []corev1.Container{Container(cfg, logger, otelcol)},
Volumes: Volumes(cfg, otelcol),
Tolerations: otelcol.Spec.Tolerations,
},
},
},
1 change: 1 addition & 0 deletions pkg/collector/deployment.go
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ func Deployment(cfg config.Config, logger logr.Logger, otelcol v1alpha1.OpenTele
ServiceAccountName: ServiceAccountName(otelcol),
Containers: []corev1.Container{Container(cfg, logger, otelcol)},
Volumes: Volumes(cfg, otelcol),
Tolerations: otelcol.Spec.Tolerations,
},
},
},