cosmix/loom/loom-fluxcd

Claude Code and agent skill by cosmix/loom

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

GitOps continuous delivery toolkit for Kubernetes with Flux CD.

Install

npx vskill@latest install cosmix/loom/loom-fluxcd

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as cosmix/loom/loom-fluxcd.

Flux CD GitOps Toolkit

Overview

Declarative GitOps CD: a set of specialized controllers continuously reconcile cluster state toward Git. Flux is CRD-centric with no first-party UI — you drive it with the flux CLI and YAML. The controllers, and the CRDs each owns:

ControllerCRDsRole
source-controllerGitRepository, OCIRepository, HelmRepository, HelmChart, BucketFetch + verify + cache artifacts
kustomize-controllerKustomizationBuild/apply overlays, prune, health-check, dependsOn ordering
helm-controllerHelmReleaseInstall/upgrade/rollback charts, drift detection
notification-controllerProvider, Alert, ReceiverOutbound alerts + inbound webhooks
image-reflector / image-automationImageRepository, ImagePolicy, ImageUpdateAutomationScan registries, select tags, commit back to Git

The controller separation matters: a Kustomization failure is a kustomize-controller concern; a chart failure is helm-controller. Debug the right one.

When Argo CD vs Flux

Both are CNCF-graduated GitOps controllers; the choice is architectural, not feature-parity.

ConcernFlux CDArgo CD
OrderingdependsOn between Kustomizations/HelmReleases + healthChecks gate the nextargocd.argoproj.io/sync-wave annotations within one Application
CompositionKustomization tree: a Kustomization applies more KustomizationsApp-of-apps: one root Application recursing into children
Drift correctionContinuous reconciliation always re-applies desired state; prune: true GCs by .status.inventory; HelmRelease drift detection is opt-inOpt-in selfHeal reverts drift; prune deletes Git-removed resources
Fan-outNo native generator; per-tenant Kustomizations + image automationApplicationSet generators (cluster/git/matrix/PR/SCM)
Image updatesFirst-class ImageRepository/ImagePolicy/ImageUpdateAutomation, commits back to GitNot built-in (separate Argo CD Image Updater)
InterfaceCLI/CRD-centric (flux CLI, no first-party UI)Web UI-centric (topology, manual sync buttons)
Multi-clusterTypically one Flux per cluster pulling its own pathOne control plane syncs many clusters

Rule of thumb: Flux for a lean controller set, Git-native image automation, and dependency ordering expressed as CRDs; Argo CD when operators want a visual sync/health console and generator-driven multi-cluster fan-out. They coexist.

Install & Bootstrap

bash
curl -s https://fluxcd.io/install.sh | sudo bash # or: brew install fluxcd/tap/flux
flux --version && flux check --pre # cluster preflight
export GITHUB_TOKEN=<token>
flux bootstrap github \
--owner=<user> --repository=<repo> --branch=main \
--path=clusters/production --personal \
--components-extra=image-reflector-controller,image-automation-controller \
--read-write-key # REQUIRED if image automation must push commits (see gotcha)
# GitLab: flux bootstrap gitlab --owner=<group> ... (same flags)

Bootstrap (not flux install) writes the components into Git so they are version-controlled and self-managed — required to patch controller args via Kustomize (concurrency, lockdown flags). Validate manifests pre-commit with kubectl apply --dry-run=server -f clusters/production/.

Repository Structure

text
├── clusters/{production,staging}/
│ ├── flux-system/ # bootstrapped components (managed by Flux itself)
│ ├── infrastructure.yaml # sources + Kustomizations for infra
│ └── apps.yaml # sources + Kustomizations for apps
├── infrastructure/{base,overlays/{production,staging}}/ # ingress, cert-manager, ...
└── apps/{base,overlays/{production,staging}}/

Multi-tenant repos add tenants/{base,overlays}/<team>/ (namespace + RBAC + GitRepository/Kustomization) referenced from clusters/<env>/tenants/.

GitRepository & Kustomization

