cloud-platform-skills / skills
Cursor rule1 starsChanged 3 months agoMITView on GitHub
Multi-cluster GitOps with ArgoCD ApplicationSets, app-of-apps topology, and Flux v2: fleet reconciliation, sync waves, prune and self-heal semantics, drift detection. Use when managing many clusters or environments declaratively, deciding how to structure repositories, branches and overlays to promote a release from staging to production, or debugging an Application stuck OutOfSync.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,527 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository167 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/rules/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-index.mdcCursor rule
- .cursor/rules/skills/ai-agent-security-llm-threats.mdcCursor rule
- .cursor/rules/skills/api-gateway-service-mesh.mdcCursor rule
- .cursor/rules/skills/aws-cloud-migration-strategies.mdcCursor rule
- .cursor/rules/skills/aws-eks-enterprise-patterns.mdcCursor rule
- .cursor/rules/skills/aws-iam-zero-trust-policies.mdcCursor rule
- .cursor/rules/skills/azure-aks-enterprise-landing-zones.mdcCursor rule
- .cursor/rules/skills/azure-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/backup-and-disaster-recovery.mdcCursor rule
- .cursor/rules/skills/chaos-engineering-resilience-testing.mdcCursor rule
- .cursor/rules/skills/cicd-pipeline-design.mdcCursor rule
- .cursor/rules/skills/cloud-native-microservices-patterns.mdcCursor rule
- .cursor/rules/skills/cloud-security-posture-cspm-cis.mdcCursor rule
- .cursor/rules/skills/configuration-management-ansible.mdcCursor rule
- .cursor/rules/skills/container-runtime-security-falco.mdcCursor rule
- .cursor/rules/skills/database-devops-lifecycle.mdcCursor rule
- .cursor/rules/skills/detection-engineering-threat-hunting.mdcCursor rule
- .cursor/rules/skills/devops-metrics-dora-kpis.mdcCursor rule
- .cursor/rules/skills/docker-containerization-basics.mdcCursor rule
- .cursor/rules/skills/enterprise-iac-governance-terragrunt.mdcCursor rule
- .cursor/rules/skills/finops-framework-inform-optimize-operate.mdcCursor rule
- .cursor/rules/skills/gcp-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/gcp-gke-autopilot-multi-tenant.mdcCursor rule
- .cursor/rules/skills/git-branching-merge-strategies.mdcCursor rule
- .cursor/rules/skills/helm-kubernetes-deployment.mdcCursor rule
- .cursor/rules/skills/incident-management-and-postmortem.mdcCursor rule
- .cursor/rules/skills/infrastructure-host-monitoring.mdcCursor rule
- .cursor/rules/skills/internal-developer-portal-backstage.mdcCursor rule
- .cursor/rules/skills/linux-sysadmin-troubleshooting.mdcCursor rule
- .cursor/rules/skills/performance-load-testing.mdcCursor rule
- .cursor/rules/skills/policy-as-code-opa-kyverno.mdcCursor rule
- .cursor/rules/skills/prometheus-grafana-otel-tracing.mdcCursor rule
- .cursor/rules/skills/scalability-high-availability-patterns.mdcCursor rule
- .cursor/rules/skills/scripting-and-automation.mdcCursor rule
- .cursor/rules/skills/secops-incident-triage-forensics.mdcCursor rule
- .cursor/rules/skills/secrets-management-vault-kms.mdcCursor rule
- .cursor/rules/skills/serverless-event-driven-architecture.mdcCursor rule
- .cursor/rules/skills/shift-left-security-sast-sca.mdcCursor rule
- .cursor/rules/skills/sli-slo-error-budget-design.mdcCursor rule
- .cursor/rules/skills/supply-chain-security-slsa-sigstore.mdcCursor rule
- .cursor/rules/skills/terraform-iac-modules.mdcCursor rule
- .cursor/rules/skills/write-a-skill.mdcCursor rule
- .cursor/rules/skills/zero-downtime-release-strategies.mdcCursor rule
- ai-agent-security-llm-threatsSkill
- api-gateway-service-meshSkill
- aws-cloud-migration-strategiesSkill
- aws-eks-enterprise-patternsSkill
- aws-iam-zero-trust-policiesSkill
- azure-aks-enterprise-landing-zonesSkill
- azure-cloud-engineering-patternsSkill
- backup-and-disaster-recoverySkill
- chaos-engineering-resilience-testingSkill
- cicd-pipeline-designSkill
- cloud-native-microservices-patternsSkill
- cloud-security-posture-cspm-cisSkill
- configuration-management-ansibleSkill
- The first 60 shown.
The file
We split this gitops-multi-cluster-argo-flux.mdc into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 65
Immutable Tags/SHAs: Never point GitOps targets at mutable tags like :latest.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "Multi-cluster GitOps with ArgoCD ApplicationSets, app-of-apps topology, and Flux v2: fleet reconciliation, sync waves, prune and self-heal semantics, drift detection. Use when managing many clusters or environments declaratively, deciding how to structure repositories, branches and overlays to promote a release from staging to production, or debugging an Application stuck OutOfSync."
globs:
alwaysApply: false
---
# Multi-Cluster Enterprise GitOps with ArgoCD ApplicationSets
## When to Use This Skill
**Triggers — load this skill when:**
- Many clusters or environments must be reconciled from Git declaratively
- Environment promotion needs a repo/branch/overlay topology decided
- An Application is OutOfSync, degraded, or drifting from Git
**Route elsewhere when:**
- Canary/blue-green traffic control inside a rollout -> `zero-downtime-release-strategies`
- Chart authoring itself -> `helm-kubernetes-deployment`
- Build/test pipelines upstream of Git -> `cicd-pipeline-design`
## 1. Declarative Fleet Architecture (App of Apps / ApplicationSet)
```yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: cluster-addons
namespace: argocd
spec:
generators:
- clusters:
selector:
matchLabels:
environment: production
template:
metadata:
name: '{{name}}-addons'
spec:
project: default
source:
repoURL: 'https://github.com/org/k8s-fleet-manifests.git'
targetRevision: HEAD
path: 'addons/base'
helm:
valueFiles:
- 'values-{{metadata.labels.region}}.yaml'
destination:
server: '{{server}}'
namespace: kube-system
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
```
---
## 2. GitOps Best Practices
- **Immutable Tags/SHAs**: Never point GitOps targets at mutable tags like `:latest`; reference immutable Git commits or image digests (`sha256:...`).
- **Separation of Repositories**: Maintain dedicated code repositories for application source code and separate config repositories for deployment state.
- **Automated Self-Healing**: Enable `selfHeal: true` to prevent manual cluster drift via direct `kubectl` manipulations.
---
## 3. Sync Waves & Reconciliation Semantics
Ordering inside a single Application is controlled by **sync waves** — lower waves complete
before higher ones start:
```yaml
metadata:
annotations:
argocd.argoproj.io/sync-wave: "-1" # CRDs and namespaces first
argocd.argoproj.io/hook: PreSync # migrations before the new version rolls
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
```
Typical layout: `-2` namespaces/quotas, `-1` CRDs and operators, `0` config and secrets,
`1` workloads, `2` ingress and probes-dependent jobs.
**When self-heal fights a controller**, the resource is being mutated in-cluster after sync
(HPA changing replicas, a mutating webhook injecting fields). Declare the field as
controller-owned instead of turning self-heal off:
```yaml
syncPolicy:
automated: { prune: true, selfHeal: true }
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers: ["/spec/replicas"] # HPA owns replica count
```
`prune: true` is what makes Git authoritative for deletions; without it, removed manifests
linger forever. Enable it only once the repository is genuinely the source of truth.
---
## 4. The Flux v2 Equivalent
Flux expresses the same fleet model with `GitRepository` + `Kustomization` and per-tenant
`ServiceAccount` impersonation:
```yaml
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata: { name: fleet, namespace: flux-system }
spec:
interval: 1m
url: https://github.com/acme/fleet
ref: { branch: main }
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: { name: apps-prod, namespace: flux-system }
spec:
interval: 10m
path: ./clusters/prod/apps
prune: true # same semantics as ArgoCD prune
wait: true
timeout: 5m
dependsOn: [{ name: infra-prod }] # ordering, where Argo uses sync waves
sourceRef: { kind: GitRepository, name: fleet }
serviceAccountName: prod-reconciler
postBuild:
substituteFrom: [{ kind: ConfigMap, name: cluster-vars }]
```
| Concern | ArgoCD | Flux v2 |
| --- | --- | --- |
| Fan-out across clusters | ApplicationSet generators | One Kustomization per cluster path, or `flux-operator` |
| Ordering | `sync-wave` annotations | `dependsOn` |
| Drift correction | `selfHeal: true` | Reconciliation every `interval` |
| UI / RBAC surface | Built-in web UI | CLI + Grafana dashboards |
Pick one per cluster. Running both against the same namespace produces two controllers fighting
over the same resources.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

