Skip to content

Commit

Permalink
Merge branch 'main' into cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronoff97 committed Sep 16, 2024
2 parents 09ad837 + f2a8cf2 commit 97fc6fe
Show file tree
Hide file tree
Showing 109 changed files with 3,592 additions and 2,903 deletions.
16 changes: 16 additions & 0 deletions .chloggen/3218-align-label-filter-flag.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: deprecation

# 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: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Deprecated `label` flag and introduced `labels-filter` flag to align the label filtering with the attribute filtering flag name. The `label` flag will be removed when #3236 issue is resolved."

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

# (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:
16 changes: 16 additions & 0 deletions .chloggen/enhanced-webhook.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: Added reconciliation errors for webhook events. The webhooks run the manifest generators to check for any errors.

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

# (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:
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# should be compatible with them.
kube-version:
- "1.23"
- "1.30"
- "1.31"
group:
- e2e
- e2e-automatic-rbac
Expand All @@ -40,7 +40,7 @@ jobs:
- group: e2e-multi-instrumentation
setup: "add-multi-instrumentation-params prepare-e2e"
- group: e2e-metadata-filters
setup: "add-operator-arg OPERATOR_ARG='--annotations-filter=.*filter.out --annotations-filter=config.*.gke.io.* --labels=.*filter.out' prepare-e2e"
setup: "add-operator-arg OPERATOR_ARG='--annotations-filter=.*filter.out --annotations-filter=config.*.gke.io.* --labels-filter=.*filter.out' prepare-e2e"
- group: e2e-automatic-rbac
setup: "add-rbac-permissions-to-operator prepare-e2e"
steps:
Expand All @@ -57,7 +57,7 @@ jobs:
path: bin
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}-${{ steps.setup-go.outputs.go-version }}
- name: Install chainsaw
uses: kyverno/[email protected].8
uses: kyverno/[email protected].9
- name: Install tools
run: make install-tools
- name: Prepare e2e tests
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publish-test-e2e-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@ jobs:
with:
path: nodejs
platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
metrics-basic-auth:
uses: ./.github/workflows/reusable-publish-test-e2e-images.yaml
with:
path: metrics-basic-auth
platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
kube-version:
- "1.23"
- "1.30"
- "1.31"

steps:

Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,47 @@

<!-- next version -->

## 0.108.0

### 💡 Enhancements 💡