yaml
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata: { name: flux-system, namespace: flux-system }
spec:
interval: 1m0s
ref: { branch: main }
url: https://github.com/org/repo
secretRef: { name: flux-system }
ignore: | # optional: shrink the artifact
/*
!/apps/production/
yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: { name: apps, namespace: flux-system }
spec:
interval: 10m0s
retryInterval: 2m0s # ⚠ defaults to interval — set independently (see gotcha)
dependsOn: [{ name: infrastructure }]
sourceRef: { kind: GitRepository, name: flux-system }
path: ./apps/production
prune: true
wait: true # ⚠ health-checks ALL resources; silently ignores .healthChecks
timeout: 5m0s
postBuild:
substitute: { cluster_name: production }
substituteFrom:
- { kind: ConfigMap, name: cluster-vars }

postBuild.substitute/substituteFrom replace ${var} tokens in the built manifests (variable names must match ^[_[:alpha:]][_[:alpha:][:digit:]]*$ — hyphens/dots silently skip). The referenced ConfigMap/Secret:

yaml
kind: ConfigMap
metadata:
name: cluster-vars
namespace: flux-system
labels: { reconcile.fluxcd.io/watch: Enabled } # ⚠ else edits ignored until next tick (see gotcha)
data: { cluster_name: production, domain: example.com }

Dependency & Ordering

Flux orders reconciliation with dependsOn (a Kustomization/HelmRelease waits for the named object to become Ready) combined with healthChecks/wait. This is Flux's answer to Argo sync-waves and app-of-apps, expressed as a CRD graph.

yaml
# crds (prune:false) -> cert-manager (healthCheck) -> ingress-nginx (dependsOn cert-manager)
kind: Kustomization
metadata: { name: cert-manager, namespace: flux-system }
spec:
dependsOn: [{ name: crds }]
path: ./infrastructure/cert-manager
healthChecks:
- { apiVersion: apps/v1, kind: Deployment, name: cert-manager, namespace: cert-manager }
# ...sourceRef, interval

CRD Kustomizations should set prune: false so a transient source error never GCs your CRDs (and every CR with them). Cross-namespace dependsOn names the namespace: dependsOn: [{ name: shared-ingress, namespace: flux-system }].

Helm Integration

HelmRepository (or OCIRepository) provides charts; HelmRelease installs them. helm-controller runs real Helm (unlike Argo's helm template), so helm history/rollback work.

yaml
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata: { name: my-app, namespace: apps }
spec:
interval: 10m0s
chart:
spec:
chart: my-app
version: "1.0.x"
sourceRef: { kind: HelmRepository, name: my-charts, namespace: flux-system }
dependsOn:
- { name: cert-manager, namespace: cert-manager }
install: { remediation: { retries: 3 } }
upgrade:
remediation: { retries: 3, remediateLastFailure: true } # ⚠ default flips to true when retries>0
cleanupOnFail: true
test: { enable: true }
rollback: { cleanupOnFail: true, recreate: true }
values: { replicas: 2 }
valuesFrom: # ⚠ a valuesFrom entry with targetPath outranks inline values
- { kind: ConfigMap, name: app-config, valuesKey: values.yaml }
- { kind: Secret, name: app-secrets, valuesKey: secrets.yaml }

Prefer chartRef + OCIRepository over chart.spec for shared/pinned/signed charts (see Expert Practices). Private HelmRepository uses secretRef to a Secret with stringData.{username,password}.

Secret Management (SOPS)

Flux decrypts SOPS-encrypted manifests inline during Kustomization apply.

bash
age-keygen -o age.agekey && age-keygen -y age.agekey # private + public key
cat age.agekey | kubectl create secret generic sops-age \
--namespace=flux-system --from-file=age.agekey=/dev/stdin
sops --encrypt --in-place secret.yaml # per .sops.yaml rules
yaml
# .sops.yaml — encrypt only the data fields, per path
creation_rules:
- path_regex: .*/production/.*\.yaml
encrypted_regex: ^(data|stringData)$
age: age1ql3z... # comma-separate multiple recipients for team access
---
# Kustomization decrypts:
spec:
decryption:
provider: sops
secretRef: { name: sops-age }

Alternatives: External Secrets Operator (pull from AWS SM/Vault/GCP via SecretStore+ExternalSecret) — preferred for cloud secret managers; Sealed Secrets — Kubernetes-native one-way encryption.

Image Automation

Three resources form the loop: ImageRepository (scans a registry) → ImagePolicy (selects a tag) → ImageUpdateAutomation (commits the new tag to Git). Manifests carry a marker comment the automation rewrites.

yaml
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImageRepository
metadata: { name: my-app, namespace: flux-system }
spec:
image: ghcr.io/org/my-app
interval: 5m0s
provider: aws # ⚠ prefer workload identity over secretRef (see Security)
---
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImagePolicy
metadata: { name: my-app, namespace: flux-system }
spec:
imageRepositoryRef: { name: my-app }
policy: { semver: { range: 1.0.x } } # or alphabetical/numerical (below)
filterTags: # ⚠ non-matching tags are dropped, no fallback
pattern: "^main-[a-f0-9]+-(?P<ts>[0-9]{10})$"
extract: "$ts"
---
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImageUpdateAutomation
metadata: { name: my-app, namespace: flux-system }
spec:
interval: 1m0s
sourceRef: { kind: GitRepository, name: flux-system }
git:
checkout: { ref: { branch: main } }
push: { branch: image-updates } # omit for direct commit; set for PR-based flow
commit:
author: { email: fluxcdbot@users.noreply.github.com, name: fluxcdbot }
messageTemplate: "Automated image update [ci skip]"
update: { path: ./apps/production, strategy: Setters }
yaml
# Deployment marker the automation rewrites:
image: ghcr.io/org/my-app:1.0.0 # {"$imagepolicy": "flux-system:my-app"}

Policy types: semver (releases, 1.0.x/>=1.0.0), alphabetical (branch tags via filterTags), numerical (build numbers). Strategy: enable automation in dev/staging with direct commit; use `push.branch` (PR review) for production.

Multi-Tenancy

RBAC alone does NOT make Flux multi-tenant. A default install lets a tenant reference Sources/Secrets in other namespaces, pull arbitrary remote Kustomize bases, and (if it omits serviceAccountName) reconcile with the controller's cluster-wide identity. Three controller flags, applied as bootstrap Kustomize patches in clusters/<env>/flux-system/, close these vectors and are mandatory:

  • --no-cross-namespace-refs=true (kustomize/helm/notification/image-* controllers) — blocks cross-namespace refs to Sources, Secrets, events.
  • --no-remote-bases=true (kustomize-controller) — blocks fetching remote Kustomize bases over HTTPS (which bypass source verification/caching).
  • --default-service-account=default (kustomize/helm) — resources without spec.serviceAccountName fall back to the powerless namespace default SA instead of the controller identity.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
56
Repository forks
3
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cosmix/loom/loom-fluxcd/badge)](https://verified-skill.com/skills/cosmix/loom/loom-fluxcd)

Something wrong with this skill or its page? Tell us.