Communitygithub.com

lguidolin/cloud-delivery-aks

Use when deploying to Kubernetes or Azure Kubernetes Service (AKS), configuring cloud secrets, setting up progressive rollout/canary, per-PR ephemeral environments, or k8s health probes. Keywords — Kubernetes, AKS, Key Vault, Argo Rollouts, Flagger, canary, blue-green, liveness, readiness, PodDisruptionBudget, HPA, rollback, GHCR.

cloud-delivery-aks란 무엇인가요?

cloud-delivery-aks is a Claude Code agent skill that use when deploying to Kubernetes or Azure Kubernetes Service (AKS), configuring cloud secrets, setting up progressive rollout/canary, per-PR ephemeral environments, or k8s health probes. Keywords — Kubernetes, AKS, Key Vault, Argo Rollouts, Flagger, canary, blue-green, liveness, readiness, PodDisruptionBudget, HPA, rollback, GHCR.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/lguidolin/agent-skills/tree/main/skills/cloud-delivery-aks

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Cloud Delivery on AKS

Overview

The delivery mechanism for Kubernetes/Azure. Implements deploy safety and the verification gate on AKS. Stack-specific by design — this skill only loads when a task involves k8s/AKS, so projects without cloud deployment (e.g. local-only Docker Compose) never see this content.

Delivery Rules

  • Local dev runs the full stack via Docker Compose, one command, comprehensive — a first-class requirement.
  • Images build in CI → GHCR, identified by content digest, then promoted unchanged preview → staging → production. Never rebuilt per environment.
  • Per-PR ephemeral preview environments. Each PR deploys to its own isolated namespace on AKS for review, torn down on merge/close. The integration-test bed; cheap to create and destroy.
  • Kubernetes health gating. Every workload defines liveness, readiness, and startup probes (wired to the endpoints in observability-and-slos), a rolling update strategy with bounded maxUnavailable/maxSurge, and a PodDisruptionBudget. Use an HPA for load.
  • Progressive delivery to prod. Canary or blue-green via Argo Rollouts / Flagger with automated metric analysis tied to SLOs; a failed canary aborts automatically.
  • Rollback is first-class and rehearsed. Immutable, digest-addressed images make rollback a redeploy of the previously-good digest (kubectl rollout undo / abort the rollout). Verified before risky changes ship.
  • Migrations are a separate, ordered pipeline step, expand-safe (see zero-downtime-migrations), run before the code that depends on them — never bundled into the pod that needs the new schema.
  • CI is the gate: lint, typecheck, contract checks, tests, security scans run on every change, and block merge in enforced mode. CI also builds the image and publishes its provenance attestation, then promotes that digest unchanged.
  • Dev/prod parity & config from the environment. Secrets from Azure Key Vault (via Secrets Store CSI driver or sealed secrets) — never in images or committed .env. Ports/config from env. Dev-only tooling (pgTAP, test runners) never ships in prod images.

The Pipeline

TierTriggerEnvironmentDigest
previewPR opened / synchronizeephemeral ns preview-<app>-pr-<N>built here, tagged sha-<pr-head>
stagingmerge to mainpersistent ns stagingretag of the preview digest as sha-<merge>
productionrelease published + approvalns productiondigest of the release commit's parent

Why the parent commit. release-please's release commit changes only CHANGELOG.md and the manifest, so its tree is never one that staging soaked — whatever preview built for the release PR itself was never promoted past preview. Its parent is the last feature merge, which is exactly what staging has been validating, so long as release-please keeps its release branch on main's tip (its default behaviour). Deriving the digest from git rather than from live cluster state keeps promotion reproducible.

Retag safety. Squash-merge produces a different commit SHA and, if main moved while the PR was open, a different tree. Two guards:

  • Require "branches up to date before merging" — a sub-setting of the required-status-checks rule — so the squash tree equals the PR head tree by construction. This guard needs branch protection, so it exists only in enforced mode; a project in advisory mode has the tree comparison below as its sole guard, and should expect the rebuild path to be routine rather than exceptional.
  • Verify rather than assume: compare git rev-parse <merge>^{tree} against the PR head tree. Equal → retag. Unequal → rebuild at the merge SHA. That is not the per-environment rebuild the Delivery Rules forbid: an unequal tree means the content itself differs from what preview validated, so there is no promotable artifact to reuse — and the rebuilt image enters staging as a fresh candidate rather than a promotion. Note what is given up when this path is taken: that image was never reviewed in a preview environment, so "the shipped image is the reviewed image" does not hold for it. Staging is then its first validation, not its second.

The retag is a pointer operation — no rebuild, no pull:

docker buildx imagetools create -t "$REPO:sha-$MERGE_SHA" "$REPO@sha256:$DIGEST"

Attestation stays bound to the PR head SHA, so record the head→merge mapping in the deployment record; image config cannot be edited without rebuilding.

The approval gate — one property, two mechanisms:

ModeMechanism
enforcedGitHub Environment production with required reviewers
advisoryA workflow_dispatch promote job; running it is the decision

Quick Reference

ConcernMechanism
SecretsKey Vault → CSI driver; rotated; never in image
Healthliveness + readiness + startup probes; readiness checks real deps
Safe rolloutcanary/blue-green, SLO-gated, auto-abort on failure
Rollbackredeploy the previously-good digest; rehearsed before risky ships
Per-PR envisolated namespace, torn down on merge
Schemaseparate ordered step, expand-safe, before code
PromotionRetag the digest; never rebuild per environment
ApprovalEnvironment reviewers (enforced) or manual dispatch (advisory)

