wojciechgrazawskiahnl opened a new issue, #7012:
URL: https://github.com/apache/camel-k/issues/7012
## What happened?
After upgrading the operator from a pre-2.11 release to 2.11.0, every
running Integration whose IntegrationKit was built
before the upgrade ends up in phase `Error`.
The 2.11.0 operator re-renders the Deployment of existing Integrations with
health probes on
`:9876/observe/health/*` (the `camel-quarkus-observability-services`
endpoint, default since #6662). The
Integration keeps its existing IntegrationKit, which was built before the
upgrade and doesn't contain
`camel-quarkus-observability-services`, so nothing listens on 9876:
- the new pod fails its liveness probe (`connection refused`) and is
restarted forever (exit code 143);
- the old ReplicaSet keeps serving, because the rolling update never
completes;
- the Deployment reports `ProgressDeadlineExceeded`, and the Integration
goes to `Error`
(`ReplicaSet "<name>-<hash>" has timed out progressing`).
Same image digest on both pods, only the probes differ:
| | Old pod (pre-upgrade ReplicaSet) | New pod (2.11.0 ReplicaSet) |
|---|---|---|
| Liveness | `8080/q/health/live` | `9876/observe/health/live` |
| Readiness | `8080/q/health/ready` | `9876/observe/health/ready` |
| State | Ready, 0 restarts | CrashLoopBackOff |
On the old image, `8080/q/health/live` returns `200`, `9876` refuses
connections.
The Integration recovers once it is rebuilt (any spec change), because the
new kit then includes
`camel-quarkus-observability-services`.
## Cause
`setProbesValues` in `pkg/trait/health.go` picks the probe port and paths
from the catalog runtime
provider only:
https://github.com/apache/camel-k/blob/v2.11.0/pkg/trait/health.go#L110-L151
```go
isOlderCamelKRuntime := e.CamelCatalog.Runtime.Provider ==
v1.RuntimeProviderQuarkus
t.probesPort = defaultObsSvcHealthPort
if isOlderCamelKRuntime {
t.probesPort = defaultQuarkusHealthPort
}
```
With the `plain-quarkus` provider it always selects 9876, without checking
whether the Integration's
kit actually contains `camel-quarkus-observability-services`. That
dependency is only added to kits
built by the 2.11.0 operator
([`pkg/controller/catalog/initialize.go`
L109-L114](https://github.com/apache/camel-k/blob/v2.11.0/pkg/controller/catalog/initialize.go#L109-L114)),
so every kit built by an earlier operator gets probes it can't answer.
`main` has the same logic.
## Steps to reproduce
1. Install a pre-2.11 operator and run an Integration on the `plain-quarkus`
runtime with the health trait
enabled (e.g. `health.livenessProbeEnabled: true`).
2. Wait until it is `Running`.
3. Upgrade the operator to 2.11.0 without changing the Integration.
4. The Deployment gets a new ReplicaSet with probes on
`9876/observe/health/*`; its pod crash-loops and,
after the progress deadline, the Integration goes to `Error`.
## Expected behaviour
An operator upgrade doesn't break running Integrations. For example:
- choose 9876 / `/observe/health` only when the Integration's kit contains
`camel-quarkus-observability-services`, otherwise keep `8080` /
`/q/health`; or
- rebuild (or at least flag) Integrations whose kit predates the new
defaults; or
- at minimum, document in the 2.11 upgrade notes that existing Integrations
must be rebuilt.
## Workaround
Rebuild every existing Integration after the upgrade (any spec change), or
pin the probes on the health
trait (`livenessPort`, `readinessPort`, `livenessProbe`, `readinessProbe`).
## Minor
The API docs of the health trait still say "The liveness port to use
(default 8080)" (and the same for
readiness and startup), but for `plain-quarkus` the default is now 9876:
https://github.com/apache/camel-k/blob/v2.11.0/pkg/apis/camel/v1/trait/health.go#L52-L92
## Environment
- Camel K operator: 2.11.0, upgraded from a pre-2.11 release
- Runtime provider: `plain-quarkus`
- Kubernetes: not platform-specific
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]