forked from open-telemetry/opentelemetry-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow version before 0.52 to upgrade (open-telemetry#1126)
* when Spec.selector changed, since it is immutable, the old deployment/statefulset/daemonset will be deleted and a new one with updated selector will be created. * add e2e test. * address lint. * add newline to end. * add newline to end. * add delete options to deployment and statefulset. * remove unecessary propagation policy, the default background is working fine. * Add unit test. * revert accident change. * remove timeout wait, don't 2 changes in one reconcile cycle. * fix lint * fix test, change name to isolate it from other tests. * revert accident change. * remove unsed constant. * Add comment for explaining the upgrading e2e test. * add e2e upgrade to workflow. * Address comment, adding detail comments for e2e upgrade test. * rever accident change. Co-authored-by: Pavol Loffay <[email protected]>
- Loading branch information
1 parent
d907f7f
commit 8b4247d
Showing
14 changed files
with
294 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Make sure that the OT operator after upgrading itself, can upgrade the OT collectors without error. | ||
# The test is based on the version v0.49.0, a breaking change was introduced from PR | ||
# https://github.com/open-telemetry/opentelemetry-operator/pull/797, which added a version label "app.kubernetes.io/version", | ||
# The version label would change between OT operator upgrade, and since at the time, the collector pod selector was the same | ||
# as this labels, resulted in selector being modified during reconciliation which caused error due to the selector is immutable. | ||
# Please be aware of that the collector labels are changeable in various ways, so this issue may happen in any operator < v0.52.0 | ||
# which changed the selector to be a static set of labels. | ||
# The fix for this issue including: | ||
# https://github.com/open-telemetry/opentelemetry-operator/issues/840, make the selector be a static set of labels; | ||
# https://github.com/open-telemetry/opentelemetry-operator/issues/1117, delete the old collector to let the operator | ||
# create a new one when the selector changed. | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
crdDir: ./tests/_build/crds/ | ||
artifactsDir: ./tests/_build/artifacts/ | ||
kindContainers: | ||
- local/opentelemetry-operator:e2e | ||
- ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:v0.49.0 | ||
commands: | ||
- command: make cert-manager | ||
- command: kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/download/v0.49.0/opentelemetry-operator.yaml | ||
- command: kubectl rollout status -w deployment/opentelemetry-operator-controller-manager -n opentelemetry-operator-system | ||
- command: sleep 60s | ||
testDirs: | ||
- ./tests/e2e-upgrade/ | ||
timeout: 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: simplest-collector | ||
annotations: | ||
operatorVersion: "v0.49.0" | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/version: latest | ||
status: | ||
readyReplicas: 1 | ||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: simplest-collector-headless | ||
spec: | ||
ports: | ||
- appProtocol: grpc | ||
name: jaeger-grpc | ||
port: 14250 | ||
protocol: TCP | ||
targetPort: 14250 | ||
- appProtocol: grpc | ||
name: otlp-grpc | ||
port: 4317 | ||
protocol: TCP | ||
targetPort: 4317 | ||
- appProtocol: http | ||
name: otlp-http | ||
port: 4318 | ||
protocol: TCP | ||
targetPort: 4318 | ||
- appProtocol: http | ||
name: otlp-http-legacy | ||
port: 55681 | ||
protocol: TCP | ||
targetPort: 4318 | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: simplest-collector | ||
spec: | ||
ports: | ||
- appProtocol: grpc | ||
name: jaeger-grpc | ||
port: 14250 | ||
protocol: TCP | ||
targetPort: 14250 | ||
- appProtocol: grpc | ||
name: otlp-grpc | ||
port: 4317 | ||
protocol: TCP | ||
targetPort: 4317 | ||
- appProtocol: http | ||
name: otlp-http | ||
port: 4318 | ||
protocol: TCP | ||
targetPort: 4318 | ||
- appProtocol: http | ||
name: otlp-http-legacy | ||
port: 55681 | ||
protocol: TCP | ||
targetPort: 4318 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: OpenTelemetryCollector | ||
metadata: | ||
name: simplest | ||
annotations: | ||
operatorVersion: "v0.49.0" | ||
spec: | ||
replicas: 1 | ||
config: | | ||
receivers: | ||
jaeger: | ||
protocols: | ||
grpc: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
processors: | ||
exporters: | ||
logging: | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [jaeger,otlp] | ||
processors: [] | ||
exporters: [logging] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl apply -f ../../_build/manifests/01-opentelemetry-operator.yaml | ||
- command: kubectl rollout status -w deployment/opentelemetry-operator-controller-manager -n opentelemetry-operator-system | ||
- command: sleep 60s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: simplest-collector | ||
annotations: | ||
operatorVersion: "latest" | ||
status: | ||
readyReplicas: 2 |
Oops, something went wrong.