Why this is quarantined: all Azure/k8s specifics live here behind a stack-specific trigger. A local-only or different-cloud project substitutes its own delivery skill; the principles (immutable artifact, reversible + progressive deploy, decoupled migrations) come from resilience-and-deploy-safety.

Full rationale: Article XIX of the constitution, bundled at engineering-constitution/references/engineering-constitution.md.

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

lguidolin/change-hygiene-and-code-craft

Use when writing or refactoring code, structuring a commit or PR, or deciding whether to abstract duplication. Symptoms — mixing reorg with logic changes, a PR doing several things at once, a file growing large, the second copy of similar code, or unsure whether to DRY something up.

lguidolin/commit-history-rewrite

Use when an existing repository has messy commit history that needs to conform to conventional commits before adopting release-please, or when intermediate WIP/fixup/merge commits need to be cleaned up.

lguidolin/conventional-commits-and-releases

Use when committing, writing a commit message, opening a PR that will be squash-merged, or configuring automated versioning/changelogs. Keywords — conventional commits, release-please, semver, feat/fix/chore, breaking change, changelog.

lguidolin/defense-in-depth-security

Use when handling untrusted input, secrets, authentication/authorization, or dependencies — or threat-modeling a new surface. Keywords — STRIDE, threat model, least privilege, secrets management, supply chain, dependency scanning, input validation, audit log, defense in depth.

lguidolin/designing-before-building

Use when starting a feature, fixing a non-trivial bug, or about to write implementation code — before any code exists. Symptoms you need this: "this is simple, I'll just code it", reaching for the editor before a design is approved, or an idea that hasn't been turned into a spec and plan.

lguidolin/engineering-constitution

Use when starting work in a project that follows the engineering constitution, orienting to its rules, or deciding which engineering practice applies to a task — spec writing, commits, testing, security, deploys, database, or UI work.

lguidolin/graphql-contract-testing

Use when writing a GraphQL query/mutation that the UI and a test will share, or building route/schema contract or smoke tests. Symptoms — copying a query into a test, a test asserting on query text, schema change that didn't break the UI build, or RLS/permission drift. Keywords — graphql-codegen, typed document, contract test, route smoke test.

lguidolin/init-repo-CI

Use when setting up a new repository with conventional commits, release-please, and CI automation, or when retrofitting an existing repository that lacks automated versioning and PR validation workflows.

lguidolin/interface-craft-and-accessibility

Use when building or styling UI — components, layouts, forms, design tokens — or making accessibility decisions. Keywords — a11y, WCAG, keyboard navigation, focus state, contrast, design system, minimalist UI, component reuse, ARIA, semantic HTML.

lguidolin/merge-gates-and-automation

Use when setting up or changing CI, pre-push hooks, or a task runner, or deciding what must pass before merge. Symptoms — tempted to put authoritative checks only in a local hook, skip CI, bypass with --no-verify, or unsure what gates a merge vs. runs locally.

lguidolin/observability-and-slos

Use when adding logging, metrics, tracing, health checks, SLOs, or alerting — or when building a service surface that needs to be operable and debuggable. Keywords — structured logs, OpenTelemetry, correlation id, RED metrics, liveness, readiness, SLI, SLO, error budget, alerting.

lguidolin/performance-and-scale

Use when working on hot paths, list endpoints, pagination, data-access in loops, or public interfaces/schemas. Symptoms — unbounded queries, N+1 access, no latency budget, optimizing without measuring, or changing an interface many consumers depend on. Keywords — pagination, N+1, Hyrum's Law, performance budget, bundle size.

lguidolin/postgres-postgraphile-rls-and-sql

Use when writing PostgreSQL, PostGraphile config, Row-Level Security policies, SQL schema files, or working on the Browser→App→PostGraphile→Postgres data path. Keywords — RLS, SECURITY DEFINER, search_path, pgSettings, grants, roles, GraphQL depth limit, query cost, statement_timeout, SQL file organization.

lguidolin/recording-decisions

Use when a design or architecture decision has been made and needs to be captured — writing a decision record or ADR, updating a decision index, noting a deferred idea, or superseding a past decision. Keywords — ADR, decision record, rationale, rejected alternatives, dependency index.

lguidolin/resilience-and-deploy-safety

Use when planning a deploy, designing a rollback, or responding to an incident or writing a postmortem. Keywords — deploy safety, rollback, immutable artifact, progressive delivery, canary, blast radius, incident response, blameless postmortem, error budget.

lguidolin/ship-it

Use when the user wants to ship work — push, PR, archive decision records, merge, and clean up. Handles the full lifecycle from committing final changes through post-merge cleanup including converting specs/plans to compact decision records.

lguidolin/tests-as-a-control

Use when writing or modifying tests, when a test breaks during a refactor, or when testing permission/role rules. Symptoms — tempted to edit a test to make it pass, testing only the happy path, a deny-test that started passing, flaky tests, or unsure what to assert.

lguidolin/zero-downtime-migrations

Use when changing a database schema where data must survive the change — adding/removing/renaming columns, constraints, indexes, or backfilling. Symptoms — a destructive migration bundled with a code deploy, a NOT NULL column with a backfill, a table-locking UPDATE, or a rename. Keywords — expand/contract, parallel change, backfill, NOT VALID, CREATE INDEX CONCURRENTLY, graphile-migrate.

관련 스킬