Skip to content

Commit 503351e

Browse files
authored
Merge branch 'main' into fix-inst
2 parents 8cee37a + c6734e2 commit 503351e

34 files changed

+702
-491
lines changed

.chloggen/TEMPLATE.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
22
change_type:
33

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

77
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: 'bug_fix'
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
5+
component: target allocator
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: "Fix per-node target allocation for targets from endpointslices"
9+
10+
# One or more tracking issues related to the change
11+
issues: [2718]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext: "The per-node target allocation strategy was not matching endpointslice entries for with a `kind` of Node, such as those for the kubelet metrics created by the prometheus operator"

.github/ISSUE_TEMPLATE/bug_report.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ body:
1616
multiple: true
1717
options:
1818
- collector
19-
- instrumentation
19+
- auto-instrumentation
2020
- target allocator
21-
- opamp bridge
21+
- opamp
2222
- type: textarea
2323
attributes:
2424
label: What happened?

.github/ISSUE_TEMPLATE/feature_request.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ body:
1010
multiple: true
1111
options:
1212
- collector
13-
- instrumentation
13+
- auto-instrumentation
1414
- target allocator
15-
- opamp bridge
15+
- opamp
1616
- type: textarea
1717
attributes:
1818
label: Is your feature request related to a problem? Please describe.

.github/ISSUE_TEMPLATE/other.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ body:
1010
multiple: true
1111
options:
1212
- collector
13-
- instrumentation
13+
- auto-instrumentation
1414
- target allocator
15-
- opamp bridge
15+
- opamp
1616
- type: textarea
1717
attributes:
1818
label: Describe the issue you're reporting

apis/v1beta1/ingress_type.go apis/v1beta1/ingress.go

+54
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
package v1beta1
1616

