CASE 17 / KUBERNETES / RELEASE SAFETY / API CONTRACTS
Blue/Green and Canary Deployments
Compare two release strategies for an API consumed by AEM: switch between validated blue/green environments or gradually expose a canary to selected traffic. Both require observable behavior and backward-compatible contracts, not simply a healthy container.
Engineering path
RELEASE CONTROL
Proposed engineering sequence
- 01Stable API
- 02Candidate API
- 03Readiness
- 04Test traffic
- 05Traffic decision
- 06Promote / revert
01 / Context
Keep the consumer stable while the API changes
- PLATFORM
- Kubernetes / Docker
- SCOPE
- Blue/Green and Canary Deployments on Kubernetes
- TYPE
- Representative engineering scenario
The integration service evolves independently of AEM components and OSGi clients. A candidate release must therefore accept requests from existing consumers throughout deployment and rollback.
02 / PROBLEM
Infrastructure health misses contract failures
A candidate may report ready while returning a changed payload, causing downstream errors or breaking session assumptions. A successful HTTP health response does not establish semantic compatibility with the consumer.
03 / CONSTRAINTS
Boundaries the design must preserve
- Keep old and new API contracts compatible during overlap.
- Choose traffic exposure and rollback conditions before rollout.
04 / ARCHITECTURE
Blue/green switches; canary observes
Blue/green uses separate workload labels and a controlled routing switch after candidate validation. A canary requires a routing layer that supports weighted or cohort-based traffic; a standard Service or Deployment alone is not a precise percentage-routing mechanism.
RELEASE CONTROL
Logical release stages, not a serial request path. Stable and candidate workloads coexist behind controlled routing.
Blue/Green and Canary Deployments on Kubernetes
- Stable API
- Candidate API
- Readiness
- Test traffic
- Traffic decision
- Promote / revert
05 / ENGINEERING APPROACH
Define the rollback boundary before the rollout
Test old and new consumers against the candidate contract, and use additive data changes before removing fields. Configure startup and readiness checks for usable service behavior, while keeping liveness focused on recoverable process failure rather than every remote dependency.
Implementation checkpoints
Proposed engineering checks for this scenario.
- 01Give stable and candidate revisions separate monitoring dimensions.
- 02Document routing-controller behavior for retries, sticky sessions and long-lived connections.
- 03Define acceptance and abort conditions before changing traffic; do not infer success from Pod counts.
06 / DEPLOYMENT FLOW
Advance traffic only with comparable evidence
For blue/green, validate the idle candidate and switch the route while retaining the previous revision for a bounded recovery window. For canary, increase exposure only after comparing meaningful request samples and error behavior.
CANDIDATE DECISION
Traffic policy belongs to the chosen ingress, gateway or service-routing implementation.
- 01Deploy candidate
- 02Probe
- 03Contract tests
- 04Route traffic
- 05Observe
- 06Promote / rollback
07 / OPERATIONAL CONSIDERATIONS
Rollback includes connections and state
Allow in-flight work to drain and align termination behavior with the routing layer. A route reversal cannot undo incompatible database writes, irreversible external side effects or an already-broken client contract.
08 / TRADEOFFS
Capacity, sampling and decision speed
Blue/green needs enough temporary capacity for both revisions but offers a clear switch point. Canary limits initial exposure, yet low traffic or biased cohorts can hide defects and prolong the decision window.
| Risk | Impact | Mitigation to validate |
|---|---|---|
| Unrepresentative canary traffic | Failures remain hidden during observation | Exercise critical routes and access states |
| State incompatible with rollback | Traffic reversal cannot restore behavior | Review shared data and dependency compatibility |
Continue with the complementary design in CI/CD Delivery to Kubernetes.
09 / WHAT I WOULD VALIDATE IN PRODUCTION
Rehearse a bad release deliberately
Reduced deployment risk is a target, not an asserted result. Test the abort path as carefully as the successful promotion path.
Acceptance scope and limits
TO VALIDATE
Proposed checks, not captured results.
- Inject an API contract mismatch that readiness alone would miss.
- Verify observed traffic matches the intended routing policy and excludes synthetic probe traffic from comparisons.
- Revert during active requests and check draining, client retries and duplicate side effects.
- Exercise old and new service revisions against the same evolving data schema.
DOES NOT CLAIM
An anonymized architecture scenario for AEM-adjacent services. AEM remains on its separately supported deployment platform; this design does not place standard Adobe AEM deployments on Kubernetes. No production delivery or measured outcome is claimed.
- A completed customer deployment or measured production outcome
- A passing test run without retained execution evidence
10 / LESSONS
Safe traffic needs a safe contract
Traffic control contains exposure; it does not repair incompatible application changes. Choose the release strategy after defining what can safely coexist and what evidence warrants promotion.
Technical references
These sources document product behavior. The scenario and proposed validation are engineering interpretations, not vendor claims or execution evidence.