mysql-skill
4
总安装量
4
周安装量
#54053
全站排名
安装命令
npx skills add https://github.com/cooloo9871/my-awesome-skill --skill mysql-skill
Agent 安装分布
cline
4
github-copilot
4
codex
4
kimi-cli
4
gemini-cli
4
cursor
4
Skill 文档
MySQL Skill
This skill allows you to generate standardized Kubernetes manifests for MySQL, focusing on StatefulSets, hostNetwork, and persistent storage.
Core Features
- Headless Service: Provides stable network identifiers and exposes both MySQL (3306) and Metrics (9104) ports.
- StatefulSet: Manages MySQL pods with ordered deployment and built-in health checks (Readiness/Liveness probes).
- hostNetwork: Uses the node’s network namespace (with
ClusterFirstWithHostNetDNS policy). - Persistence: Uses
volumeClaimTemplateswith configurableStorageClass(defaults tolocal-path). - Observability Sidecar: Integrated
mysqld-exportercontainer within the same Pod for seamless monitoring. - Resource Management: Configurable CPU/Memory requests and limits for both MySQL and Exporter.
Usage Guide
- Generate Manifests: When asked to deploy MySQL, use
scripts/generate_mysql.py. - Architecture Visualization: Every report or deployment plan MUST include a high-fidelity architecture diagram.
- Use
scripts/generate_visuals.pyto create the JPG diagram.
- Use
- Stress Testing: Use
scripts/generate_stress_test.pyto verify performance under load. - Reporting: Direct embedding of the generated
.jpgfile path in the report is mandatory.
Command Templates
Deploy MySQL with Sidecar Monitoring (Recommended)
python3 scripts/generate_mysql.py --name <name> --namespace <namespace> --storage <storage> --storage-class <sc_name> --with-exporter
Advanced Resource Control
python3 scripts/generate_mysql.py --cpu-request 1 --mem-request 2Gi --cpu-limit 2 --mem-limit 4Gi
Stress Testing with Sysbench
python3 scripts/generate_stress_test.py --host <mysql_host> --namespace <namespace> --threads 8 --time 600
Generate Architecture Diagram (JPG)
python3 scripts/generate_visuals.py --name <name> --namespace <namespace> --storage <storage> --output mysql-arch.jpg
Aesthetic Standards
- Color: Pastel palette with high-contrast black borders.
- Accessibility: Distinct shapes for different roles (e.g., Hexagon for Services, Cylinder for PVC).
- Fidelity: Detailed logical clusters to reduce variance between generated reports.
Sidecar Configuration Example
When --with-exporter is used, the pod spec includes:
containers:
- name: mysql
image: mysql:8.0
# ...
- name: mysqld-exporter
image: prom/mysqld-exporter:v0.14.0
env:
- name: DATA_SOURCE_NAME
value: "root:<password>@tcp(localhost:3306)/"