17+
import networkingv1 "k8s.io/api/networking/v1"
18+
1719
type (
1820
// IngressType represents how a collector should be exposed (ingress vs route).
1921
// +kubebuilder:validation:Enum=ingress;route
@@ -61,3 +63,55 @@ const (
6163
// receiver port. The port name is used as a subdomain for the host defined in the Ingress e.g. otlp-http.example.com.
6264
IngressRuleTypeSubdomain IngressRuleType = "subdomain"
6365
)
66+
67+
// Ingress is used to specify how OpenTelemetry Collector is exposed. This
68+
// functionality is only available if one of the valid modes is set.
69+
// Valid modes are: deployment, daemonset and statefulset.
70+
// NOTE: If this feature is activated, all specified receivers are exposed.
71+
// Currently, this has a few limitations. Depending on the ingress controller
72+
// there are problems with TLS and gRPC.
73+
// SEE: https://github.com/open-telemetry/opentelemetry-operator/issues/1306.
74+
// NOTE: As a workaround, port name and appProtocol could be specified directly
75+
// in the CR.
76+
// SEE: OpenTelemetryCollector.spec.ports[index].
77+
type Ingress struct {
78+
// Type default value is: ""
79+
// Supported types are: ingress, route
80+
Type IngressType `json:"type,omitempty"`
81+
82+
// RuleType defines how Ingress exposes collector receivers.
83+
// IngressRuleTypePath ("path") exposes each receiver port on a unique path on single domain defined in Hostname.
84+
// IngressRuleTypeSubdomain ("subdomain") exposes each receiver port on a unique subdomain of Hostname.
85+
// Default is IngressRuleTypePath ("path").
86+
RuleType IngressRuleType `json:"ruleType,omitempty"`
87+
88+
// Hostname by which the ingress proxy can be reached.
89+
// +optional
90+
Hostname string `json:"hostname,omitempty"`
91+
92+
// Annotations to add to ingress.
93+
// e.g. 'cert-manager.io/cluster-issuer: "letsencrypt"'
94+
// +optional
95+
Annotations map[string]string `json:"annotations,omitempty"`
96+
97+
// TLS configuration.
98+
// +optional
99+
TLS []networkingv1.IngressTLS `json:"tls,omitempty"`
100+
101+
// IngressClassName is the name of an IngressClass cluster resource. Ingress
102+
// controller implementations use this field to know whether they should be
103+
// serving this Ingress resource.
104+
// +optional
105+
IngressClassName *string `json:"ingressClassName,omitempty"`
106+
107+
// Route is an OpenShift specific section that is only considered when
108+
// type "route" is used.
109+
// +optional
110+
Route OpenShiftRoute `json:"route,omitempty"`
111+
}
112+
113+
// OpenShiftRoute defines openshift route specific settings.
114+
type OpenShiftRoute struct {
115+
// Termination indicates termination type. By default "edge" is used.
116+
Termination TLSRouteTerminationType `json:"termination,omitempty"`
117+
}

apis/v1beta1/opentelemetrycollector_types.go

+74-127
Original file line numberDiff line numberDiff line change
@@ -19,98 +19,61 @@ package v1beta1
1919
import (
2020
appsv1 "k8s.io/api/apps/v1"
2121
v1 "k8s.io/api/core/v1"
22-
networkingv1 "k8s.io/api/networking/v1"
2322
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2423
)
2524

26-
// Probe defines the OpenTelemetry's pod probe config. Only Liveness probe is supported currently.
27-
type Probe struct {
28-
// Number of seconds after the container has started before liveness probes are initiated.
29-
// Defaults to 0 seconds. Minimum value is 0.
30-
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
31-
// +optional
32-
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
33-
// Number of seconds after which the probe times out.
34-
// Defaults to 1 second. Minimum value is 1.
35-
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
36-
// +optional
37-
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
38-
// How often (in seconds) to perform the probe.
39-
// Default to 10 seconds. Minimum value is 1.
40-
// +optional
41-
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
42-
// Minimum consecutive successes for the probe to be considered successful after having failed.
43-
// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
44-
// +optional
45-
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
46-
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
47-
// Defaults to 3. Minimum value is 1.
48-
// +optional
49-
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
50-
// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
51-
// The grace period is the duration in seconds after the processes running in the pod are sent
52-
// a termination signal and the time when the processes are forcibly halted with a kill signal.
53-
// Set this value longer than the expected cleanup time for your process.
54-
// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
55-
// value overrides the value provided by the pod spec.
56-
// Value must be non-negative integer. The value zero indicates stop immediately via
57-
// the kill signal (no opportunity to shut down).
58-
// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
59-
// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
60-
// +optional
61-
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
25+
func init() {
26+
SchemeBuilder.Register(&OpenTelemetryCollector{}, &OpenTelemetryCollectorList{})
6227
}
6328

64-
// Ingress is used to specify how OpenTelemetry Collector is exposed. This
65-
// functionality is only available if one of the valid modes is set.
66-
// Valid modes are: deployment, daemonset and statefulset.
67-
// NOTE: If this feature is activated, all specified receivers are exposed.
68-
// Currently, this has a few limitations. Depending on the ingress controller
69-
// there are problems with TLS and gRPC.
70-
// SEE: https://github.com/open-telemetry/opentelemetry-operator/issues/1306.
71-
// NOTE: As a workaround, port name and appProtocol could be specified directly
72-
// in the CR.
73-
// SEE: OpenTelemetryCollector.spec.ports[index].
74-
type Ingress struct {
75-
// Type default value is: ""
76-
// Supported types are: ingress, route
77-
Type IngressType `json:"type,omitempty"`
29+
// +kubebuilder:object:root=true
30+
// +kubebuilder:resource:shortName=otelcol;otelcols
31+
// +kubebuilder:subresource:status
32+
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.scale.replicas,selectorpath=.status.scale.selector
33+
// +kubebuilder:printcolumn:name="Mode",type="string",JSONPath=".spec.mode",description="Deployment Mode"
34+
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version",description="OpenTelemetry Version"
35+
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.scale.statusReplicas"
36+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
37+
// +kubebuilder:printcolumn:name="Image",type="string",JSONPath=".status.image"
38+
// +kubebuilder:printcolumn:name="Management",type="string",JSONPath=".spec.managementState",description="Management State"
39+
// +operator-sdk:csv:customresourcedefinitions:displayName="OpenTelemetry Collector"
40+
// This annotation provides a hint for OLM which resources are managed by OpenTelemetryCollector kind.
41+
// It's not mandatory to list all resources.
42+
// +operator-sdk:csv:customresourcedefinitions:resources={{Pod,v1},{Deployment,apps/v1},{DaemonSets,apps/v1},{StatefulSets,apps/v1},{ConfigMaps,v1},{Service,v1}}
43+
44+
// OpenTelemetryCollector is the Schema for the opentelemetrycollectors API.
45+
type OpenTelemetryCollector struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ObjectMeta `json:"metadata,omitempty"`
7848

79-
// RuleType defines how Ingress exposes collector receivers.
80-
// IngressRuleTypePath ("path") exposes each receiver port on a unique path on single domain defined in Hostname.
81-
// IngressRuleTypeSubdomain ("subdomain") exposes each receiver port on a unique subdomain of Hostname.
82-
// Default is IngressRuleTypePath ("path").
83-
RuleType IngressRuleType `json:"ruleType,omitempty"`
49+
Spec OpenTelemetryCollectorSpec `json:"spec,omitempty"`
50+
Status OpenTelemetryCollectorStatus `json:"status,omitempty"`
51+
}
8452

85-
// Hostname by which the ingress proxy can be reached.
86-
// +optional
87-
Hostname string `json:"hostname,omitempty"`
53+
func (*OpenTelemetryCollector) Hub() {}
8854

89-
// Annotations to add to ingress.
90-
// e.g. 'cert-manager.io/cluster-issuer: "letsencrypt"'
91-
// +optional
92-
Annotations map[string]string `json:"annotations,omitempty"`
55+
//+kubebuilder:object:root=true
9356

94-
// TLS configuration.
95-
// +optional
96-
TLS []networkingv1.IngressTLS `json:"tls,omitempty"`
57+
// OpenTelemetryCollectorList contains a list of OpenTelemetryCollector.
58+
type OpenTelemetryCollectorList struct {
59+
metav1.TypeMeta `json:",inline"`
60+
metav1.ListMeta `json:"metadata,omitempty"`
61+
Items []OpenTelemetryCollector `json:"items"`
62+
}
9763

98-
// IngressClassName is the name of an IngressClass cluster resource. Ingress
99-
// controller implementations use this field to know whether they should be
100-
// serving this Ingress resource.
64+
// OpenTelemetryCollectorStatus defines the observed state of OpenTelemetryCollector.
65+
type OpenTelemetryCollectorStatus struct {
66+
// Scale is the OpenTelemetryCollector's scale subresource status.
10167
// +optional
102-
IngressClassName *string `json:"ingressClassName,omitempty"`
68+
Scale ScaleSubresourceStatus `json:"scale,omitempty"`
10369

104-
// Route is an OpenShift specific section that is only considered when
105-
// type "route" is used.
70+
// Version of the managed OpenTelemetry Collector (operand)
10671
// +optional
107-
Route OpenShiftRoute `json:"route,omitempty"`
108-
}
72+
Version string `json:"version,omitempty"`
10973

110-
// OpenShiftRoute defines openshift route specific settings.
111-
type OpenShiftRoute struct {
112-
// Termination indicates termination type. By default "edge" is used.
113-
Termination TLSRouteTerminationType `json:"termination,omitempty"`
74+
// Image indicates the container image to use for the OpenTelemetry Collector.
75+
// +optional
76+
Image string `json:"image,omitempty"`
11477
}
11578

11679
// OpenTelemetryCollectorSpec defines the desired state of OpenTelemetryCollector.
@@ -242,19 +205,42 @@ type TargetAllocatorEmbedded struct {
242205
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
243206
}
244207

245-
// OpenTelemetryCollectorStatus defines the observed state of OpenTelemetryCollector.
246-
type OpenTelemetryCollectorStatus struct {
247-
// Scale is the OpenTelemetryCollector's scale subresource status.
208+
// Probe defines the OpenTelemetry's pod probe config. Only Liveness probe is supported currently.
209+
type Probe struct {
210+
// Number of seconds after the container has started before liveness probes are initiated.
211+
// Defaults to 0 seconds. Minimum value is 0.
212+
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
248213
// +optional
249-
Scale ScaleSubresourceStatus `json:"scale,omitempty"`
250-
251-
// Version of the managed OpenTelemetry Collector (operand)
214+
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
215+
// Number of seconds after which the probe times out.
216+
// Defaults to 1 second. Minimum value is 1.
217+
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
252218
// +optional
253-
Version string `json:"version,omitempty"`
254-
255-
// Image indicates the container image to use for the OpenTelemetry Collector.
219+
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
220+
// How often (in seconds) to perform the probe.
221+
// Default to 10 seconds. Minimum value is 1.
256222
// +optional
257-
Image string `json:"image,omitempty"`
223+
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
224+
// Minimum consecutive successes for the probe to be considered successful after having failed.
225+
// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
226+
// +optional
227+
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
228+
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
229+
// Defaults to 3. Minimum value is 1.
230+
// +optional
231+
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
232+
// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
233+
// The grace period is the duration in seconds after the processes running in the pod are sent
234+
// a termination signal and the time when the processes are forcibly halted with a kill signal.
235+
// Set this value longer than the expected cleanup time for your process.
236+
// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
237+
// value overrides the value provided by the pod spec.
238+
// Value must be non-negative integer. The value zero indicates stop immediately via
239+
// the kill signal (no opportunity to shut down).
240+
// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
241+
// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
242+
// +optional
243+
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
258244
}
259245

260246
// ObservabilitySpec defines how telemetry data gets handled.
@@ -309,42 +295,3 @@ type ConfigMapsSpec struct {
309295
Name string `json:"name"`
310296
MountPath string `json:"mountpath"`
311297
}
312-
313-
// +kubebuilder:object:root=true
314-
// +kubebuilder:resource:shortName=otelcol;otelcols
315-
// +kubebuilder:subresource:status
316-
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.scale.replicas,selectorpath=.status.scale.selector
317-
// +kubebuilder:printcolumn:name="Mode",type="string",JSONPath=".spec.mode",description="Deployment Mode"
318-
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version",description="OpenTelemetry Version"
319-
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.scale.statusReplicas"
320-
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
321-
// +kubebuilder:printcolumn:name="Image",type="string",JSONPath=".status.image"
322-
// +kubebuilder:printcolumn:name="Management",type="string",JSONPath=".spec.managementState",description="Management State"
323-
// +operator-sdk:csv:customresourcedefinitions:displayName="OpenTelemetry Collector"
324-
// This annotation provides a hint for OLM which resources are managed by OpenTelemetryCollector kind.
325-
// It's not mandatory to list all resources.
326-
// +operator-sdk:csv:customresourcedefinitions:resources={{Pod,v1},{Deployment,apps/v1},{DaemonSets,apps/v1},{StatefulSets,apps/v1},{ConfigMaps,v1},{Service,v1}}
327-
328-
// OpenTelemetryCollector is the Schema for the opentelemetrycollectors API.
329-
type OpenTelemetryCollector struct {
330-
metav1.TypeMeta `json:",inline"`
331-
metav1.ObjectMeta `json:"metadata,omitempty"`
332-
333-
Spec OpenTelemetryCollectorSpec `json:"spec,omitempty"`
334-
Status OpenTelemetryCollectorStatus `json:"status,omitempty"`
335-
}
336-
337-
func (*OpenTelemetryCollector) Hub() {}
338-
339-
//+kubebuilder:object:root=true
340-
341-
// OpenTelemetryCollectorList contains a list of OpenTelemetryCollector.
342-
type OpenTelemetryCollectorList struct {
343-
metav1.TypeMeta `json:",inline"`
344-
metav1.ListMeta `json:"metadata,omitempty"`
345-
Items []OpenTelemetryCollector `json:"items"`
346-
}
347-
348-
func init() {
349-
SchemeBuilder.Register(&OpenTelemetryCollector{}, &OpenTelemetryCollectorList{})
350-
}

0 commit comments

Comments
 (0)