Arka v1.0 Production Operations Handbook
This handbook defines the standard operating procedures (SOPs) for operating Arka v1.0 GA in production: PostgreSQL + RustFS/S3 backup & restore drills, zero-downtime secret rotation, and the end-to-end Sonatype Nexus 3 cutover & instant rollback playbook.
1. Backup & Restore Drill SOP (PostgreSQL 16 + RustFS/S3)
Arka stores all metadata (repositories, artifacts, assets, RBAC/Teams, security scans, SBOMs, signatures, signing keys, jobs, transactional webhook outbox events, audit events) in PostgreSQL and all immutable content-addressed blobs (sha256 keys with generation suffixes for isolated GC) in RustFS / S3, Azure Blob, or filesystem storage pools.
Because blobs are content-addressed and immutable, PostgreSQL is the consistency anchor:
- Always snapshot or replicate object storage buckets/containers first (or enable bucket versioning / cross-region replication), then take a consistent logical/physical PostgreSQL backup (
pg_dump -Fcor WAL-archived basebackup). - Pause Blob GC during cold backup windows (or ensure S3/Azure object retention / soft-delete exceeds your backup window) so unreferenced blobs referenced by a slightly older DB snapshot are never deleted prematurely. During normal operation, Blob GC coordinates with writers via PostgreSQL write-intent leases, isolates blob generations, and validates cross-pool
backend_identitybefore sweeping orphans.
Automated Verification Drill (scripts/backup-drill.sh)
Run the built-in drill script to validate pg_dump -> pg_restore into an isolated scratch database and verify schema + row count + blob SHA-256 parity without touching production data:
./scripts/backup-drill.shEnvironment overrides for production staging drills:
ARKA_DRILL_DATABASE_URL— source PostgreSQL connection stringARKA_DRILL_ADMIN_DATABASE_URL— PostgreSQL admin database (postgres) used to create/drop the scratch drill databaseARKA_DRILL_S3_ENDPOINT/ARKA_DRILL_S3_BUCKET— optional RustFS/S3 verification target
Manual Disaster Recovery Steps
- Provision a clean PostgreSQL 16 instance and restore the latest
.dumparchive:bashpg_restore --clean --if-exists --no-owner --dbname="$ARKA_DATABASE_URL" arka-backup.dump - Verify schema migrations are current (idempotent & advisory-locked):bash
arka migrate - Confirm RustFS/S3 connectivity and readiness before opening ingress traffic:bash
curl -fsS http://127.0.0.1:8080/api/v1/ready | jq . - Re-enable
ARKA_JOB_WORKER_ENABLED=truereplicas and run a dry-run Blob GC check (arkactl jobs enqueue blob_gc --dry-run) to confirm zero unexpected orphan blobs.
2. Secret Rotation SOP
All secrets are loaded via environment variables or Kubernetes existingSecret (Helm/Kustomize) and are never emitted in /api/v1 responses or structured logs.
A. ARKA_CREDENTIAL_KEY (AES-256-GCM Credential Envelope Master Key)
- Impact: Encrypts recoverable secrets stored in PostgreSQL (upstream passwords, storage pool keys, LDAP/OIDC secrets, migration credentials) using versioned
enc:v1:<key-id>:...envelopes. - Zero-downtime rotation:
- Back up PostgreSQL and generate a new 32-byte key (
openssl rand -hex 32) with a newARKA_CREDENTIAL_KEY_ID(e.g.key-2026-12). - Roll all replicas with the new key added to
ARKA_CREDENTIAL_PREVIOUS_KEYS({"key-2026-12":"<new-key>"}). - Promote the new key to
ARKA_CREDENTIAL_KEY/ARKA_CREDENTIAL_KEY_ID, move the previous key intoARKA_CREDENTIAL_PREVIOUS_KEYS, and roll all replicas. - Run
ARKA_CREDENTIAL_REENCRYPT=true arka migrateto re-encrypt legacy envelopes, verify pools/upstreams/SSO, and retire the old key once no active replica or backup needs it.
- Back up PostgreSQL and generate a new 32-byte key (
B. ARKA_AUTH_SIGNING_KEY (Session & OCI Bearer Token HMAC Key)
- Impact: Rotating
ARKA_AUTH_SIGNING_KEYinvalidates activearka1.*browser sessions and short-lived OCI bearer tokens; long-lived CIarkat_*API tokens (hashed with SHA-256 in PostgreSQL) are unaffected. - Procedure:
- Generate a new 32+ byte high-entropy key (
openssl rand -hex 32). - Update the Kubernetes Secret / environment secret store.
- Perform a rolling restart of all
arkaDeployment replicas (kubectl rollout restart deployment/arka). - Verify
/api/v1/readyreturns200 readyacross all pods. Console users re-authenticate cleanly via local/LDAP/OIDC login.
- Generate a new 32+ byte high-entropy key (
C. PostgreSQL Credentials (ARKA_DATABASE_URL)
- Create a dual-password or secondary role in PostgreSQL with identical grants on the
arkadatabase. - Update
ARKA_DATABASE_URLin the cluster Secret and roll thearkaDeployment. - Confirm
pg_stat_activityshows zero connections from the old role, then revoke/drop the old credentials.
D. RustFS / S3 Storage Pool Credentials
- Create a second access key pair on RustFS/S3 with identical bucket permissions.
- Update the pool via Console → Storage Pools → Edit or
PATCH /api/v1/storage-pools/{id}(leavingsecretKeyblank preserves existing secrets; supplying the new pair triggers immediate cross-replica hot-reload). - Click Test (
POST /api/v1/storage-pools/{id}/test) to verify livePutObject/GetObject/DeleteObjectbefore retiring the old S3 key.
E. LDAP Bind Password & OIDC Client Secret
- Generate a new service-account bind password in AD/LDAP (or rotate the OIDC client secret in your IdP).
- Update via Console → Platform → LDAP / OIDC or
POST /api/v1/auth/ldap/providers/POST /api/v1/auth/oidc/providers. - Verify immediately with Test Connection (
POST /api/v1/auth/ldap/providers/{id}/test) before revoking the previous credential.
F. OpenPGP & Cosign Signing Keys (/api/v1/security/signing-keys)
- Generate the replacement keypair (
POST /api/v1/security/signing-keys/generate) —rsa-2048/rsa-4096for APT/RPM orecdsa-p256for Cosign. - Distribute the new armored public key (
/repository/<apt-repo>/key.gpgor/api/v1/security/signing-keys/{id}/public-key) to client fleets and CI verifiers. - Once clients trust both old and new keys, remove the superseded key (
DELETE /api/v1/security/signing-keys/{id}). For APT/RPM hosted repos, Arka immediately signs newInRelease/Release.gpg/repomd.xml.ascresponses with the new active key.
3. Zero-Downtime Sonatype Nexus 3 Cutover & Rollback Playbook
Arka's drop-in /repository/<name>/ and /v2/<name>/ URL compatibility allows migrating fleets with zero client URL rewrites and instant rollback.
Phase 1 — Parallel Provisioning & Pull-Through Shadow Mode
- Register your production Nexus 3 server as a Migration Source (
Console → Nexus Migrationor/api/v1/migrations/sources). - Run Discover and Provision Pull-Through Proxies (
mode: "pull_through_proxy"): Arka creates proxy repositories pointing at Nexus 3 withpullThroughPersist: trueso every read is durably cached in Arka. - Mirror or bulk-import existing hosted repositories using resumable SHA-256 verified jobs (
POST /api/v1/migrations/jobs).
Phase 2 — Checksum Parity & Shadow-Read Gate (arkactl migration verify)
Before cutting over DNS or Ingress traffic, run a parity audit + live shadow-read verification against each repository:
arkactl migration verify \
--source "$SOURCE_ID" \
--source-repo maven-releases \
--target-repo "$TARGET_REPO_ID" \
--shadow-read 25 \
--jsonreadyForCutover: trueguarantees:missingCount == 0(every remote Nexus asset exists in Arka under its normalized path)checksumMismatchCount == 0(SHA-256 / SHA-1 / MD5 parity matches 100%)shadowReadFailed == 0(live byte streams from Nexus and Arka match bit-for-bit)
arkactl migration verifyexits with code0when ready and non-zero otherwise, making it directly usable as a CI/CD cutover gate. Combine witharkactl migration cutover-check "$JOB_ID" --source-wide --jsonfor source-wide governance readiness.
Phase 3 — Traffic Cutover & Promotion
- Flip your Ingress / DNS / Load Balancer read traffic for
/repository/*and/v2/*to Arka while keeping Nexus 3 online in read-only mode. - Monitor
/metricsand Console Platform → Observability: verify HTTP5xxrate is0%, RustFS 302 presign offloading is active, and proxy cache hit rates stabilize. - Freeze writes to Nexus 3, run one final incremental migration sync +
arkactl migration verify, then Promote any pull-through proxy repositories toHosted(POST /api/v1/repositories/{id}/promote) and enable CI writes to Arka.
Phase 4 — Instant Rollback Procedure
If an unexpected client issue occurs during Phase 3:
- Before write cutover (read-only phase): Immediately revert Ingress/DNS back to Nexus 3 (zero data divergence; < 30s rollback).
- After write cutover:
- Switch Ingress back to Nexus 3 for reads.
- Export any newly published artifacts from Arka since the cutover timestamp using
listRepositoryAssets+ audit events (asset.published), push them to Nexus 3, and resume writes on Nexus 3. - Keep Arka in
pull_through_proxymode until the issue is diagnosed and re-verified.
4. Runtime Probes, Metrics Security, Outbox & Ephemeral Disk
- Separated Health Probes & Bounded Shutdown: Configure Kubernetes liveness probes against
GET /api/v1/health/live(orGET /api/v1/health) and readiness probes againstGET /api/v1/ready(checks live PostgreSQL + default BlobStore connectivity). OnSIGTERM, Arka drains HTTP traffic, flushes the transactional webhook outbox and background workers within a bounded phased shutdown budget, and closes PostgreSQL last. - Metrics Endpoint Fail-Closed: Set
ARKA_METRICS_REQUIRE_AUTH=truealongside a non-emptyARKA_METRICS_AUTH_TOKENwhen exposing/metrics(including on a dedicatedARKA_METRICS_LISTEN_ADDRport); startup fails closed if auth is required without a token. - Transactional Webhook Outbox: Publication transactions persist webhook delivery events atomically inside PostgreSQL with stable event IDs and distinct per-delivery attempt IDs, preventing silent drops on pod restarts.
- Ephemeral
/tmpBudget: Arka stages large package archives and Helm/OCI uploads to temporary disk outside database write locks. Keep at least 2 GiB of writable ephemeral storage mounted at/tmpin Docker Compose, Kustomize, and Helm deployments.
OCI / Docker registry hosts and anonymous pulls
With the default configuration, a Docker image reference includes the Arka repository name, for example arka.example.com/containers/team/app:1.0. Its registry API path is /v2/containers/team/app/.... Nexus-compatible endpoints remain available at /repository/containers/v2/team/app/....
Set ARKA_OCI_HOST_ROUTES on each Arka replica to give one or more registry hosts their own namespace. The value is a JSON array. For example:
export ARKA_OCI_HOST_ROUTES='[
{"host":"registry.example.com","readRepository":"containers-group","writeRepository":"containers-hosted"},
{"host":"releases.example.com","readRepository":"releases-hosted"}
]'- Clients use references such as
registry.example.com/team/app:1.0anddocker login registry.example.com. Host matching is case-insensitive and ignores the port. The port received on the public request is retained in challenge and upload URLs. - The read target can be a Hosted, Proxy, or Group OCI repository. The write target must be Hosted for pushes and deletes. If
writeRepositoryis omitted, both targets usereadRepository. A Group or Proxy without a separate Hosted target is read-only. Include the write target in the read Group if images published through the host should also be readable there. - GET and HEAD upload status requests go to the write target so clients can follow the same session through POST, PATCH, status, and final PUT. Ordinary manifest and blob reads use the read target. Each target applies its own RBAC, selectors, and repository policies.
- Hosts outside the mapping use the legacy repository-prefixed route and scopes. Use an unmapped host when a client needs the legacy token scope. Changes to the environment variable take effect when Arka restarts.
For TLS termination, configure ARKA_TRUSTED_PROXIES with the addresses or CIDRs of the immediate reverse proxies. Have the proxy overwrite X-Forwarded-Proto and X-Forwarded-Host with single values for the public scheme and authority, including any non-default port. Forward /v2/ and /v2/token without a path rewrite and preserve authorization headers. Arka uses the external origin in Bearer challenges and upload URLs. On mapped hosts without forwarding, it uses the request Host and TLS state. On unmapped hosts without a trusted proxy, it uses ARKA_BASE_URL.
A repository with anonymousRead enabled supports docker pull without login. The public token endpoint issues a five-minute Bearer token for one image's pull scope. The scope is repository:team/app:pull on a mapped host and repository:containers/team/app:pull on a legacy host. Scope-free token requests require credentials. Anonymous users can pull through a public Group only from members whose permissions also allow anonymous reads. For authenticated client operations, use an Arka username with its password or API token.