技能库
智客分类:运维与云
infrastructure
Infrastructure
Kubernetes号、主机、集装箱和提供云的遥测船进入Grafana Cloud——`k8s-监测' K8s集群的Helm图(量子+日志+痕迹+事件+成本),合金"prometheus.exporter.unix"用于Linux主机,cAdvisor+多克发现用于容器,和Cloud Watch / Azure Monitor / Google Cloud 监控数据源设置. 将新集群或 VM 机队装入 Grafana Cloud 时使用, 选择右边 K8s刮取,接通kube-state-meters + node-exporter + cAdvisor,提醒"PodCrashLooping"/节点内存/PVC容量,或拉出AWS / Azure / GCP云度量衡——即使用户表示"监视我的集群","发送K8s度量衡到Grafana","scrape EC2度量衡","集群座舱记录",或"安装监测方向图"而不命名"k8s-监测"或"合金".
SKILL.md / Agent 安装方式 SKILL.md 原文
4657 安装量
官方网址:skills.sh
技能介绍
先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。
做什么
Kubernetes号、主机、集装箱和提供云的遥测船进入Grafana Cloud——`k8s-监测' K8s集群的Helm图(计量+日志+痕迹+事件+成本),合金"prometheus.exporter.unix"用于Linux主机,cAdvisor+多克发现用于容器,和CloudWatch/AzureMonitor/Google云监测数据源设置
何时用
搭载一个新的集群或VM舰队前往格拉法纳克云,选择右边 K8s 刮去、 接线 kube- state- meters + node- exporter + cAdvisor, 提醒“ PodCrashLooping” / 节点内存 / PVC 容量, 或拉出 AWS / Azure / GCP 云度量度值—— 即使用户
代理如何加载
按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Grafana Cloud Infrastructure Monitoring、Prerequisites、Common Workflows、1. Onboard a Kubernetes cluster (k8s-monitoring chart)、1. Create the namespace + secret、2. Install — values.yaml in references/k8s-monitoring-values.md。 其中含规范建议的小节:分步指令。
文件分析
文件分析:除 SKILL.md 外,正文引用了 references/k8s-monitoring-values.md、references/clouds-and-hosts.md,属于带资源的技能包,这些文件按需再读。
官方 description(原文)
Ship Kubernetes, host, container, and cloud-provider telemetry into Grafana Cloud — `k8s-monitoring` Helm chart for K8s clusters (metrics + logs + traces + events + cost), Alloy `prometheus.exporter.unix` for Linux hosts, cAdvisor + Docker discovery for containers, and CloudWatch / Azure Monitor / Google Cloud Monitoring datasource setup. Use when onboarding a new cluster or VM fleet to Grafana Cloud, picking the right Helm values for K8s scraping, wiring kube-state-metrics + node-exporter + cAdvisor, alerting on `PodCrashLooping` / node memory / PVC capacity, or pulling AWS / Azure / GCP cloud metrics — even when the user says "monitor my cluster", "send K8s metrics to Grafana", "scrape EC2 metrics", "cluster pod logs", or "install the monitoring helm chart" without naming `k8s-monitoring` or Alloy.
Grafana Cloud Infrastructure Monitoring Prerequisites Common Workflows 1. Onboard a Kubernetes cluster (k8s-monitoring chart) 1. Create the namespace + secret 2. Install — values.yaml in references/k8s-monitoring-values.md 3. Verify every pod is Running Expect alloy-*, kube-state-metrics-*, node-exporter-*, etc. all Ready. 4. Verify no error logs in the metrics/logs/traces Alloys 5. Verify telemetry landed in Grafana Cloud PromQL on the metrics datasource (should be > 0): sum(up{cluster="production-us-east"})
· 许可:Apache-2.0
来源分类:skills.sh agent-skill
来源与网址
nameinfrastructure
descriptionShip Kubernetes, host, container, and cloud-provider telemetry into Grafana Cloud — `k8s-monitoring` Helm chart for K8s clusters (metrics + logs + traces + events + cost), Alloy `prometheus.exporter.unix` for Linux hosts, cAdvisor + Docker discovery for containers, and CloudWatch / Azure Monitor / Google Cloud Monitoring datasource setup. Use when onboarding a new cluster or VM fleet to Grafana Cloud, picking the right Helm values for K8s scraping, wiring kube-state-metrics + node-exporter + cAdvisor, alerting on `PodCrashLooping` / node memory / PVC capacity, or pulling AWS / Azure / GCP cloud metrics — even when the user says "monitor my cluster", "send K8s metrics to Grafana", "scrape EC2 metrics", "cluster pod logs", or "install the monitoring helm chart" without naming `k8s-monitoring` or Alloy.
许可 Apache-2.0
发现技能 客户端向 Agent 提供名称与描述目录。
匹配与调用 用户指定或任务匹配后,载入 SKILL.md 指令。
按需加载 按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 2 references/k8s-monitoring-values.mdreferences/clouds-and-hosts.md以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。
具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗
先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。
该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。
交给 Agent 安装
复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。
把 Agent Skill「infrastructure」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-194fa957e5056f1d-Infrastructure.html
请存为 .cursor/skills/infrastructure/SKILL.md 或 .claude/skills/infrastructure/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/grafana/skills 取完整目录,不要只建一个 SKILL.md。
复制安装提示词 GitHub 完整包 ↗
终端安装 · Skills CLI
需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。
npx skills add 'https://github.com/grafana/skills' --list
复制查看命令
目标客户端
安装时交互选择 Codex Claude Code Cursor
安装范围
当前项目 我的所有项目
npx skills add 'https://github.com/grafana/skills' --skill 'infrastructure' 复制安装命令
CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。
SKILL.md 原文 可复制,不会改动源文件
复制 SKILL.md
恢复原文
阅读排版
---
name: infrastructure
license: Apache-2.0
description: Ship Kubernetes, host, container, and cloud-provider telemetry into Grafana Cloud — `k8s-monitoring` Helm chart for K8s clusters (metrics + logs + traces + events + cost), Alloy `prometheus.exporter.unix` for Linux hosts, cAdvisor + Docker discovery for containers, and CloudWatch / Azure Monitor / Google Cloud Monitoring datasource setup. Use when onboarding a new cluster or VM fleet to Grafana Cloud, picking the right Helm values for K8s scraping, wiring kube-state-metrics + node-exporter + cAdvisor, alerting on `PodCrashLooping` / node memory / PVC capacity, or pulling AWS / Azure / GCP cloud metrics — even when the user says "monitor my cluster", "send K8s metrics to Grafana", "scrape EC2 metrics", "cluster pod logs", or "install the monitoring helm chart" without naming `k8s-monitoring` or Alloy.
---
# Grafana Cloud Infrastructure Monitoring
> **Docs**: https://grafana.com/docs/grafana-cloud/monitor-infrastructure/
K8s + host + container + cloud-provider telemetry, mostly via the `grafana/k8s-monitoring` Helm chart or Alloy.
## Prerequisites
- Grafana Cloud stack with Prometheus / Loki / Tempo endpoints + API key (`metrics:write`, `logs:write`, `traces:write`)
- For Kubernetes: a cluster + `helm` 3.x + `kubectl` context pointing at it
- For hosts / Docker: Alloy installed on the node
## Common Workflows
### 1. Onboard a Kubernetes cluster (k8s-monitoring chart)
```bash
# 1. Create the namespace + secret
kubectl create namespace monitoring
kubectl create secret generic grafana-cloud-secret \
-n monitoring --from-literal=api-key=
# 2. Install — values.yaml in references/k8s-monitoring-values.md
helm repo add grafana https://grafana.github.io/helm-charts && helm repo update
helm install k8s-monitoring grafana/k8s-monitoring \
--version 4.1.4 -n monitoring -f values.yaml
# 3. Verify every pod is Running
kubectl get pods -n monitoring
# Expect alloy-*, kube-state-metrics-*, node-exporter-*, etc. all Ready.
# 4. Verify no error logs in the metrics/logs/traces Alloys
kubectl -n monitoring logs deploy/k8s-monitoring-alloy-metrics --tail=50 | grep -iE 'error|level=err' || echo "clean"
# 5. Verify telemetry landed in Grafana Cloud
# PromQL on the metrics datasource (should be > 0):
# sum(up{cluster="production-us-east"})
# LogQL on Loki:
# sum(count_over_time({cluster="production-us-east"}[5m]))
```
Full `values.yaml`, key PromQL, dashboard IDs (15520, 1860, 14282…), and alert rules: [`references/k8s-monitoring-values.md`](references/k8s-monitoring-values.md).
### 2. Monitor a Linux host
```alloy
# 1. /etc/alloy/config.alloy — see references/clouds-and-hosts.md for the full block
prometheus.exporter.unix "host" { rootfs_path = "/" }
prometheus.scrape "node" { targets = prometheus.exporter.unix.host.targets
forward_to = [prometheus.remote_write.cloud.receiver] }
```
```bash
# 2. Reload Alloy and verify the unix exporter is up
systemctl reload alloy
curl -s http://localhost:12345/api/v0/web/components | jq '.[] | select(.id|contains("prometheus.exporter.unix"))'
# 3. Verify in Grafana Cloud — open the "Node Exporter Full" dashboard (ID 1860)
# and pick your host from the `instance` dropdown.
```
### 3. Pull AWS / Azure / GCP metrics
Provision the datasource (full YAML in [`references/clouds-and-hosts.md`](references/clouds-and-hosts.md)), then:
```bash
# 1. After provisioning, restart Grafana to pick up the file
# 2. Verify the datasource — Grafana → Connections → Data sources → "Test"
# Expect "Successfully queried the CloudWatch metrics API" (or equivalent).
# 3. Confirm a query — Explore → datasource → metric e.g.
# CloudWatch namespace AWS/EC2 metric CPUUtilization, last 1h.
```
## Troubleshooting
- chart installed but no metrics in Cloud → check the `grafana-cloud-secret` `api-key` value; check Alloy logs for `401`
- `kube-state-metrics` pod Pending → likely RBAC; reapply the chart's CRDs/CRBs
- Node-exporter pod CrashLoopBackOff → typically `hostNetwork: true` collision with the host's :9100; change the port
- CloudWatch "Access denied" → IAM role missing `cloudwatch:GetMetricData`, `cloudwatch:ListMetrics`
## Resources
- [`grafana/k8s-monitoring` chart](https://github.com/grafana/k8s-monitoring-helm)
- [Monitor Infrastructure docs](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/)
- [CloudWatch datasource](https://grafana.com/docs/grafana/latest/datasources/aws-cloudwatch/)
- [Azure Monitor datasource](https://grafana.com/docs/grafana/latest/datasources/azure-monitor/)
- [Google Cloud Monitoring datasource](https://grafana.com/docs/grafana/latest/datasources/google-cloud-monitoring/)
相关技能
运维与云
用于容器管理,图像操作,调试的基本道克命令和工作流程.
运维与云
从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…
运维与云
构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…
运维与云
执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…