| name | middleware-ops |
| description | Middleware deployment and operations skill. For Helm deployment, status monitoring, performance tuning, and troubleshooting
of Redis, MySQL, Kafka, PostgreSQL and other middlewares.
触发场景:中间件部署、Redis 运维、MySQL 运维、Kafka 运维、数据库状态、缓存问题。
|
| allowed-tools | helm_deploy helm_upgrade helm_status helm_get_values kubectl_get kubectl_describe get_database_status query_prometheus_metric |
Middleware Deployment and Operations Guide
Redis Deployment
Helm Deployment
helm install redis bitnami/redis \
--namespace middleware --create-namespace \
-f charts/middlewares/redis/values.yaml
Key Config
| Parameter | Description | Default |
|---|
| architecture | standalone/replication | replication |
| auth.password | Auth password | Random generated |
| master.persistence.size | Master storage | 8Gi |
| replica.replicaCount | Replica count | 3 |
| master.resources.limits.memory | Memory limit | 256Mi |
Health Check PromQL
# Redis connections
redis_connected_clients
# Redis memory usage
redis_memory_used_bytes / redis_memory_max_bytes * 100
# Redis hit rate
rate(redis_keyspace_hits_total[5m]) / (rate(redis_keyspace_hits_total[5m]) + rate(redis_keyspace_misses_total[5m])) * 100
# Redis slow queries
redis_slowlog_length
MySQL Deployment
Helm Deployment
helm install mysql bitnami/mysql \
--namespace middleware \
-f charts/middlewares/mysql/values.yaml
Key Config
| Parameter | Description | Default |
|---|
| architecture | standalone/replication | standalone |
| auth.rootPassword | root password | Random generated |
| primary.persistence.size | Primary storage | 20Gi |
| primary.resources.limits.memory | Memory limit | 512Mi |
Health Check PromQL
# Connection usage
mysql_global_status_threads_connected / mysql_global_variables_max_connections * 100
# QPS
rate(mysql_global_status_queries[5m])
# Slow query count
rate(mysql_global_status_slow_queries[5m])
# Lock wait
mysql_global_status_innodb_row_lock_waits
Kafka Deployment
Helm Deployment
helm install kafka bitnami/kafka \
--namespace middleware \
-f charts/middlewares/kafka/values.yaml
Key Config
| Parameter | Description | Default |
|---|
| replicaCount | Broker count | 3 |
| persistence.size | Storage size | 50Gi |
| kraft.enabled | Use KRaft mode | true |
| resources.limits.memory | Memory limit | 1Gi |
Health Check PromQL
# Consumer Lag
kafka_consumergroup_lag_sum
# Active brokers
count(kafka_server_brokertopicmetrics_messagesin_total)
# Topic message rate
sum(rate(kafka_server_brokertopicmetrics_messagesin_total[5m])) by (topic)
Middleware General Operations
Post-Deployment Verification Checklist
- All Pods Running and Ready
- Service and Endpoint correct
- PVC bound with correct capacity
- Connection test passes (internal + external)
- Monitoring metrics reporting
- Backup policy configured (where applicable)
Scale Operations
- Check node resource headroom before scale-up
- Stateful service scale-up needs storage class support
- Confirm data migrated/backed up before scale-down
- All scale operations require user confirmation
Troubleshooting Flow
- Check Pod status and events
- Check resource usage (CPU/memory/disk)
- Query recent logs for errors
- Check if connections at limit
- Check if storage full
- Check network policies blocking