Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into add-missing-rbac
Browse files Browse the repository at this point in the history
  • Loading branch information
husnialhamdani authored Nov 24, 2023
2 parents aa16697 + 4baf9c0 commit e93ffbb
Show file tree
Hide file tree
Showing 71 changed files with 5,826 additions and 698 deletions.
16 changes: 16 additions & 0 deletions .chloggen/.bump-dotnet-1.2.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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. operator, target allocator, github action)
component: autoinstrumentation

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Bump OpenTelemetry .NET Automatic Instrumentation to 1.2.0

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

# (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:
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: OpAMP Bridge
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Sends a heartbeat from the bridge and brings the annotation to spec.
note: add liveness probe to target allocator deployment generation

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

# (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.
Expand Down
4 changes: 2 additions & 2 deletions .chloggen/truncate-pod-label.yaml → .chloggen/sa-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ change_type: bug_fix
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Truncate `sidecar.opentelemetry.io/injected` sidecar pod label to 63 characters
note: check if service account specified in otelcol before creating service account resource for collectors

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

# (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.
Expand Down
16 changes: 16 additions & 0 deletions .chloggen/ta-readiness-probe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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. operator, target allocator, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: add readiness probe to target allocator deployment generation

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

# (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:
4 changes: 2 additions & 2 deletions ...ggen/target-allocator-container-port.yaml → .chloggen/ta-readiness.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ change_type: enhancement
component: target allocator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Declare and use ContainerPort for Target Allocator
note: add readyz endpoint to TA

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

# (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.
Expand Down
16 changes: 16 additions & 0 deletions .chloggen/target-allocator-delayed-collector-instances.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Save targets discovered before collector instances come up

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

