Skip to content

Commit e5b5663

Browse files
author
Israel Blancas
committed
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operator into 3370
2 parents ac8a330 + abbf360 commit e5b5663

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1181
-150
lines changed

Diff for: .chloggen/3380-ta-serviceaccount-check.yaml

+16
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. collector, target allocator, auto-instrumentation, opamp, 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: "Permission check fixed for the serviceaccount of the target allocator"
9+
10+
# One or more tracking issues related to the change
11+
issues: [3380]
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:
+16
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: enhancement
3+
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)
5+
component: auto-instrumentation
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: build musl based auto-instrumentation in Python docker image
9+
10+
# One or more tracking issues related to the change
11+
issues: [2264]
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:

Diff for: .chloggen/httpd_safe_conf.yaml

+16
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: 'enhancement'
3+
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)
5+
component: 'auto-instrumentation'
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: 'An empty line should come before the addition of Include ...opentemetry_agent.conf, as a protection measure against cases of httpd.conf w/o a blank last line'
9+
10+
# One or more tracking issues related to the change
11+
issues: [3401]
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:

Diff for: .chloggen/kubeletstats.yaml

+16
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: enhancement
3+
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)
5+
component: collector
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: "Add automatic RBAC creation for the `kubeletstats` receiver."
9+
10+
# One or more tracking issues related to the change
11+
issues: [3155]
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:

