AGENT SKILL

PilotSwarm AKS 跨集群身份配置

pilotswarm-aks-identity

为 PilotSwarm worker 配置跨集群 AKS 访问(使用 Workload Identity、RBAC 和 kubectl 配置)时使用。

适用职业云架构师
License 许可
MIT
最近更新
2026-11-15
Stars
★ 16
Forks
10

01 前言 Front Matter

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

02 资源文件 89

03 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

04 同仓库更多 Skills

microsoft
microsoft/PilotSwarm

workflow-testing

Load before you test a Workflow with mocked effects — the test, test_respond and test_advance operations, fixtures, interception ids, valid answers, the virtual clock, test evidence and what a test run does not prove.

★ 16
microsoft
microsoft/PilotSwarm

workflow-tools

Every argument of the Workflow tools, testing a revision, package definitions and the refusals you can fix. Load when a Workflow tool's short description is not enough.

★ 16
microsoft
microsoft/PilotSwarm

workflow-reference

Field reference for Workflow YAML (root keys, every state type, bindings, outputs, runtime error codes), what the engine guarantees, and a review fan-out example. For design, call load_skill with name workflow-authoring.

★ 16
microsoft
microsoft/PilotSwarm

workflow-patterns

Load when one Workflow must run different nodes in its branches at the same time (a different prompt or model for each branch), or loops back to a state (a polling loop). Named branches, the router pattern, examples that compile.

★ 16
microsoft
microsoft/PilotSwarm

workflow-authoring

Load before you create, edit, publish or run a Workflow (pilotswarm.dev/v1) — choosing states, bounded graphs, bindings, typed contracts, agent and parallel states, the lifecycle and failure diagnosis.

★ 16
microsoft
microsoft/PilotSwarm

tla-formal-validation

Required for any change to the core orchestrations (the durable session orchestration, session hydration and dehydration, and the Workflow controller and store). Teaches how to model the change in TLA+, update the existing models, run TLC with the repo runner, read the results, turn a counterexample into a fix and a regression test, and record the binding to the code.

★ 16