Skip to content

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:

  1. 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 -Fc or WAL-archived basebackup).
  2. 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_identity before 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:

bash
./scripts/backup-drill.sh

Environment overrides for production staging drills:

  • ARKA_DRILL_DATABASE_URL — source PostgreSQL connection string
  • ARKA_DRILL_ADMIN_DATABASE_URL — PostgreSQL admin database (postgres) used to create/drop the scratch drill database
  • ARKA_DRILL_S3_ENDPOINT / ARKA_DRILL_S3_BUCKET — optional RustFS/S3 verification target

Manual Disaster Recovery Steps ​

  1. Provision a clean PostgreSQL 16 instance and restore the latest .dump archive:
    bash
    pg_restore --clean --if-exists --no-owner --dbname="$ARKA_DATABASE_URL" arka-backup.dump
  2. Verify schema migrations are current (idempotent & advisory-locked):
    bash
    arka migrate
  3. Confirm RustFS/S3 connectivity and readiness before opening ingress traffic:
    bash
    curl -fsS http://127.0.0.1:8080/api/v1/ready | jq .
  4. Re-enable ARKA_JOB_WORKER_ENABLED=true replicas 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:
    1. Back up PostgreSQL and generate a new 32-byte key (openssl rand -hex 32) with a new ARKA_CREDENTIAL_KEY_ID (e.g. key-2026-12).
    2. Roll all replicas with the new key added to ARKA_CREDENTIAL_PREVIOUS_KEYS ({"key-2026-12":"<new-key>"}).
    3. Promote the new key to ARKA_CREDENTIAL_KEY / ARKA_CREDENTIAL_KEY_ID, move the previous key into ARKA_CREDENTIAL_PREVIOUS_KEYS, and roll all replicas.
    4. Run ARKA_CREDENTIAL_REENCRYPT=true arka migrate to re-encrypt legacy envelopes, verify pools/upstreams/SSO, and retire the old key once no active replica or backup needs it.

B. ARKA_AUTH_SIGNING_KEY (Session & OCI Bearer Token HMAC Key) ​

  • Impact: Rotating ARKA_AUTH_SIGNING_KEY invalidates active arka1.* browser sessions and short-lived OCI bearer tokens; long-lived CI arkat_* API tokens (hashed with SHA-256 in PostgreSQL) are unaffected.
  • Procedure:
    1. Generate a new 32+ byte high-entropy key (openssl rand -hex 32).
    2. Update the Kubernetes Secret / environment secret store.
    3. Perform a rolling restart of all arka Deployment replicas (kubectl rollout restart deployment/arka).
    4. Verify /api/v1/ready returns 200 ready across all pods. Console users re-authenticate cleanly via local/LDAP/OIDC login.

C. PostgreSQL Credentials (ARKA_DATABASE_URL) ​

  1. Create a dual-password or secondary role in PostgreSQL with identical grants on the arka database.
  2. Update ARKA_DATABASE_URL in the cluster Secret and roll the arka Deployment.
  3. Confirm pg_stat_activity shows zero connections from the old role, then revoke/drop the old credentials.

D. RustFS / S3 Storage Pool Credentials ​

  1. Create a second access key pair on RustFS/S3 with identical bucket permissions.
  2. Update the pool via Console → Storage Pools → Edit or PATCH /api/v1/storage-pools/{id} (leaving secretKey blank preserves existing secrets; supplying the new pair triggers immediate cross-replica hot-reload).
  3. Click Test (POST /api/v1/storage-pools/{id}/test) to verify live PutObject/GetObject/DeleteObject before retiring the old S3 key.

E. LDAP Bind Password & OIDC Client Secret ​

  1. Generate a new service-account bind password in AD/LDAP (or rotate the OIDC client secret in your IdP).
  2. Update via Console → Platform → LDAP / OIDC or POST /api/v1/auth/ldap/providers / POST /api/v1/auth/oidc/providers.
  3. 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) ​

  1. Generate the replacement keypair (POST /api/v1/security/signing-keys/generate) — rsa-2048/rsa-4096 for APT/RPM or ecdsa-p256 for Cosign.
  2. Distribute the new armored public key (/repository/<apt-repo>/key.gpg or /api/v1/security/signing-keys/{id}/public-key) to client fleets and CI verifiers.
  3. 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 new InRelease/Release.gpg/repomd.xml.asc responses 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 ​

  1. Register your production Nexus 3 server as a Migration Source (Console → Nexus Migration or /api/v1/migrations/sources).
  2. Run Discover and Provision Pull-Through Proxies (mode: "pull_through_proxy"): Arka creates proxy repositories pointing at Nexus 3 with pullThroughPersist: true so every read is durably cached in Arka.
  3. 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:

bash
arkactl migration verify \
  --source "$SOURCE_ID" \
  --source-repo maven-releases \
  --target-repo "$TARGET_REPO_ID" \
  --shadow-read 25 \
  --json
  • readyForCutover: true guarantees:
    • 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 verify exits with code 0 when ready and non-zero otherwise, making it directly usable as a CI/CD cutover gate. Combine with arkactl migration cutover-check "$JOB_ID" --source-wide --json for source-wide governance readiness.

Phase 3 — Traffic Cutover & Promotion ​

  1. Flip your Ingress / DNS / Load Balancer read traffic for /repository/* and /v2/* to Arka while keeping Nexus 3 online in read-only mode.
  2. Monitor /metrics and Console Platform → Observability: verify HTTP 5xx rate is 0%, RustFS 302 presign offloading is active, and proxy cache hit rates stabilize.
  3. Freeze writes to Nexus 3, run one final incremental migration sync + arkactl migration verify, then Promote any pull-through proxy repositories to Hosted (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:

  1. Before write cutover (read-only phase): Immediately revert Ingress/DNS back to Nexus 3 (zero data divergence; < 30s rollback).
  2. 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_proxy mode 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 (or GET /api/v1/health) and readiness probes against GET /api/v1/ready (checks live PostgreSQL + default BlobStore connectivity). On SIGTERM, 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=true alongside a non-empty ARKA_METRICS_AUTH_TOKEN when exposing /metrics (including on a dedicated ARKA_METRICS_LISTEN_ADDR port); 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 /tmp Budget: 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 /tmp in 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:

sh
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.0 and docker 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 writeRepository is omitted, both targets use readRepository. 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.

Released under the Apache 2.0 License.