# (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:
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ updates:
patterns:
- "k8s.io/*"
- "sigs.k8s.io/*"
otel:
patterns:
- go.opentelemetry.io/otel
- go.opentelemetry.io/otel/*
- package-ecosystem: gomod
directory: /cmd/otel-allocator
schedule:
Expand Down
53 changes: 48 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,57 @@ Changes by Version
==================
<!-- next version -->

## 0.89.0

### 🛑 Breaking changes 🛑

- `autoinstrumentation`: Bump Go auto instrumentation version to v0.8.0-alpha (#2358)
The default export protocol was switched from `grpc` to `http/proto`
- `target allocator`: Disable configuration hot reload (#2032)
This feature can be re-enabled by passing the --reload-config flag to the target allocator.
However, this is deprecated and will be removed in an upcoming release.

### 💡 Enhancements 💡

- `target allocator`: add healthcheck endpoint to TA (#2258)
- `OpAMP Bridge`: Sends a heartbeat from the bridge and brings the annotation to spec. (#2132)
- `operator`: Added updateStrategy for DaemonSet mode. (#2107)
- `operator`: add target allocator affinity configuration (#2263)
- `Operator`: Added the service.instance.id as the pod.UID into the traces resource Env. (#1921)
- `operator`: Support configuring images via RELATED_IMAGE_ environment variables (#2326)
- `target allocator`: Declare and use ContainerPort for Target Allocator (#2312)
- `target allocator`: Add logging for prometheus operator in TargetAllocator's config generator (#2348)

### 🧰 Bug fixes 🧰

- `target allocator`: Update file watcher to detect file write events (#2349)
- `target allocator`: Run the target allocator as a non-root user (#738)
Some Kubernetes configurations do not allow running images as root, so
provide a non-zero UID in the Docker image.

- `operator`: Truncate `sidecar.opentelemetry.io/injected` sidecar pod label to 63 characters (#1031)

### Components

* [OpenTelemetry Collector - v0.89.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.89.0)
* [OpenTelemetry Contrib - v0.89.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.89.0)
* [Java auto-instrumentation - 1.31.0](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.31.0)
* [.NET auto-instrumentation - 1.1.0](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/1.1.0)
* [Node.JS - 0.44.0](https://github.com/open-telemetry/opentelemetry-js-contrib/releases/tag/auto-instrumentations-node-0.44.0)
* [Python - 0.41b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/0.41b0)
* [Go - v0.8.0-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.8.0-alpha)
* [ApacheHTTPD - 1.0.3](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.3)
* [Nginx - 1.0.3](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.3)]


## 0.88.0

### 🛑 Breaking changes 🛑

- `OpAMP Bridge`: Currently, the bridge doesn't adhere to the spec for the naming structure. This changes the bridge to use the <namespace>/<otelcol> structure as described. (#2131)
* Updates the bridge to get collectors using the reporting annotation
* Fixes a bug where we were using the incorrect structure for the collectors


### 💡 Enhancements 💡

Expand Down Expand Up @@ -45,7 +88,7 @@ Changes by Version
- `operator`: Enable Target Allocator Rewrite by default (#2208)
See [the documentation](/README.md#target-allocator) for details.
Use the `--feature-gates=-operator.collector.rewritetargetallocator` command line option to switch back to the old behaviour.


### 💡 Enhancements 💡

Expand Down Expand Up @@ -78,7 +121,7 @@ Changes by Version
Kubernetes 1.23 is the minimum available version everywhere after 1.22 deprecation,
due to it, the minimum required version has been updated to it, dropping support for
autoscaling/v2beta2


### 💡 Enhancements 💡

Expand Down Expand Up @@ -171,12 +214,12 @@ Changes by Version
### 🛑 Breaking changes 🛑

- `operator`: Make sure OTLP export can report data to OTLP ingress/route without additional configuration (#1967)
The ingress can be configured to create a single host with multiple paths or
The ingress can be configured to create a single host with multiple paths or
multiple hosts with subdomains (one per receiver port).
The path from OpenShift route was removed.
The port names are truncate to 15 characters. Users with custom receivers
which create ports with longer name might need to update their configuration.


### 💡 Enhancements 💡

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ spec:
# See https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/888e2cd216c77d12e56b54ee91dafbc4e7452a52/docs/config.md#otlp
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://otel-collector:4318
go:
env:
# Required if endpoint is set to 4317.
# Go autoinstrumentation uses http/proto by default
# so data must be sent to 4318 instead of 4317.
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://otel-collector:4318
EOF
```

Expand Down Expand Up @@ -279,9 +286,6 @@ Go auto-instrumentation also requires elevated permissions. The below permission

```yaml
securityContext:
capabilities:
add:
- SYS_PTRACE
privileged: true
runAsUser: 0
```
Expand Down Expand Up @@ -682,6 +686,7 @@ The OpenTelemetry Operator *might* work on versions outside of the given range,

| OpenTelemetry Operator | Kubernetes | Cert-Manager |
|------------------------|----------------------|---------------------|
| v0.89.0 | v1.23 to v1.28 | v1 |
| v0.88.0 | v1.23 to v1.28 | v1 |
| v0.87.0 | v1.23 to v1.28 | v1 |
| v0.86.0 | v1.23 to v1.28 | v1 |
Expand All @@ -704,7 +709,6 @@ The OpenTelemetry Operator *might* work on versions outside of the given range,
| v0.69.0 | v1.19 to v1.25 | v1 |
| v0.68.0 | v1.19 to v1.25 | v1 |
| v0.67.0 | v1.19 to v1.25 | v1 |
| v0.66.0 | v1.19 to v1.25 | v1 |

## Contributing and Developing

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ The operator should be released within a week after the [OpenTelemetry collector

| Version | Release manager |
|---------|-----------------|
| v0.89.0 | @frzifus |
| v0.90.0 | @jaronoff97 |
| v0.91.0 | @yuriolisa |
| v0.92.0 | @pavolloffay |
| v0.93.0 | @VineethReddy02 |
| v0.94.0 | @TylerHelmuth |
| v0.95.0 | @swiatekm-sumo |
| v0.96.0 | @frzifus |
5 changes: 5 additions & 0 deletions apis/v1alpha1/collector_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ func (c CollectorWebhook) validate(r *OpenTelemetryCollector) (admission.Warning
}
}

// validate updateStrategy for DaemonSet
if r.Spec.Mode != ModeDaemonSet && len(r.Spec.UpdateStrategy.Type) > 0 {
return warnings, fmt.Errorf("the OpenTelemetry Collector mode is set to %s, which does not support the attribute 'updateStrategy'", r.Spec.Mode)
}

return warnings, nil
}

Expand Down
17 changes: 17 additions & 0 deletions apis/v1alpha1/collector_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/go-logr/logr"
"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
autoscalingv2 "k8s.io/api/autoscaling/v2"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -766,6 +767,22 @@ func TestOTELColValidatingWebhook(t *testing.T) {
},
expectedErr: "a valid Ingress hostname has to be defined for subdomain ruleType",
},
{
name: "invalid updateStrategy for Deployment mode",
otelcol: OpenTelemetryCollector{
Spec: OpenTelemetryCollectorSpec{
Mode: ModeDeployment,
UpdateStrategy: appsv1.DaemonSetUpdateStrategy{
Type: "RollingUpdate",
RollingUpdate: &appsv1.RollingUpdateDaemonSet{
MaxSurge: &intstr.IntOrString{Type: intstr.Int, IntVal: int32(1)},
MaxUnavailable: &intstr.IntOrString{Type: intstr.Int, IntVal: int32(1)},
},
},
},
},
expectedErr: "the OpenTelemetry Collector mode is set to deployment, which does not support the attribute 'updateStrategy'",
},
}

for _, test := range tests {
Expand Down
10 changes: 10 additions & 0 deletions apis/v1alpha1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package v1alpha1

import (
appsv1 "k8s.io/api/apps/v1"
autoscalingv2 "k8s.io/api/autoscaling/v2"
v1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
Expand Down Expand Up @@ -275,6 +276,11 @@ type OpenTelemetryCollectorSpec struct {
// object, which shall be mounted into the Collector Pods.
// Each ConfigMap will be added to the Collector's Deployments as a volume named `configmap-<configmap-name>`.
ConfigMaps []ConfigMapsSpec `json:"configmaps,omitempty"`
// UpdateStrategy represents the strategy the operator will take replacing existing DaemonSet pods with new pods
// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec
// This is only applicable to Daemonset mode.
// +optional
UpdateStrategy appsv1.DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
}

// OpenTelemetryTargetAllocator defines the configurations for the Prometheus target allocator.
Expand Down Expand Up @@ -309,6 +315,9 @@ type OpenTelemetryTargetAllocator struct {
// Enabled indicates whether to use a target allocation mechanism for Prometheus targets or not.
// +optional
Enabled bool `json:"enabled,omitempty"`
// If specified, indicates the pod's scheduling constraints
// +optional
Affinity *v1.Affinity `json:"affinity,omitempty"`
// PrometheusCR defines the configuration for the retrieval of PrometheusOperator CRDs ( servicemonitor.monitoring.coreos.com/v1 and podmonitor.monitoring.coreos.com/v1 ) retrieval.
// All CR instances which the ServiceAccount has access to will be retrieved. This includes other namespaces.
// +optional
Expand Down Expand Up @@ -398,6 +407,7 @@ type OpenTelemetryCollectorStatus struct {
}

// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:resource:shortName=otelcol;otelcols
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.scale.replicas,selectorpath=.status.scale.selector
Expand Down
6 changes: 6 additions & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

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

34 changes: 34 additions & 0 deletions apis/v1alpha2/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package v1alpha2 contains API Schema definitions for the v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=opentelemetry.io
package v1alpha2

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "opentelemetry.io", Version: "v1alpha2"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Loading

0 comments on commit e93ffbb

Please sign in to comment.