Create a Kubernetes Helm Chart with Best Practices and Customization

Generate a complete, production-ready Kubernetes Helm chart with deployment, autoscaling, ingress, probes, and security best practices.

๐Ÿ“ The Prompt

Generate a complete Kubernetes Helm chart for deploying [APPLICATION_NAME], a [APPLICATION_TYPE] (e.g., stateless web API, worker service, stateful database). The application runs on port [APP_PORT] and requires [RESOURCE_DEPENDENCIES] (e.g., PostgreSQL, Redis, S3). **Chart Structure โ€” Generate all files:** 1. **Chart.yaml**: Set apiVersion v2, include dependencies for [SUBCHART_DEPENDENCIES] (e.g., bitnami/postgresql, bitnami/redis) with version pinning and condition toggles. 2. **values.yaml**: Provide a comprehensive, well-commented defaults file covering: - Image repository, tag (default `latest`), and pull policy - Replica count with HPA settings (min: [MIN_REPLICAS], max: [MAX_REPLICAS], CPU target: [CPU_TARGET]%) - Resource requests/limits (CPU: [CPU_REQUEST]/[CPU_LIMIT], Memory: [MEM_REQUEST]/[MEM_LIMIT]) - Environment variables from ConfigMap and Secrets with `existingSecret` support - Ingress configuration with TLS and [INGRESS_CLASS] annotation - Pod disruption budget, topology spread constraints, and affinity rules 3. **templates/deployment.yaml**: Include liveness/readiness/startup probes hitting [HEALTH_ENDPOINT], security context (non-root, read-only filesystem), graceful shutdown with preStop hook, and init containers for [INIT_TASK] (e.g., DB migration, config loading). 4. **templates/service.yaml**: ClusterIP service with named ports. 5. **templates/ingress.yaml**: Conditional ingress with path-based routing. 6. **templates/hpa.yaml**: HorizontalPodAutoscaler with CPU and custom metrics. 7. **templates/configmap.yaml** and **templates/secret.yaml**: Externalized configuration. 8. **templates/_helpers.tpl**: Standard helper templates for name, fullname, labels, and selector labels. 9. **templates/NOTES.txt**: Post-install instructions showing how to access the application. 10. **templates/tests/test-connection.yaml**: Helm test that verifies the service is reachable. Use `{{- include }}`, `{{- toYaml }}`, and proper indentation helpers throughout. Add comments explaining non-obvious template logic.

๐Ÿ’ก Tips for Better Results

Always specify your Kubernetes cluster version and ingress controller type (nginx, traefik, ALB) since annotation syntax varies significantly between them. Set explicit resource requests and limits in your prompt values โ€” the AI will structure them properly, and you avoid noisy-neighbor issues in production. Test the generated chart with `helm template . | kubectl apply --dry-run=client -f -` before deploying to catch rendering issues early.

๐ŸŽฏ Use Cases

Platform engineers and DevOps teams use this when packaging applications for Kubernetes deployment, ensuring consistency across environments and enabling teams to customize deployments through values overrides.

๐Ÿ”— Related Prompts

๐Ÿ’ป Coding beginner

Explain Code Like Im a Beginner

Get any code explained in plain English with line-by-line breakdowns, analogies, and learning suggestions.

๐Ÿ’ป Coding beginner

Debug My Code and Explain the Fix

Get your code debugged with clear explanations of what went wrong and why, plus the corrected version.

๐Ÿ’ป Coding intermediate

Write Unit Tests for My Code

Generate thorough unit tests covering edge cases, error handling, and both positive and negative scenarios.

๐Ÿ’ป Coding intermediate

Convert Code Between Languages

Convert code between any programming languages while maintaining idiomatic patterns and best practices.

๐Ÿ’ป Coding intermediate

Write a REST API Endpoint

Generate production-ready REST API endpoints with validation, error handling, and documentation.

๐Ÿ’ป Coding advanced

Create a GitHub Actions CI/CD Workflow for Automated Testing and Deployment

Generate a complete GitHub Actions CI/CD workflow with build, test, deploy, and notification jobs for your project.