Context and guidelines for developing Performance Co-Pilot Helm charts for Kubernetes deployments
Expert guidance for developing and maintaining Helm charts for Performance Co-Pilot (PCP) - a system performance analysis toolkit for Kubernetes.
Provides comprehensive context for working with PCP Helm charts, including architecture decisions, container integration patterns, storage strategies, and deployment best practices for monitoring system performance in Kubernetes environments.
When working on PCP Helm charts:
1. **Understand the Architecture**
- PCP provides real-time and historical system metrics collection
- Two Helm charts exist: main PCP container and archive-analysis (with Grafana + grafana-pcp)
- Charts are hosted at `quay.io/performancecopilot-helm-charts`
- Container images at `quay.io/performancecopilot`
2. **Respect Core Design Constraints**
- **Single Instance Only**: Always keep `replicaCount: 1` - PCP monitors system resources and replicas would create duplicate/conflicting data
- **No Horizontal Scaling**: Disable autoscaling - horizontal scaling doesn't make sense for system monitoring
- **Privileged Mode**: Required for the main PCP container (not archive-analysis) to access host system resources
- **Systemd Init**: Containers use `/usr/sbin/init` requiring special Kubernetes handling
3. **Configure Storage Correctly**
- Provision persistent volumes:
- `/var/log/pcp/pmlogger` (1Gi) - metric archives
- `/var/log/pcp/pmproxy` (1Gi) - proxy logs
- Use ConfigMaps for OpenMetrics PMDA configuration
- Consider optional host filesystem mounts for advanced monitoring
4. **Set Key Environment Variables**
- `PCP_SERVICES`: Controls active services (default: `pmcd,pmie,pmlogger,pmproxy`)
- `PCP_DOMAIN_AGENTS`: Comma-separated agent list (e.g., `"bpf,bpftrace"`)
- `HOST_MOUNT`: Path to host root for host monitoring mode
- `KEY_SERVERS`: Redis/Valkey connection specs
5. **Enable Host Monitoring Mode** (for eBPF and deep system access)
```yaml
hostMonitoring:
enabled: true
hostNetwork: true
env:
HOST_MOUNT: "/host"
PCP_DOMAIN_AGENTS: "bpf,bpftrace"
```
6. **Implement Health Checks Properly**
- **Liveness**: Use `systemctl is-active pmcd` (systemd-aware check)
- **Readiness**: TCP socket check on pmcd port 44321
- Adjust timing to account for systemd container startup delays
7. **Validate and Test Changes**
```bash
# Validate chart syntax
helm lint ./pcp
# Preview rendered templates
helm template pcp ./pcp
# Install with host monitoring
helm install pcp ./pcp \
--set hostMonitoring.enabled=true \
--set hostNetwork=true \
--set env.HOST_MOUNT="/host"
# Test archive-analysis chart
helm install archive-analysis ./archive-analysis
```
8. **Reference Official Documentation**
- [PCP Website](https://pcp.io) - Official guides
- [PCP GitHub](https://github.com/performancecopilot/pcp) - Source and issues
- [Container Docs](https://github.com/performancecopilot/pcp/blob/main/build/containers/README.md) - Container configuration
- [Releases](https://github.com/performancecopilot/pcp/releases) - Pre-built packages
- [Package Repository](https://packagecloud.io/performancecopilot/pcp) - deb/rpm packages
9. **Common Pitfalls to Avoid**
- Don't enable autoscaling or increase replicas beyond 1
- Don't remove privileged mode from the main PCP container
- Don't use standard init probes - systemd requires special handling
- Don't forget persistent volume claims for metric archives
- Don't overlook systemd startup time when setting probe intervals
10. **Key Files and Locations**
- Chart definitions: `./pcp/` and `./archive-analysis/`
- Values: `values.yaml` in each chart directory
- Templates: `templates/` subdirectories
- Archive storage: `/var/log/pcp/pmlogger`
- Proxy logs: `/var/log/pcp/pmproxy`
**Scenario**: Deploy PCP with eBPF monitoring enabled
```yaml
hostMonitoring:
enabled: true
hostNetwork: true
env:
HOST_MOUNT: "/host"
PCP_DOMAIN_AGENTS: "bpf,bpftrace"
PCP_SERVICES: "pmcd,pmie,pmlogger,pmproxy"
persistence:
pmlogger:
size: 5Gi
pmproxy:
size: 2Gi
```
```bash
helm install pcp ./pcp -f values.yaml
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/pcp-helm-charts-development/raw