Skip to content
Open
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
19 changes: 19 additions & 0 deletions .chloggen/configure-collector-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: collector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add the ability to configure the Collector's Service, Headless Service, Monitoring Service and Extension Service"

# One or more tracking issues related to the change
issues: [4205]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Introduces additional CRD options to configure and manage all the services deployed alongside the Collector.
Each of the Service, Headless Service, Monitoring Service & Extension Service can now be individually Enabled/Disabled
and the Name can be overridden.
33 changes: 33 additions & 0 deletions apis/v1beta1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ type OpenTelemetryCollectorSpec struct {
// If not specified, it will default to "<name>-headless".
// +optional
ServiceName string `json:"serviceName,omitempty"`

// Service to override configuration of the generated Collector Service.
// +optional
Service ServiceSpec `json:"service,omitempty"`

// HeadlessService to override configuration of the generated Collector HeadlessService.
// +optional
HeadlessService ServiceSpec `json:"headlessService,omitempty"`

// MonitoringService to override configuration of the generated Collector MonitoringService.
// +optional
MonitoringService ServiceSpec `json:"monitoringService,omitempty"`

// ExtensionService to override configuration of the generated Collector ExtensionService.
// +optional
ExtensionService ServiceSpec `json:"extensionService,omitempty"`
}

// TargetAllocatorEmbedded defines the configuration for the Prometheus target allocator, embedded in the
Expand Down Expand Up @@ -334,3 +350,20 @@ type ConfigMapsSpec struct {
Name string `json:"name"`
MountPath string `json:"mountpath"`
}

type ServiceSpec struct {
// Enabled indicates whether the Service should be created.
// nil means not set (defaults to enabled for backward compatibility)
// +optional
Enabled *bool `json:"enabled,omitempty"`

// Name to override the default Service name
// +optional
Name string `json:"name,omitempty"`
}

// IsEnabled returns true if the service should be created.
// nil (not set) defaults to true for backward compatibility.
func (s *ServiceSpec) IsEnabled() bool {
return s.Enabled == nil || *s.Enabled
}
24 changes: 24 additions & 0 deletions apis/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -6063,6 +6063,20 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: array
extensionService:
properties:
enabled:
type: boolean
name:
type: string
type: object
headlessService:
properties:
enabled:
type: boolean
name:
type: string
type: object
hostNetwork:
type: boolean
image:
Expand Down Expand Up @@ -6961,6 +6975,13 @@ spec:
enabled:
type: boolean
type: object
monitoringService:
properties:
enabled:
type: boolean
name:
type: string
type: object
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -7266,6 +7287,13 @@ spec:
type: string
type: object
type: object
service:
properties:
enabled:
type: boolean
name:
type: string
type: object
serviceAccount:
type: string
serviceName:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6062,6 +6062,20 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: array
extensionService:
properties:
enabled:
type: boolean
name:
type: string
type: object
headlessService:
properties:
enabled:
type: boolean
name:
type: string
type: object
hostNetwork:
type: boolean
image:
Expand Down Expand Up @@ -6960,6 +6974,13 @@ spec:
enabled:
type: boolean
type: object
monitoringService:
properties:
enabled:
type: boolean
name:
type: string
type: object
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -7265,6 +7286,13 @@ spec:
type: string
type: object
type: object
service:
properties:
enabled:
type: boolean
name:
type: string
type: object
serviceAccount:
type: string
serviceName:
Expand Down
28 changes: 28 additions & 0 deletions config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6049,6 +6049,20 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: array
extensionService:
properties:
enabled:
type: boolean
name:
type: string
type: object
headlessService:
properties:
enabled:
type: boolean
name:
type: string
type: object
hostNetwork:
type: boolean
image:
Expand Down Expand Up @@ -6942,6 +6956,13 @@ spec:
- sidecar
- statefulset
type: string
monitoringService:
properties:
enabled:
type: boolean
name:
type: string
type: object
networkPolicy:
properties:
enabled:
Expand Down Expand Up @@ -7252,6 +7273,13 @@ spec:
type: string
type: object
type: object
service:
properties:
enabled:
type: boolean
name:
type: string
type: object
serviceAccount:
type: string
serviceName:
Expand Down
6 changes: 4 additions & 2 deletions docs/api/instrumentations.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Instrumentation is the spec for OpenTelemetry instrumentation.
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
Expand Down Expand Up @@ -167,6 +167,8 @@ Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.<br/>
Propagators defines inter-process context propagation configuration.
Values in this list will be set in the OTEL_PROPAGATORS env var.
Enum=tracecontext;baggage;b3;b3multi;jaeger;xray;ottrace;none<br/>
<br/>
<i>Enum</i>: tracecontext, baggage, b3, b3multi, jaeger, xray, ottrace, none<br/>
</td>
<td>false</td>
</tr><tr>
Expand Down Expand Up @@ -7468,4 +7470,4 @@ The value can be for instance parentbased_always_on, parentbased_always_off, par
</td>
<td>false</td>
</tr></tbody>
</table>
</table>
4 changes: 2 additions & 2 deletions docs/api/opampbridges.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ OpAMPBridge is the Schema for the opampbridges API.
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
Expand Down Expand Up @@ -7595,4 +7595,4 @@ OpAMPBridgeStatus defines the observed state of OpAMPBridge.
</td>
<td>false</td>
</tr></tbody>
</table>
</table>
Loading
Loading