agentleFS
MicrosoftKnown publishermicrosoft/PilotSwarm/templates/builder-agents/skills/pilotswarm-aks-identity/SKILL.md

pilotswarm-aks-identity

Skill14 starsChanged 8 months agoMITView on GitHub

Use when setting up cross-cluster AKS access with Workload Identity, RBAC, and kubectl configuration for PilotSwarm workers.

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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
  1. Distinctive:

    Prefer Azure Workload Identity on the control cluster instead of relying on node identity.

    line 13
  2. Distinctive:

    When documenting or implementing this flow, include validation from inside a control-plane pod:

    line 37
  3. Distinctive:

    verify with that kubeconfig:

    line 63
  4. Distinctive:

    keep control-cluster and workload-cluster operations separate in docs and env vars

    line 71
  5. Distinctive:

    prefer explicit namespaces and label selectors for log collection

    line 72
  6. Very specific:

    prefer kubectl create secret generic ...

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PilotSwarm AKS Identity & Cross-Cluster Access

How to wire Workload Identity, RBAC, and kubectl when PilotSwarm workers in a control AKS cluster need to manage a second AKS cluster.

Cross-Cluster AKS Access Pattern

Prefer Azure Workload Identity on the control cluster instead of relying on node identity.

Required pieces:

  1. control cluster with OIDC issuer enabled
  2. control cluster with workload identity enabled
  3. user-assigned managed identity
  4. Kubernetes service account annotated with:
    • azure.workload.identity/client-id: <client-id>
  5. worker pods labeled with:
    • azure.workload.identity/use: "true"
  6. federated credential for:
    • control-cluster OIDC issuer
    • subject system:serviceaccount:<namespace>:<service-account>
    • audience api://AzureADTokenExchange

Minimum Azure RBAC usually needed:

  • Azure Kubernetes Service Cluster User Role on the workload AKS cluster
  • Storage Blob Data Contributor on the storage account

Validation Pattern

When documenting or implementing this flow, include validation from inside a control-plane pod:

  1. confirm AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_FEDERATED_TOKEN_FILE, and AZURE_AUTHORITY_HOST
  2. log in with:
az login \
  --service-principal \
  -u "$AZURE_CLIENT_ID" \
  -t "$AZURE_TENANT_ID" \
  --federated-token "$(cat "$AZURE_FEDERATED_TOKEN_FILE")" \
  --allow-no-subscriptions
  1. fetch target-cluster kubeconfig:
az aks get-credentials \
  --subscription "$AZURE_SUBSCRIPTION_ID" \
  --resource-group "$AZURE_RESOURCE_GROUP" \
  --name "$WORKLOAD_CLUSTER_NAME" \
  --file /tmp/workload-kubeconfig \
  --overwrite-existing
  1. verify with that kubeconfig:
    • kubectl auth can-i create pods
    • a short-lived probe pod can be created and deleted

kubectl Guidance

  • from a workstation or CI host, use kubectl --context <cluster-context>
  • from inside a control-plane pod, use a temporary kubeconfig file
  • keep control-cluster and workload-cluster operations separate in docs and env vars
  • prefer explicit namespaces and label selectors for log collection
  • prefer kubectl create secret generic ... --from-env-file=... for worker env injection

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.