CASE 15 / KUBERNETES / PREVIEW / DEVELOPER EXPERIENCE

Feature Branch Preview Environments with Kubernetes

Design a disposable review environment for each change to an AEM-adjacent Java API. This scenario follows the complete lifecycle from branch creation to namespace removal, treating isolation, test data and cleanup as engineering requirements.

SHARE
LinkedIn X Facebook Threads

Engineering path

PREVIEW LIFECYCLE

Proposed engineering sequence

  1. 01Developer
  2. 02Feature branch
  3. 03CI build
  4. 04Container image
  5. 05Namespace
  6. 06Deploy & test
  7. 07Review
  8. 08Merge
  9. 09Destroy

01 / Context

A reviewable integration boundary

PLATFORM
Kubernetes / Docker
SCOPE
Feature Branch Preview Environments with Kubernetes
TYPE
Representative engineering scenario

A shared test API makes parallel changes interfere with one another. The proposed preview contains the API and its disposable dependencies, with either a controlled AEM test endpoint or a contract-compatible stub supplying content.

02 / PROBLEM

Isolation must include more than a URL

Separate hostnames do not separate credentials, outbound traffic or data. A namespace gives resources a scope, but the design also needs restrictive RBAC, supported network policies, resource quotas and a clear rule for which external systems a preview may contact.

03 / CONSTRAINTS

Boundaries the design must preserve

  1. Isolate preview configuration, credentials and routing from production.
  2. Give every temporary environment an owner and cleanup policy.

04 / ARCHITECTURE

One branch identity across infrastructure

Derive a bounded, DNS-safe identifier from the pull request and repository, not an arbitrary branch name alone. Use that identity for the namespace, routing host, configuration and fixture dataset; a controller-backed ingress or gateway exposes the review endpoint behind appropriate access controls.

SYSTEM / FLOW

PREVIEW LIFECYCLE

Only the integration service is deployed here. AEM test endpoints and sanitized fixtures remain external dependencies.

FEATURE BRANCH PREVIEW ENVIRONMENTS WITH KUBERNETESDeveloperFeature branchCI buildContainer imageNamespaceDeploy & testReviewMergeDestroy

Feature Branch Preview Environments with Kubernetes

  1. Developer
  2. Feature branch
  3. CI build
  4. Container image
  5. Namespace
  6. Deploy & test
  7. Review
  8. Merge
  9. Destroy

05 / ENGINEERING APPROACH

Reconcile desired state from a trusted pipeline

Build an immutable image from the commit, then reconcile the namespace and manifests with narrowly scoped deployment credentials. Treat untrusted fork builds separately: they must not inherit cluster credentials or access private AEM endpoints.

Implementation checkpoints

Proposed engineering checks for this scenario.

  1. 01Inject preview-only secrets; never bake them into the image.
  2. 02Use deterministic fixture data and contract tests alongside live integration tests.
  3. 03Attach owner, pull-request and expiry metadata so abandoned resources can be identified.

06 / DEPLOYMENT FLOW

Publish a review URL only after validation

Wait for scheduling, startup and readiness before running smoke and integration checks. Associate test evidence and the URL with the exact commit so reviewers do not accidentally approve a stale deployment.

BRANCH TO CLEANUP

Merge and branch closure request cleanup; a scheduled expiry reconciler catches missed events.

  1. 01Branch
  2. 02Build
  3. 03Image
  4. 04Namespace
  5. 05Deploy
  6. 06Test
  7. 07Review
  8. 08Merge
  9. 09Destroy

07 / OPERATIONAL CONSIDERATIONS

Cleanup is part of environment ownership

Namespace deletion does not prove that external DNS records, provisioned databases or retained volumes are gone. Track these resources explicitly, retry idempotent cleanup and alert on namespaces stuck terminating rather than blindly removing finalizers.

08 / TRADEOFFS

Real integration versus predictable feedback

A shared AEM test instance preserves realistic integration behavior but can still couple previews through content and rate limits. Stubs offer faster, reproducible checks but need contract verification; neither mode establishes full production equivalence.

Risks to resolve
RiskImpactMitigation to validate
Namespace treated as complete isolationWorkloads retain unintended accessReview network, identity and resource policies
Cleanup misses resourcesPreview infrastructure outlives the branchExercise merge, abandonment and failed-cleanup paths

Continue with the complementary design in Dockerized AEM Development: Reproducible Setup and Configuration.

09 / WHAT I WOULD VALIDATE IN PRODUCTION

Prove isolation and expiry before expanding access

The intended result is a reproducible feedback loop with clear environment ownership. It remains a design objective until the lifecycle is exercised under failures.

Acceptance scope and limits

TO VALIDATE

Proposed checks, not captured results.

  • Attempt cross-namespace access and forbidden outbound connections; inspect actual policy enforcement.
  • Cancel a pipeline during deployment, close its branch and verify both in-cluster and external resources are removed.
  • Update a branch during review and verify routing, fixtures and results refer to the new image digest.
  • Exercise quota exhaustion, missing secrets and unavailable AEM dependencies without exposing credentials.

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

A preview is a lifecycle, not a namespace

Provisioning is the easy half of ephemeral infrastructure. The useful engineering unit is the full contract: trusted inputs, isolated dependencies, reproducible tests, discoverable ownership and verifiable destruction.

Technical references

These sources document product behavior. The scenario and proposed validation are engineering interpretations, not vendor claims or execution evidence.

11 / CONTINUE EXPLORING

Related engineering work

12 / SHARE

SHARE THIS CASE STUDY

SHARE
LinkedIn X Facebook Threads

Working through a similar platform problem?

Start a conversation