# Kubernetes application handover demonstration

This is a small InstaDevOps acceptance example, not a customer case study or a
production cluster blueprint. It makes a limited delivery claim reproducible:
a healthy two-replica application, denied secret access, detection of an unready
release, and recovery to the previous application revision.

## Scope and limitations

The example uses one local kind node. Two application replicas on that node do
not provide node-level high availability. The checks sample HTTP responses at
specific points; they do not prove uninterrupted service or a recovery-time
SLA. No cloud resources, real data or production credentials are used.

The workload has resource requests/limits, health probes, a non-root user,
read-only root filesystem, dropped Linux capabilities, RuntimeDefault seccomp
and no mounted service-account token. Namespace admission enforces the
Kubernetes restricted Pod Security Standard. The test also checks that its
service account cannot read Secrets through the API.

This does not validate network-policy enforcement, ingress/TLS, autoscaling,
cloud identity, node failure, persistent storage, backup restoration, load
capacity or cluster-version recovery. Those require their own scoped tests.

## Reproduce

Use Docker, kubectl, curl and bash. Install kind from its official release and
verify the published checksum. This record used kind v0.33.0 and Kubernetes
v1.36.4 on arm64; a new version needs a fresh result record.

Save `demo.yaml` and `verify.sh` in the same directory. Create a disposable
cluster with a separate kubeconfig. The API remains on loopback; the commands
do not use your ordinary kubeconfig or existing cluster context.

```sh
kind create cluster \
  --name instadevops-dvps020 \
  --kubeconfig /tmp/instadevops-handover.kubeconfig \
  --image kindest/node:v1.36.4@sha256:099e049362a1526b2db71494e1947aae99bd16290d7c895f2b7ea312e3cbfaed \
  --wait 120s
bash verify.sh /tmp/instadevops-handover.kubeconfig
```

The script requires that exact context and a loopback API endpoint, refuses an
existing demo namespace, and cleans up only the namespace it creates. It
starts a temporary loopback port-forward and stops it on exit. Review scripts
before running them and keep this exercise separate from production.

The intentionally wrong readiness path must prevent rollout completion. The
expected rollout timeout is part of the test, not an instruction to ignore
other errors. The script then checks that two existing replicas remain
available and the old HTTP endpoint responds, restores the previous revision,
and checks the recovered deployment and HTTP response.

After verification, remove only the disposable cluster you created:

```sh
kind delete cluster --name instadevops-dvps020 \
  --kubeconfig /tmp/instadevops-handover.kubeconfig
```

## Observed result

See `result-2026-10-17.json` for the dated execution record and artifact hashes.
The node and application images are pinned by digest in the reproduction
command and manifest. This records a bounded local rehearsal, not an uptime,
security certification or production performance claim.

For an actual project, retain the workload/environment identifiers, versions,
change approvals, test inputs, failure evidence, recovery evidence, unresolved
risks and receiving owner alongside the handover runbook.

## Primary references

- https://kind.sigs.k8s.io/docs/user/quick-start/
- https://kubernetes.io/docs/setup/production-environment/
- https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
- https://kubernetes.io/docs/concepts/security/pod-security-standards/
