diff --git a/apis/v1beta1/opentelemetrycollector_types.go b/apis/v1beta1/opentelemetrycollector_types.go
index dd20af943d..fb6940c992 100644
--- a/apis/v1beta1/opentelemetrycollector_types.go
+++ b/apis/v1beta1/opentelemetrycollector_types.go
@@ -90,14 +90,17 @@ type OpenTelemetryCollectorSpec struct {
// +optional
TargetAllocator TargetAllocatorEmbedded `json:"targetAllocator,omitempty"`
// Mode represents how the collector should be deployed (deployment, daemonset, statefulset or sidecar)
- // +optional
+ // +kubebuilder:default=deployment
+ // +kubebuilder:validation:Enum=deployment;daemonset;statefulset;sidecar
Mode Mode `json:"mode,omitempty"`
// UpgradeStrategy represents how the operator will handle upgrades to the CR when a newer version of the operator is deployed
- // +optional
+ // +kubebuilder:default=automatic
+ // +kubebuilder:validation:Enum=automatic;manual
UpgradeStrategy UpgradeStrategy `json:"upgradeStrategy"`
// Config is the raw JSON to be used as the collector's configuration. Refer to the OpenTelemetry Collector documentation for details.
// The empty objects e.g. batch: should be written as batch: {} otherwise they won't work with kustomize or kubectl edit.
// +required
+ // +kubebuilder:validation:required
// +kubebuilder:pruning:PreserveUnknownFields
Config Config `json:"config"`
// ConfigVersions defines the number versions to keep for the collector config. Each config version is stored in a separate ConfigMap.
@@ -110,6 +113,7 @@ type OpenTelemetryCollectorSpec struct {
// functionality is only available if one of the valid modes is set.
// Valid modes are: deployment, daemonset and statefulset.
// +optional
+ // +kubebuilder:validation:Enum=deployment;daemonSet;statefulSet
Ingress Ingress `json:"ingress,omitempty"`
// Liveness config for the OpenTelemetry Collector except the probe handler which is auto generated from the health extension of the collector.
// It is only effective when healthcheckextension is configured in the OpenTelemetry Collector pipeline.
@@ -135,11 +139,13 @@ type OpenTelemetryCollectorSpec struct {
// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec
// This is only applicable to Daemonset mode.
// +optional
+ // +kubebuilder:validation:Enum=daemonset
DaemonSetUpdateStrategy appsv1.DaemonSetUpdateStrategy `json:"daemonSetUpdateStrategy,omitempty"`
// UpdateStrategy represents the strategy the operator will take replacing existing Deployment pods with new pods
// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/deployment-v1/#DeploymentSpec
// This is only applicable to Deployment mode.
// +optional
+ // +kubebuilder:validation:Enum=deployment
DeploymentUpdateStrategy appsv1.DeploymentStrategy `json:"deploymentUpdateStrategy,omitempty"`
}
@@ -150,6 +156,7 @@ type TargetAllocatorEmbedded struct {
// other than 1 if a strategy that allows for high availability is chosen. Currently, the only allocation strategy
// that can be run in a high availability mode is consistent-hashing.
// +optional
+ // +kubebuilder:validation:Minimum=1
Replicas *int32 `json:"replicas,omitempty"`
// NodeSelector to schedule OpenTelemetry TargetAllocator pods.
// +optional
@@ -163,12 +170,14 @@ type TargetAllocatorEmbedded struct {
// WARNING: The per-node strategy currently ignores targets without a Node, like control plane components.
// +optional
// +kubebuilder:default:=consistent-hashing
+ // +kubebuilder:validation:Enum=consistent-hashing;least-weighted;per-node
AllocationStrategy TargetAllocatorAllocationStrategy `json:"allocationStrategy,omitempty"`
// FilterStrategy determines how to filter targets before allocating them among the collectors.
// The only current option is relabel-config (drops targets based on prom relabel_config).
// The default is relabel-config.
// +optional
// +kubebuilder:default:=relabel-config
+ // +kubebuilder:validation:Enum=relabel-config
FilterStrategy TargetAllocatorFilterStrategy `json:"filterStrategy,omitempty"`
// ServiceAccount indicates the name of an existing service account to use with this instance. When set,
// the operator will not automatically create a ServiceAccount for the TargetAllocator.
@@ -229,23 +238,33 @@ type Probe struct {
// Defaults to 0 seconds. Minimum value is 0.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
+ // +kubebuilder:default=0
+ // +kubebuilder:validation:Minimum=0
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
// Number of seconds after which the probe times out.
// Defaults to 1 second. Minimum value is 1.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
+ // // +kubebuilder:default=1
+ // +kubebuilder:validation:Minimum=1
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// How often (in seconds) to perform the probe.
// Default to 10 seconds. Minimum value is 1.
// +optional
+ // +kubebuilder:default=10
+ // +kubebuilder:validation:Minimum=1
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed.
// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
// +optional
+ // +kubebuilder:default=1
+ // +kubebuilder:validation:Minimum=1
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
// Defaults to 3. Minimum value is 1.
// +optional
+ // +kubebuilder:default=3
+ // +kubebuilder:validation:Minimum=1
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
// The grace period is the duration in seconds after the processes running in the pod are sent
@@ -258,6 +277,7 @@ type Probe struct {
// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
// +optional
+ // +kubebuilder:validation:Minimum=1
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
}
@@ -294,11 +314,13 @@ type ScaleSubresourceStatus struct {
// The selector used to match the OpenTelemetryCollector's
// deployment or statefulSet pods.
// +optional
+ // +kubebuilder:validation:Enum=deployment;statefulset
Selector string `json:"selector,omitempty"`
// The total number non-terminated pods targeted by this
// OpenTelemetryCollector's deployment or statefulSet.
// +optional
+ // +kubebuilder:validation:Minimum=0
Replicas int32 `json:"replicas,omitempty"`
// StatusReplicas is the number of pods targeted by this OpenTelemetryCollector's with a Ready Condition /
@@ -310,6 +332,8 @@ type ScaleSubresourceStatus struct {
type ConfigMapsSpec struct {
// Configmap defines name and path where the configMaps should be mounted.
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=3
Name string `json:"name"`
MountPath string `json:"mountpath"`
}
diff --git a/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml b/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml
index 3b1454f8d6..d17474cbce 100644
--- a/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml
+++ b/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml
@@ -99,7 +99,7 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
- createdAt: "2024-09-19T17:15:52Z"
+ createdAt: "2024-10-06T13:43:33Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
@@ -479,7 +479,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.109.0
+ image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.109.0-15-ge324a7fc
livenessProbe:
httpGet:
path: /healthz
diff --git a/bundle/community/manifests/opentelemetry.io_opentelemetrycollectors.yaml b/bundle/community/manifests/opentelemetry.io_opentelemetrycollectors.yaml
index 594e0f4aea..b41bd4e8d6 100644
--- a/bundle/community/manifests/opentelemetry.io_opentelemetrycollectors.yaml
+++ b/bundle/community/manifests/opentelemetry.io_opentelemetrycollectors.yaml
@@ -5923,6 +5923,7 @@ spec:
mountpath:
type: string
name:
+ minLength: 3
type: string
required:
- mountpath
@@ -5930,6 +5931,8 @@ spec:
type: object
type: array
daemonSetUpdateStrategy:
+ enum:
+ - daemonset
properties:
rollingUpdate:
properties:
@@ -5948,6 +5951,8 @@ spec:
type: string
type: object
deploymentUpdateStrategy:
+ enum:
+ - deployment
properties:
rollingUpdate:
properties:
@@ -6063,6 +6068,10 @@ spec:
imagePullPolicy:
type: string
ingress:
+ enum:
+ - deployment
+ - daemonSet
+ - statefulSet
properties:
annotations:
additionalProperties:
@@ -6918,22 +6927,32 @@ spec:
livenessProbe:
properties:
failureThreshold:
+ default: 3
format: int32
+ minimum: 1
type: integer
initialDelaySeconds:
+ default: 0
format: int32
+ minimum: 0
type: integer
periodSeconds:
+ default: 10
format: int32
+ minimum: 1
type: integer
successThreshold:
+ default: 1
format: int32
+ minimum: 1
type: integer
terminationGracePeriodSeconds:
format: int64
+ minimum: 1
type: integer
timeoutSeconds:
format: int32
+ minimum: 1
type: integer
type: object
managementState:
@@ -6943,11 +6962,18 @@ spec:
- unmanaged
type: string
mode:
- enum:
- - daemonset
- - deployment
- - sidecar
- - statefulset
+ allOf:
+ - enum:
+ - daemonset
+ - deployment
+ - sidecar
+ - statefulset
+ - enum:
+ - deployment
+ - daemonset
+ - statefulset
+ - sidecar
+ default: deployment
type: string
nodeSelector:
additionalProperties:
@@ -7114,22 +7140,32 @@ spec:
readinessProbe:
properties:
failureThreshold:
+ default: 3
format: int32
+ minimum: 1
type: integer
initialDelaySeconds:
+ default: 0
format: int32
+ minimum: 0
type: integer
periodSeconds:
+ default: 10
format: int32
+ minimum: 1
type: integer
successThreshold:
+ default: 1
format: int32
+ minimum: 1
type: integer
terminationGracePeriodSeconds:
format: int64
+ minimum: 1
type: integer
timeoutSeconds:
format: int32
+ minimum: 1
type: integer
type: object
replicas:
@@ -7686,11 +7722,16 @@ spec:
type: object
type: object
allocationStrategy:
+ allOf:
+ - enum:
+ - least-weighted
+ - consistent-hashing
+ - per-node
+ - enum:
+ - consistent-hashing
+ - least-weighted
+ - per-node
default: consistent-hashing
- enum:
- - least-weighted
- - consistent-hashing
- - per-node
type: string
enabled:
type: boolean
@@ -7761,10 +7802,13 @@ spec:
type: object
type: array
filterStrategy:
+ allOf:
+ - enum:
+ - ""
+ - relabel-config
+ - enum:
+ - relabel-config
default: relabel-config
- enum:
- - ""
- - relabel-config
type: string
image:
type: string
@@ -7935,6 +7979,7 @@ spec:
type: object
replicas:
format: int32
+ minimum: 1
type: integer
resources:
properties:
@@ -8188,9 +8233,14 @@ spec:
type: object
type: array
upgradeStrategy:
- enum:
- - automatic
- - none
+ allOf:
+ - enum:
+ - automatic
+ - none
+ - enum:
+ - automatic
+ - manual
+ default: automatic
type: string
volumeClaimTemplates:
items:
@@ -9201,6 +9251,7 @@ spec:
required:
- config
- managementState
+ - upgradeStrategy
type: object
status:
properties:
@@ -9210,8 +9261,12 @@ spec:
properties:
replicas:
format: int32
+ minimum: 0
type: integer
selector:
+ enum:
+ - deployment
+ - statefulset
type: string
statusReplicas:
type: string
diff --git a/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml b/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml
index 70db688513..7825eb03a9 100644
--- a/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml
+++ b/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml
@@ -99,7 +99,7 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
- createdAt: "2024-09-19T17:16:12Z"
+ createdAt: "2024-10-06T13:43:46Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
@@ -483,7 +483,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.109.0
+ image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.109.0-15-ge324a7fc
livenessProbe:
httpGet:
path: /healthz
diff --git a/bundle/openshift/manifests/opentelemetry.io_opentelemetrycollectors.yaml b/bundle/openshift/manifests/opentelemetry.io_opentelemetrycollectors.yaml
index 594e0f4aea..b41bd4e8d6 100644
--- a/bundle/openshift/manifests/opentelemetry.io_opentelemetrycollectors.yaml
+++ b/bundle/openshift/manifests/opentelemetry.io_opentelemetrycollectors.yaml
@@ -5923,6 +5923,7 @@ spec:
mountpath:
type: string
name:
+ minLength: 3
type: string
required:
- mountpath
@@ -5930,6 +5931,8 @@ spec:
type: object
type: array
daemonSetUpdateStrategy:
+ enum:
+ - daemonset
properties:
rollingUpdate:
properties:
@@ -5948,6 +5951,8 @@ spec:
type: string
type: object
deploymentUpdateStrategy:
+ enum:
+ - deployment
properties:
rollingUpdate:
properties:
@@ -6063,6 +6068,10 @@ spec:
imagePullPolicy:
type: string
ingress:
+ enum:
+ - deployment
+ - daemonSet
+ - statefulSet
properties:
annotations:
additionalProperties:
@@ -6918,22 +6927,32 @@ spec:
livenessProbe:
properties:
failureThreshold:
+ default: 3
format: int32
+ minimum: 1
type: integer
initialDelaySeconds:
+ default: 0
format: int32
+ minimum: 0
type: integer
periodSeconds:
+ default: 10
format: int32
+ minimum: 1
type: integer
successThreshold:
+ default: 1
format: int32
+ minimum: 1
type: integer
terminationGracePeriodSeconds:
format: int64
+ minimum: 1
type: integer
timeoutSeconds:
format: int32
+ minimum: 1
type: integer
type: object
managementState:
@@ -6943,11 +6962,18 @@ spec:
- unmanaged
type: string
mode:
- enum:
- - daemonset
- - deployment
- - sidecar
- - statefulset
+ allOf:
+ - enum:
+ - daemonset
+ - deployment
+ - sidecar
+ - statefulset
+ - enum:
+ - deployment
+ - daemonset
+ - statefulset
+ - sidecar
+ default: deployment
type: string
nodeSelector:
additionalProperties:
@@ -7114,22 +7140,32 @@ spec:
readinessProbe:
properties:
failureThreshold:
+ default: 3
format: int32
+ minimum: 1
type: integer
initialDelaySeconds:
+ default: 0
format: int32
+ minimum: 0
type: integer
periodSeconds:
+ default: 10
format: int32
+ minimum: 1
type: integer
successThreshold:
+ default: 1
format: int32
+ minimum: 1
type: integer
terminationGracePeriodSeconds:
format: int64
+ minimum: 1
type: integer
timeoutSeconds:
format: int32
+ minimum: 1
type: integer
type: object
replicas:
@@ -7686,11 +7722,16 @@ spec:
type: object
type: object
allocationStrategy:
+ allOf:
+ - enum:
+ - least-weighted
+ - consistent-hashing
+ - per-node
+ - enum:
+ - consistent-hashing
+ - least-weighted
+ - per-node
default: consistent-hashing
- enum:
- - least-weighted
- - consistent-hashing
- - per-node
type: string
enabled:
type: boolean
@@ -7761,10 +7802,13 @@ spec:
type: object
type: array
filterStrategy:
+ allOf:
+ - enum:
+ - ""
+ - relabel-config
+ - enum:
+ - relabel-config
default: relabel-config
- enum:
- - ""
- - relabel-config
type: string
image:
type: string
@@ -7935,6 +7979,7 @@ spec:
type: object
replicas:
format: int32
+ minimum: 1
type: integer
resources:
properties:
@@ -8188,9 +8233,14 @@ spec:
type: object
type: array
upgradeStrategy:
- enum:
- - automatic
- - none
+ allOf:
+ - enum:
+ - automatic
+ - none
+ - enum:
+ - automatic
+ - manual
+ default: automatic
type: string
volumeClaimTemplates:
items:
@@ -9201,6 +9251,7 @@ spec:
required:
- config
- managementState
+ - upgradeStrategy
type: object
status:
properties:
@@ -9210,8 +9261,12 @@ spec:
properties:
replicas:
format: int32
+ minimum: 0
type: integer
selector:
+ enum:
+ - deployment
+ - statefulset
type: string
statusReplicas:
type: string
diff --git a/config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml b/config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
index 05baaaa5df..f66002c5ca 100644
--- a/config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
+++ b/config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
@@ -5909,6 +5909,7 @@ spec:
mountpath:
type: string
name:
+ minLength: 3
type: string
required:
- mountpath
@@ -5916,6 +5917,8 @@ spec:
type: object
type: array
daemonSetUpdateStrategy:
+ enum:
+ - daemonset
properties:
rollingUpdate:
properties:
@@ -5934,6 +5937,8 @@ spec:
type: string
type: object
deploymentUpdateStrategy:
+ enum:
+ - deployment
properties:
rollingUpdate:
properties:
@@ -6049,6 +6054,10 @@ spec:
imagePullPolicy:
type: string
ingress:
+ enum:
+ - deployment
+ - daemonSet
+ - statefulSet
properties:
annotations:
additionalProperties:
@@ -6904,22 +6913,32 @@ spec:
livenessProbe:
properties:
failureThreshold:
+ default: 3
format: int32
+ minimum: 1
type: integer
initialDelaySeconds:
+ default: 0
format: int32
+ minimum: 0
type: integer
periodSeconds:
+ default: 10
format: int32
+ minimum: 1
type: integer
successThreshold:
+ default: 1
format: int32
+ minimum: 1
type: integer
terminationGracePeriodSeconds:
format: int64
+ minimum: 1
type: integer
timeoutSeconds:
format: int32
+ minimum: 1
type: integer
type: object
managementState:
@@ -6929,11 +6948,18 @@ spec:
- unmanaged
type: string
mode:
- enum:
- - daemonset
- - deployment
- - sidecar
- - statefulset
+ allOf:
+ - enum:
+ - daemonset
+ - deployment
+ - sidecar
+ - statefulset
+ - enum:
+ - deployment
+ - daemonset
+ - statefulset
+ - sidecar
+ default: deployment
type: string
nodeSelector:
additionalProperties:
@@ -7100,22 +7126,32 @@ spec:
readinessProbe:
properties:
failureThreshold:
+ default: 3
format: int32
+ minimum: 1
type: integer
initialDelaySeconds:
+ default: 0
format: int32
+ minimum: 0
type: integer
periodSeconds:
+ default: 10
format: int32
+ minimum: 1
type: integer
successThreshold:
+ default: 1
format: int32
+ minimum: 1
type: integer
terminationGracePeriodSeconds:
format: int64
+ minimum: 1
type: integer
timeoutSeconds:
format: int32
+ minimum: 1
type: integer
type: object
replicas:
@@ -7672,11 +7708,16 @@ spec:
type: object
type: object
allocationStrategy:
+ allOf:
+ - enum:
+ - least-weighted
+ - consistent-hashing
+ - per-node
+ - enum:
+ - consistent-hashing
+ - least-weighted
+ - per-node
default: consistent-hashing
- enum:
- - least-weighted
- - consistent-hashing
- - per-node
type: string
enabled:
type: boolean
@@ -7747,10 +7788,13 @@ spec:
type: object
type: array
filterStrategy:
+ allOf:
+ - enum:
+ - ""
+ - relabel-config
+ - enum:
+ - relabel-config
default: relabel-config
- enum:
- - ""
- - relabel-config
type: string
image:
type: string
@@ -7921,6 +7965,7 @@ spec:
type: object
replicas:
format: int32
+ minimum: 1
type: integer
resources:
properties:
@@ -8174,9 +8219,14 @@ spec:
type: object
type: array
upgradeStrategy:
- enum:
- - automatic
- - none
+ allOf:
+ - enum:
+ - automatic
+ - none
+ - enum:
+ - automatic
+ - manual
+ default: automatic
type: string
volumeClaimTemplates:
items:
@@ -9187,6 +9237,7 @@ spec:
required:
- config
- managementState
+ - upgradeStrategy
type: object
status:
properties:
@@ -9196,8 +9247,12 @@ spec:
properties:
replicas:
format: int32
+ minimum: 0
type: integer
selector:
+ enum:
+ - deployment
+ - statefulset
type: string
statusReplicas:
type: string
diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml
index 5c5f0b84cb..ea8457a1de 100644
--- a/config/manager/kustomization.yaml
+++ b/config/manager/kustomization.yaml
@@ -1,2 +1,8 @@
resources:
- manager.yaml
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+images:
+- name: controller
+ newName: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
+ newTag: 0.109.0-15-ge324a7fc
diff --git a/docs/api.md b/docs/api.md
index 24d16da3f4..6fb975d742 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -30916,6 +30916,15 @@ Default is managed.
Default: managed