- `auto-instrumentation`: set OTEL_EXPORTER_OTLP_PROTOCOL instead of signal specific env vars in python instrumentation (#3165)
- `collector`: Allow autoscaler targetCPUUtilization and TargetMemoryUtilization to be greater than 99 (#3258)
- `auto-instrumentation`: Not ignore the `instrumentation.opentelemetry.io/container-names` annotation when the multi-instrumentation is enabled (#3090)
- `operator`: Support for Kubernetes `1.31` version. (#3247)
- `target allocator`: introduces the global field in the TA config to allow for setting scrape protocols (#3160)

### 🧰 Bug fixes 🧰

- `auto-instrumentation`: Fix file copy for NGINX auto-instrumentation for non-root workloads. (#2726)
- `target allocator`: Retrying failed namespace informer creation in promOperator CRD watcher, then exit if creation issue cannot be resolved (#3216)
- `target allocator`: Rollback #3187 (#3242)
This Rollsback 3187 which breaks TargetAllocator config for clusters with custom domains.
- `auto-instrumentation`: Fixes a bug that was preventing auto instrumentation from getting correct images. (#3014)
This PR removes the restriction on the operator to only upgrade manually applied CRDs. This meant
that resources applied by helm were not upgraded at all. The solution was to remove the restriction
we had on querying the label app.kubernetes.io/managed-by=opentelemetry-operator, thereby upgrading
ALL CRDs in the cluster.

- `collector`: Fixes a bug that was preventing upgrade patches from reliably applying. (#3074)
A bug was discovered in the process of testing the PR that was failing to remove the environment
variables introduced in the 0.104.0 upgrade. The fix was to take a deepcopy of the object and update that.

- `collector`: Don't unnecessarily take ownership of PersistentVolumes and PersistentVolumeClaims (#3042)
- `awsxray-receiver`: Switched the protocol of awsxray-receiver to UDP from TCP (#3261)

### Components

* [OpenTelemetry Collector - v0.108.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.108.0)
* [OpenTelemetry Contrib - v0.108.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.108.0)
* [Java auto-instrumentation - v1.33.5](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.33.5)
* [.NET auto-instrumentation - v1.2.0](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v1.2.0)
* [Node.JS - v0.52.1](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.52.1)
* [Python - v0.48b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.48b0)
* [Go - v0.14.0-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.14.0-alpha)
* [ApacheHTTPD - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)
* [Nginx - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)

## 0.107.0

### 💡 Enhancements 💡
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif

START_KIND_CLUSTER ?= true

KUBE_VERSION ?= 1.30
KUBE_VERSION ?= 1.31
KIND_CONFIG ?= kind-$(KUBE_VERSION).yaml
KIND_CLUSTER_NAME ?= "otel-operator"

Expand Down Expand Up @@ -437,7 +437,7 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
CHAINSAW ?= $(LOCALBIN)/chainsaw

KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CONTROLLER_TOOLS_VERSION ?= v0.16.1
GOLANGCI_LINT_VERSION ?= v1.57.2
KIND_VERSION ?= v0.20.0
CHAINSAW_VERSION ?= v0.2.5
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The operator manages:
## Documentation

- [API docs](./docs/api.md)
- [Offical Telemetry Operator page](https://opentelemetry.io/docs/kubernetes/operator/)

## Helm Charts

Expand Down Expand Up @@ -758,6 +759,7 @@ The OpenTelemetry Operator _might_ work on versions outside of the given range,

| OpenTelemetry Operator | Kubernetes | Cert-Manager | Prometheus-Operator |
|------------------------|----------------| ------------ |---------------------|
| v0.108.0 | v1.23 to v1.31 | v1 | v0.76.0 |
| v0.107.0 | v1.23 to v1.30 | v1 | v0.75.0 |
| v0.106.0 | v1.23 to v1.30 | v1 | v0.75.0 |
| v0.105.0 | v1.23 to v1.30 | v1 | v0.74.0 |
Expand All @@ -780,7 +782,6 @@ The OpenTelemetry Operator _might_ work on versions outside of the given range,
| v0.88.0 | v1.23 to v1.28 | v1 | v0.68.0 |
| v0.87.0 | v1.23 to v1.28 | v1 | v0.68.0 |
| v0.86.0 | v1.23 to v1.28 | v1 | v0.68.0 |
| v0.85.0 | v1.19 to v1.28 | v1 | v0.67.1 |

## Contributing and Developing

Expand Down Expand Up @@ -815,7 +816,7 @@ Emeritus Target Allocator Maintainers
Maintainers ([@open-telemetry/operator-maintainers](https://github.com/orgs/open-telemetry/teams/operator-maintainers)):

- [Jacob Aronoff](https://github.com/jaronoff97), Lightstep
- [Mikołaj Świątek](https://github.com/swiatekm), Sumo Logic
- [Mikołaj Świątek](https://github.com/swiatekm), Elastic
- [Pavol Loffay](https://github.com/pavolloffay), Red Hat

Emeritus Maintainers
Expand Down
16 changes: 8 additions & 8 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ In order to have more people comfortable with the release process, and in order

The operator should be released within a week after the [OpenTelemetry collector release](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/release.md#release-schedule).

| Version | Release manager |
|-----------|-----------------|
| v0.108.0 | @TylerHelmuth |
| v0.109.0 | @jaronoff97 |
| v0.110.0 | @swiatekm |
| v0.111.0 | @frzifus |
| v0.112.0 | @yuriolisa |
| v0.113.0 | @pavolloffay |
| Version | Release manager |
|----------|-----------------|
| v0.109.0 | @jaronoff97 |
| v0.110.0 | @swiatekm |
| v0.111.0 | @frzifus |
| v0.112.0 | @yuriolisa |
| v0.113.0 | @pavolloffay |
| v0.114.0 | @TylerHelmuth |
4 changes: 0 additions & 4 deletions apis/v1alpha1/instrumentation_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ func (w InstrumentationWebhook) defaulter(r *Instrumentation) error {
if r.Labels == nil {
r.Labels = map[string]string{}
}
if r.Labels["app.kubernetes.io/managed-by"] == "" {
r.Labels["app.kubernetes.io/managed-by"] = "opentelemetry-operator"
}

if r.Spec.Java.Image == "" {
r.Spec.Java.Image = w.cfg.AutoInstrumentationJavaImage()
}
Expand Down
18 changes: 7 additions & 11 deletions apis/v1alpha1/opampbridge_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,42 +52,38 @@ func (o *OpAMPBridgeWebhook) Default(ctx context.Context, obj runtime.Object) er
return o.defaulter(opampBridge)
}

func (c OpAMPBridgeWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (o *OpAMPBridgeWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
opampBridge, ok := obj.(*OpAMPBridge)
if !ok {
return nil, fmt.Errorf("expected an OpAMPBridge, received %T", obj)
}
return c.validate(opampBridge)
return o.validate(opampBridge)
}

func (c OpAMPBridgeWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
func (o *OpAMPBridgeWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
opampBridge, ok := newObj.(*OpAMPBridge)
if !ok {
return nil, fmt.Errorf("expected an OpAMPBridge, received %T", newObj)
}
return c.validate(opampBridge)
return o.validate(opampBridge)
}

func (o OpAMPBridgeWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (o *OpAMPBridgeWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
opampBridge, ok := obj.(*OpAMPBridge)
if !ok || opampBridge == nil {
return nil, fmt.Errorf("expected an OpAMPBridge, received %T", obj)
}
return o.validate(opampBridge)
}

func (o OpAMPBridgeWebhook) defaulter(r *OpAMPBridge) error {
func (o *OpAMPBridgeWebhook) defaulter(r *OpAMPBridge) error {
if len(r.Spec.UpgradeStrategy) == 0 {
r.Spec.UpgradeStrategy = UpgradeStrategyAutomatic
}

if r.Labels == nil {
r.Labels = map[string]string{}
}
if r.Labels["app.kubernetes.io/managed-by"] == "" {
r.Labels["app.kubernetes.io/managed-by"] = "opentelemetry-operator"
}

one := int32(1)
if r.Spec.Replicas == nil {
r.Spec.Replicas = &one
Expand All @@ -104,7 +100,7 @@ func (o OpAMPBridgeWebhook) defaulter(r *OpAMPBridge) error {
return nil
}

func (o OpAMPBridgeWebhook) validate(r *OpAMPBridge) (admission.Warnings, error) {
func (o *OpAMPBridgeWebhook) validate(r *OpAMPBridge) (admission.Warnings, error) {
warnings := admission.Warnings{}

// validate OpAMP server endpoint
Expand Down
12 changes: 3 additions & 9 deletions apis/v1alpha1/opampbridge_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ func TestOpAMPBridgeDefaultingWebhook(t *testing.T) {
opampBridge: OpAMPBridge{},
expected: OpAMPBridge{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"app.kubernetes.io/managed-by": "opentelemetry-operator",
},
Labels: map[string]string{},
},
Spec: OpAMPBridgeSpec{
Replicas: &one,
Expand All @@ -71,9 +69,7 @@ func TestOpAMPBridgeDefaultingWebhook(t *testing.T) {
},
expected: OpAMPBridge{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"app.kubernetes.io/managed-by": "opentelemetry-operator",
},
Labels: map[string]string{},
},
Spec: OpAMPBridgeSpec{
Replicas: &five,
Expand All @@ -93,9 +89,7 @@ func TestOpAMPBridgeDefaultingWebhook(t *testing.T) {
},
expected: OpAMPBridge{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"app.kubernetes.io/managed-by": "opentelemetry-operator",
},
Labels: map[string]string{},
},
Spec: OpAMPBridgeSpec{
Replicas: &one,
Expand Down
3 changes: 3 additions & 0 deletions apis/v1alpha1/targetallocator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ type TargetAllocatorSpec struct {
// +optional
// +kubebuilder:default:=relabel-config
FilterStrategy v1beta1.TargetAllocatorFilterStrategy `json:"filterStrategy,omitempty"`
// GlobalConfig configures the global configuration for Prometheus
// For more info, see https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration-file.
GlobalConfig v1beta1.AnyConfig `json:"global,omitempty"`
// ScrapeConfigs define static Prometheus scrape configurations for the target allocator.
// To use dynamic configurations from ServiceMonitors and PodMonitors, see the PrometheusCR section.
// For the exact format, see https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config.
Expand Down
1 change: 1 addition & 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.

Loading

0 comments on commit 97fc6fe

Please sign in to comment.