SRE Agent 演示部署
deploying-demo
端到端部署 SRE Agent 演示。当用户要求搭建、部署或运行此演示时使用。
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 189
- Forks
- 198
01 前言 Front Matter
- name
- deploying-demo
- description
- Deploy the SRE Agent demo end-to-end. Use when asked to set up, deploy, or get this demo running.
03 SKILL.md 正文
Deploying the Demo
Prerequisites Check
Run these and install anything missing:
az version— need 2.60+azd version— need 1.9+pwsh -v— need 7.4+- Azure permission: Owner, User Access Administrator, or equivalent
Microsoft.Authorization/roleAssignments/writeat subscription scope. The template grants the agent runtime identity subscription Reader for correlation context and removes it duringazd down. - The responsible owner and expiry date, using the tag keys required by the
target subscription. If deployment policy does not apply them, tag the
resource group immediately after
azd up.
Note:
kubectlis not required on your local workstation. The cluster is private. Operator scripts in this repo go throughaz aks command invoke(wrapped byscripts/_aks-helpers.ps1). The SRE Agent uses its built-inRunKubectlReadCommandandRunKubectlWriteCommandtools instead.
Phase 1: Azure Deployment
- Check if user has a subscription:
az account show - Set azd environment:
azd env set AZURE_SUBSCRIPTION_ID <sub-id>andazd env set AZURE_LOCATION swedencentral - Run
azd up --no-prompt - Wait for completion (~25 min). Monitor progress. The post-provision hook handles image build, k8s manifest apply (via command invoke), workload identity federation, and SRE Agent data-plane sync.
Phase 2: Verify Deployment
The AKS API server is private (enablePrivateCluster: true) — local kubectl
will not work. Human operators use the Azure-proxied command-invoke path:
. .\scripts\_aks-helpers.ps1
$ctx = Resolve-AksContext
$r = Invoke-AksCommand -ResourceGroup $ctx.ResourceGroup -ClusterName $ctx.ClusterName `
-Command "kubectl get svc -n ingress-nginx ingress-nginx-controller -o jsonpath='{.status.loadBalancer.ingress[0].ip}'" -Quiet
$ip = ($r.logs -replace '[^\d\.]','').Trim()
"Storefront: http://$ip"
- Open
http://<ip>/in a browser — verify products load, status shows healthy. - Hit the health endpoint from your local workstation:
Invoke-RestMethod "http://<ip>/api/health"(the storefront LoadBalancer IP is public; only the cluster API server is private). - If the LB IP is not reachable from your machine (corporate VPN, etc.), verify
from inside the cluster instead:
Invoke-AksCommand -ResourceGroup $ctx.ResourceGroup -ClusterName $ctx.ClusterName ` -Command "kubectl exec -n zava-demo deploy/zava-api -- wget -qO- http://localhost:3001/api/health"
For SRE Agent operations, use the built-in
RunKubectlReadCommandandRunKubectlWriteCommandtools. Seedocs/aks-access-and-auth.mdfor other operator and automation access options.
Phase 3: Configure + verify SRE Agent
Bicep provisions the agent, identity, networking, autonomous mode, and Azure Monitor binding. The setup script waits for the authenticated configuration API, then applies the separate connector Bicep template. It applies custom skills and response plans from the repository, uploads knowledge files, syncs global instructions, enables the Microsoft Learn tools, and verifies the result.
azd up runs setup-sre-agent.ps1 through the post-provision hook. Run it
manually only to retry or apply later configuration changes:
- If azd outputs are complete, run
.\scripts\setup-sre-agent.ps1. - For standalone recovery after partial provisioning, pass the values
explicitly:
.\scripts\setup-sre-agent.ps1 ` -ResourceGroup <resource-group> ` -AgentName <sre-agent-name> ` -PostgresHost <server>.postgres.database.azure.com ` -PostgresDatabase zava_store ` -SreAgentClientId <attached-umi-client-id> ` -SreAgentPrincipalName <attached-umi-resource-name>PostgresHostmust be the Flexible Server FQDN. The principal name must be the resource name of the same attached/action UMI selected by the client ID. Never substitute the SRE Agent resource name while using the UMI client ID. - For missing connectors, skills, or response plans, inspect the reported
failure and rerun
setup-sre-agent.ps1. If core agent infrastructure is missing, rerunazd provision. Do not add sleeps to hide readiness failures:-ReadinessTimeoutSecondsand-ConnectorTimeoutSecondsbound the existing readiness/deployment gates. A timed-out connector deployment is canceled on a best-effort basis; inspect its status before retrying.
Post-provision waits for the operator's Kubernetes access before applying
manifests and fails if ingress installation, application rollout, or endpoint
lookup fails. After correcting a transient failure, retry
.\scripts\post-provision.ps1 -SkipImageBuild only if both image builds already
succeeded. Do not treat ARM provisioning success as proof that the app is ready.
Optional: confirm the agent is reachable
Sanity-check the agent's data-plane API before running break/fix scenarios:
.\scripts\watch-agent.ps1 # lists incident threads (empty on a fresh deploy is fine)
This is the same script the running-demo skill uses to tail the agent live during scenarios.
Teardown
azd down --force --purge
Run teardown from the same azd environment. Confirm that the resource group is
absent and the runtime identity's subscription Reader assignment was removed.
If the command fails, inspect the reported AMPLS link or role assignment before
retrying. Use a new environment name for the next deployment.
04 同仓库更多 Skills
Zava 事件分析报告生成
zava-reporting
用于将已完成的 Zava Learning 事件分析打包呈现给受众。首先呈现带品牌标识的线程内执行摘要(内联前后对比视觉效果的 markdown),然后生成可下载的交付物——PowerPoint 演示文稿、HTML 电子邮件和 Teams 通知,使用 Zava 企业模板。调用的 agent 可将其缩小为子集(例如仅 HTML 报告)。产出内容和工件;它不负责发送。组装 rca-analysis、evidence-before-after、recommendations-next-steps 和 pr-delivery 的输出。
Zava 治理审计报告生成
zava-audit-report
用于将已完成的 Zava Learning 每周治理审计(NSG/网络安全、RBAC/最小权限或云成本)打包成一份采用 Zava 企业风格、带品牌标识的可下载 PowerPoint 演示文稿。调用的审计 agent 传入其发现结果(带严重级别的条目列表)和简短的安全态势摘要;本技能渲染演示文稿、应用脱敏处理,并返回附件下载链接。产出工件本身;它不负责发送。
ServiceNow 变更请求管理
servicenow-change-management
当 Zava Learning 调查产生了需要变更管理的持久性修复时使用——在为基础设施即代码或应用代码的根本原因打开 GitHub PR 之后,提出引用该 PR 的 ServiceNow 变更请求并附上 RCA 报告。是 ServiceNow 变更请求及附件操作的唯一负责方。
敏感信息脱敏
redaction-guard
每当要输出操作员可见的内容时使用——聊天/话题消息、PagerDuty 或 ServiceNow 记录、提交信息或拉取请求正文,或任何报告制品(HTML、PowerPoint、Teams 卡片)。确定性地屏蔽密钥、凭证、令牌、私钥、URI 中嵌入的密码以及个人身份信息(PII),确保它们不会出现在对话或任何交付物中。这是一项横切护栏,由产生输出的技能调用,而非一个操作手册步骤。
事件改进建议
recommendations-next-steps
用于为 Zava Learning 事件生成前瞻性的建议和后续步骤——包括按优先级排序的预防性、检测性和流程性行动,并附带负责人、目标日期和不采取行动的风险。其输出用于 zava-reporting 交付物。
事件根因分析
rca-analysis
用于为已解决或已缓解的 Zava Learning 事件生成根因分析叙述——包括事件时间线、触发因素与潜在根因(5-Whys)、促成因素以及如何呈现这些内容。定义 RCA 章节格式;其输出用于前后对比、建议和报告等交付物。