Install and upgrade
Get access to the Kavach Enterprise image and manifests, pin a version, install the operator, check it works, and upgrade or roll back safely.
Get access#
Kavach Enterprise is not open source. With access, you get:
- pull access to the image
ghcr.io/kavachlabs/kavach-daemon, private on the GitHub Container Registry; - the Kubernetes manifests for that release:
crds.yaml,operator-deployment.yamland the reference sidecarshadow-healer-sidecar.yaml.
To get access, write to hello@thekavachlabs.com.
Choose a version#
Each release publishes one multi-arch image (linux/amd64, linux/arm64) under several tags:
| Tag | Example | Use |
|---|---|---|
X.Y.Z |
0.1.1 |
Production. Never changes. |
X.Y |
0.1 |
Takes patch releases within a minor version. |
sha-<commit> |
sha-43c3884 |
One exact build. |
latest |
The newest release. Moves with every release, so use it for trials only. |
Pin X.Y.Z in production, or better, the image digest (kavach-daemon@sha256:…). The reference manifests use latest, and ProtectedService.spec.daemonImage defaults to it; set both before you go to production. The image includes the open-source kavach CLI at a fixed commit, so a pinned image also pins the CLI the daemon replays with.
Before 1.0, a minor version may change custom resource fields and flags. Read the release notes before moving from one minor version to the next.
Let the cluster pull the image#
Create a pull secret in each namespace that runs the daemon or the operator, using the registry credentials you were given:
kubectl create secret docker-registry kavach-registry \
--namespace payments \
--docker-server=ghcr.io \
--docker-username=<username> \
--docker-password="$(cat registry-token.txt)"Then attach it to the service account the pods run as. This covers the sidecars the operator creates, which run as the ProtectedService's serviceAccountName:
kubectl patch serviceaccount payments -n payments \
-p '{"imagePullSecrets": [{"name": "kavach-registry"}]}'For pods you write yourself, you can instead list it under spec.imagePullSecrets.
Install the operator#
The operator is namespaced: it manages ProtectedService, HealingPolicy and QuarantineDrain resources in the namespace it runs in, with a Role limited to that namespace. Install one per namespace you want protected.
-
Install the custom resource definitions, once per cluster:
kubectl apply -f crds.yaml kubectl get crd | grep kavach.devYou should see
protectedservices.kavach.dev,healingpolicies.kavach.devandquarantinedrains.kavach.dev. -
Set the image tag in
operator-deployment.yaml, add the pull secret, then apply it to the namespace:kubectl apply -n payments -f operator-deployment.yaml kubectl rollout status -n payments deployment/kavach-operatorThis creates the operator's service account, its
RoleandRoleBinding, two network policies (deny everything, then allow egress on DNS and on ports 443 and 6443 only), and the deployment. -
Check the storage the services will use, from inside the cluster:
kubectl run kavach-probe -n payments --rm -it --restart=Never \ --image=ghcr.io/kavachlabs/kavach-daemon:<version> \ --overrides='{"spec":{"imagePullSecrets":[{"name":"kavach-registry"}]}}' \ -- --diagnose-storage s3://acme-kavach/payments --region us-east-1 -
Create a
HealingPolicyand aProtectedService, as in Deploy, and check the operator accepted them:kubectl get protectedservices -n payments kubectl describe protectedservice payments -n payments
To see what the operator would create without changing anything, run it once with --reconcile-operator --dry-run --once: it prints the manifests.
Without the operator#
Use the reference shadow-healer-sidecar.yaml as a starting point: set the image tag, the bucket, the service's two builds and the pull secret, and add the containers to your own deployment. See Sidecar.
Upgrade#
- Read the release notes for every version between yours and the target.
- If the release changes the custom resource definitions, apply its
crds.yamlfirst. CRDs are cluster-wide, so this affects every namespace. - Change the image tag (or digest) in the operator deployment, in
spec.daemonImageof eachProtectedService, and in sidecars you manage yourself. The operator rolls out the sidecars it manages whendaemonImagechanges. - Watch the rollout:
kubectl rollout status, then/readyzon the new pods. A daemon that cannot verify its storage never becomes ready, so a bad upgrade stops at the first pod.
The daemon finishes its current pass on SIGTERM and exits, so a normal rolling update is safe. Keep the default terminationGracePeriodSeconds (30 seconds) or longer.
The release notes say if a version changes the format of anything in your bucket. Run kavach-daemon --verify-audit after the upgrade to confirm the audit trail still verifies.
Roll back#
Set the image back to the previous tag or digest and roll out again:
kubectl rollout undo -n payments deployment/kavach-operatorIf the upgrade also applied a newer crds.yaml, roll back the image first, then reapply the old crds.yaml only if the release notes say the new one is not backwards compatible. Run kavach-daemon --verify-audit after a rollback to confirm the audit trail is intact.
Uninstall#
kubectl delete -n payments protectedservices --all
kubectl delete -n payments -f operator-deployment.yaml
kubectl delete -f crds.yaml # last namespace only: deletes every Kavach resource in the clusterYour bucket is not touched. Delete it, or the Kavach prefixes in it, separately if you no longer need the incident history and audit trail.
Something wrong or missing on this page? Report it on GitHub, or write to hello@thekavachlabs.com.