Diff for: Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,12 @@ add-image-opampbridge:
204204
add-rbac-permissions-to-operator: manifests kustomize
205205
# Kustomize only allows patches in the folder where the kustomization is located
206206
# This folder is ignored by .gitignore
207-
cp -r tests/e2e-automatic-rbac/extra-permissions-operator/ config/rbac/extra-permissions-operator
207+
mkdir -p config/rbac/extra-permissions-operator
208+
cp -r tests/e2e-automatic-rbac/extra-permissions-operator/* config/rbac/extra-permissions-operator
208209
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/namespaces.yaml
209210
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/nodes.yaml
211+
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/nodes-stats.yaml
212+
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/nodes-proxy.yaml
210213
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/rbac.yaml
211214
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/replicaset.yaml
212215

Diff for: README.md

+3-47
Original file line numberDiff line numberDiff line change
@@ -790,53 +790,9 @@ The priority for setting resource attributes is as follows (first found wins):
790790
This priority is applied for each resource attribute separately, so it is possible to set some attributes via
791791
annotations and others via labels.
792792

793-
## Compatibility matrix
794-
795-
### OpenTelemetry Operator vs. OpenTelemetry Collector
796-
797-
The OpenTelemetry Operator follows the same versioning as the operand (OpenTelemetry Collector) up to the minor part of the version. For example, the OpenTelemetry Operator v0.18.1 tracks OpenTelemetry Collector 0.18.0. The patch part of the version indicates the patch level of the operator itself, not that of OpenTelemetry Collector. Whenever a new patch version is released for OpenTelemetry Collector, we'll release a new patch version of the operator.
798-
799-
By default, the OpenTelemetry Operator ensures consistent versioning between itself and the managed `OpenTelemetryCollector` resources. That is, if the OpenTelemetry Operator is based on version `0.40.0`, it will create resources with an underlying OpenTelemetry Collector at version `0.40.0`.
800-
801-
When a custom `Spec.Image` is used with an `OpenTelemetryCollector` resource, the OpenTelemetry Operator will not manage this versioning and upgrading. In this scenario, it is best practice that the OpenTelemetry Operator version should match the underlying core version. Given a `OpenTelemetryCollector` resource with a `Spec.Image` configured to a custom image based on underlying OpenTelemetry Collector at version `0.40.0`, it is recommended that the OpenTelemetry Operator is kept at version `0.40.0`.
802-
803-
### OpenTelemetry Operator vs. Kubernetes vs. Cert Manager vs Prometheus Operator
804-
805-
We strive to be compatible with the widest range of Kubernetes versions as possible, but some changes to Kubernetes itself require us to break compatibility with older Kubernetes versions, be it because of code incompatibilities, or in the name of maintainability. Every released operator will support a specific range of Kubernetes versions, to be determined at the latest during the release.
806-
807-
We use `cert-manager` for some features of this operator and the third column shows the versions of the `cert-manager` that are known to work with this operator's versions.
808-
809-
The Target Allocator supports prometheus-operator CRDs like ServiceMonitor, and it does so by using packages imported from prometheus-operator itself. The table shows which version is shipped with a given operator version.
810-
Generally speaking, these are backwards compatible, but specific features require the appropriate package versions.
811-
812-
The OpenTelemetry Operator _might_ work on versions outside of the given range, but when opening new issues, please make sure to test your scenario on a supported version.
813-
814-
| OpenTelemetry Operator | Kubernetes | Cert-Manager | Prometheus-Operator |
815-
|------------------------|----------------| ------------ |---------------------|
816-
| v0.111.0 | v1.23 to v1.31 | v1 | v0.76.0 |
817-
| v0.110.0 | v1.23 to v1.31 | v1 | v0.76.0 |
818-
| v0.109.0 | v1.23 to v1.31 | v1 | v0.76.0 |
819-
| v0.108.0 | v1.23 to v1.31 | v1 | v0.76.0 |
820-
| v0.107.0 | v1.23 to v1.30 | v1 | v0.75.0 |
821-
| v0.106.0 | v1.23 to v1.30 | v1 | v0.75.0 |
822-
| v0.105.0 | v1.23 to v1.30 | v1 | v0.74.0 |
823-
| v0.104.0 | v1.23 to v1.30 | v1 | v0.74.0 |
824-
| v0.103.0 | v1.23 to v1.30 | v1 | v0.74.0 |
825-
| v0.102.0 | v1.23 to v1.30 | v1 | v0.71.2 |
826-
| v0.101.0 | v1.23 to v1.30 | v1 | v0.71.2 |
827-
| v0.100.0 | v1.23 to v1.29 | v1 | v0.71.2 |
828-
| v0.99.0 | v1.23 to v1.29 | v1 | v0.71.2 |
829-
| v0.98.0 | v1.23 to v1.29 | v1 | v0.71.2 |
830-
| v0.97.0 | v1.23 to v1.29 | v1 | v0.71.2 |
831-
| v0.96.0 | v1.23 to v1.29 | v1 | v0.71.2 |
832-
| v0.95.0 | v1.23 to v1.29 | v1 | v0.71.2 |
833-
| v0.94.0 | v1.23 to v1.29 | v1 | v0.71.0 |
834-
| v0.93.0 | v1.23 to v1.29 | v1 | v0.71.0 |
835-
| v0.92.0 | v1.23 to v1.29 | v1 | v0.71.0 |
836-
| v0.91.0 | v1.23 to v1.29 | v1 | v0.70.0 |
837-
| v0.90.0 | v1.23 to v1.28 | v1 | v0.69.1 |
838-
| v0.89.0 | v1.23 to v1.28 | v1 | v0.69.1 |
839-
| v0.88.0 | v1.23 to v1.28 | v1 | v0.68.0 |
793+
## Compatibility
794+
795+
See [here](docs/compatibility.md).
840796

841797
## Contributing and Developing
842798

Diff for: RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Steps to release a new version of the OpenTelemetry Operator:
1212
> DO NOT BUMP JAVA PAST `1.X.X` AND DO NOT BUMP .NET PAST `1.2.0`. Upgrades past these versions will introduce breaking HTTP semantic convention changes.
1313
1. Check if the compatible OpenShift versions are updated in the `Makefile`.
1414
1. Update the bundle by running `make bundle VERSION=$VERSION`.
15-
1. Change the compatibility matrix in the [readme](./README.md) file, using the OpenTelemetry Operator version to be released and the current latest Kubernetes version as the latest supported version. Remove the oldest entry.
15+
1. Change the compatibility matrix in the [compatibility doc](./docs/compatibility.md) file, using the OpenTelemetry Operator version to be released and the current latest Kubernetes version as the latest supported version. Remove the oldest entry.
1616
1. Update release schedule table, by moving the current release manager to the end of the table with updated release version.
1717
1. Add the changes to the changelog by running `make chlog-update VERSION=$VERSION`.
1818
1. Check the OpenTelemetry Collector's changelog and ensure migration steps are present in `pkg/collector/upgrade`

Diff for: apis/v1alpha1/targetallocator_webhook.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626

2727
"github.com/open-telemetry/opentelemetry-operator/apis/v1beta1"
2828
"github.com/open-telemetry/opentelemetry-operator/internal/config"
29+
"github.com/open-telemetry/opentelemetry-operator/internal/naming"
2930
"github.com/open-telemetry/opentelemetry-operator/internal/rbac"
3031
)
3132

@@ -119,7 +120,11 @@ func (w TargetAllocatorWebhook) validate(ctx context.Context, ta *TargetAllocato
119120

120121
// if the prometheusCR is enabled, it needs a suite of permissions to function
121122
if ta.Spec.PrometheusCR.Enabled {
122-
warnings, err := v1beta1.CheckTargetAllocatorPrometheusCRPolicyRules(ctx, w.reviewer, ta.Spec.ServiceAccount, ta.GetNamespace())
123+
saname := ta.Spec.ServiceAccount
124+
if len(ta.Spec.ServiceAccount) == 0 {
125+
saname = naming.TargetAllocatorServiceAccount(ta.Name)
126+
}
127+
warnings, err := v1beta1.CheckTargetAllocatorPrometheusCRPolicyRules(ctx, w.reviewer, ta.GetNamespace(), saname)
123128
if err != nil || len(warnings) > 0 {
124129
return warnings, err
125130
}

Diff for: apis/v1alpha1/targetallocator_webhook_test.go

+16-12
Original file line numberDiff line numberDiff line change
@@ -224,25 +224,29 @@ func TestTargetAllocatorValidatingWebhook(t *testing.T) {
224224
name: "prom CR admissions warning",
225225
shouldFailSar: true, // force failure
226226
targetallocator: TargetAllocator{
227+
ObjectMeta: metav1.ObjectMeta{
228+
Name: "test-ta",
229+
Namespace: "test-ns",
230+
},
227231
Spec: TargetAllocatorSpec{
228232
PrometheusCR: v1beta1.TargetAllocatorPrometheusCR{
229233
Enabled: true,
230234
},
231235
},
232236
},
233237
expectedWarnings: []string{
234-
"missing the following rules for monitoring.coreos.com/servicemonitors: [*]",
235-
"missing the following rules for monitoring.coreos.com/podmonitors: [*]",
236-
"missing the following rules for nodes/metrics: [get,list,watch]",
237-
"missing the following rules for services: [get,list,watch]",
238-
"missing the following rules for endpoints: [get,list,watch]",
239-
"missing the following rules for namespaces: [get,list,watch]",
240-
"missing the following rules for networking.k8s.io/ingresses: [get,list,watch]",
241-
"missing the following rules for nodes: [get,list,watch]",
242-
"missing the following rules for pods: [get,list,watch]",
243-
"missing the following rules for configmaps: [get]",
244-
"missing the following rules for discovery.k8s.io/endpointslices: [get,list,watch]",
245-
"missing the following rules for nonResourceURL: /metrics: [get]",
238+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - monitoring.coreos.com/servicemonitors: [*]",
239+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - monitoring.coreos.com/podmonitors: [*]",
240+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - nodes/metrics: [get,list,watch]",
241+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - services: [get,list,watch]",
242+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - endpoints: [get,list,watch]",
243+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - namespaces: [get,list,watch]",
244+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - networking.k8s.io/ingresses: [get,list,watch]",
245+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - nodes: [get,list,watch]",
246+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - pods: [get,list,watch]",
247+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - configmaps: [get]",
248+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - discovery.k8s.io/endpointslices: [get,list,watch]",
249+
"missing the following rules for system:serviceaccount:test-ns:test-ta-targetallocator - nonResourceURL: /metrics: [get]",
246250
},
247251
},
248252
{

Diff for: apis/v1beta1/collector_webhook.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/open-telemetry/opentelemetry-operator/internal/config"
3030
"github.com/open-telemetry/opentelemetry-operator/internal/fips"
3131
ta "github.com/open-telemetry/opentelemetry-operator/internal/manifests/targetallocator/adapters"
32+
"github.com/open-telemetry/opentelemetry-operator/internal/naming"
3233
"github.com/open-telemetry/opentelemetry-operator/internal/rbac"
3334
"github.com/open-telemetry/opentelemetry-operator/pkg/featuregate"
3435
)
@@ -341,8 +342,12 @@ func (c CollectorWebhook) validateTargetAllocatorConfig(ctx context.Context, r *
341342
}
342343
// if the prometheusCR is enabled, it needs a suite of permissions to function
343344
if r.Spec.TargetAllocator.PrometheusCR.Enabled {
345+
saname := r.Spec.TargetAllocator.ServiceAccount
346+
if len(r.Spec.TargetAllocator.ServiceAccount) == 0 {
347+
saname = naming.TargetAllocatorServiceAccount(r.Name)
348+
}
344349
warnings, err := CheckTargetAllocatorPrometheusCRPolicyRules(
345-
ctx, c.reviewer, r.Spec.TargetAllocator.ServiceAccount, r.GetNamespace())
350+
ctx, c.reviewer, r.GetNamespace(), saname)
346351
if err != nil || len(warnings) > 0 {
347352
return warnings, err
348353
}

Diff for: apis/v1beta1/collector_webhook_test.go

+16-12
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,10 @@ func TestOTELColValidatingWebhook(t *testing.T) {
651651
name: "prom CR admissions warning",
652652
shouldFailSar: true, // force failure
653653
otelcol: v1beta1.OpenTelemetryCollector{
654+
ObjectMeta: metav1.ObjectMeta{
655+
Name: "adm-warning",
656+
Namespace: "test-ns",
657+
},
654658
Spec: v1beta1.OpenTelemetryCollectorSpec{
655659
Mode: v1beta1.ModeStatefulSet,
656660
OpenTelemetryCommonFields: v1beta1.OpenTelemetryCommonFields{
@@ -693,18 +697,18 @@ func TestOTELColValidatingWebhook(t *testing.T) {
693697
},
694698
},
695699
expectedWarnings: []string{
696-
"missing the following rules for monitoring.coreos.com/servicemonitors: [*]",
697-
"missing the following rules for monitoring.coreos.com/podmonitors: [*]",
698-
"missing the following rules for nodes/metrics: [get,list,watch]",
699-
"missing the following rules for services: [get,list,watch]",
700-
"missing the following rules for endpoints: [get,list,watch]",
701-
"missing the following rules for namespaces: [get,list,watch]",
702-
"missing the following rules for networking.k8s.io/ingresses: [get,list,watch]",
703-
"missing the following rules for nodes: [get,list,watch]",
704-
"missing the following rules for pods: [get,list,watch]",
705-
"missing the following rules for configmaps: [get]",
706-
"missing the following rules for discovery.k8s.io/endpointslices: [get,list,watch]",
707-
"missing the following rules for nonResourceURL: /metrics: [get]",
700+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - monitoring.coreos.com/servicemonitors: [*]",
701+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - monitoring.coreos.com/podmonitors: [*]",
702+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - nodes/metrics: [get,list,watch]",
703+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - services: [get,list,watch]",
704+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - endpoints: [get,list,watch]",
705+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - namespaces: [get,list,watch]",
706+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - networking.k8s.io/ingresses: [get,list,watch]",
707+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - nodes: [get,list,watch]",
708+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - pods: [get,list,watch]",
709+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - configmaps: [get]",
710+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - discovery.k8s.io/endpointslices: [get,list,watch]",
711+
"missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - nonResourceURL: /metrics: [get]",
708712
},
709713
},
710714
{

Diff for: apis/v1beta1/targetallocator_rbac.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ func CheckTargetAllocatorPrometheusCRPolicyRules(
6161
serviceAccountName string) (warnings []string, err error) {
6262
subjectAccessReviews, err := reviewer.CheckPolicyRules(
6363
ctx,
64-
namespace,
6564
serviceAccountName,
65+
namespace,
6666
targetAllocatorCRPolicyRules...,
6767
)
6868
if err != nil {

0 commit comments

Comments
 (0)