Kubernetes has revolutionized the way we deploy applications, but managing numerous Kubernetes resources for complex applications can quickly grow to become a heavy burden. That’s where Helm, the package manager for Kubernetes, comes in. However, as your deployments become more complex and approach production environments, vanilla Helm may not be enough. As with any production system, you need robust tooling to ensure that your Helm charts are clean, maintainable and secure.
In this article, I’ll cover the essential plugins and features that will step up your Helm deployments to a level of production quality. These tools will help you with validation, security, testing, documentation and more — providing everything you need to create reliable, repeatable deployments in your Kubernetes clusters.
TL;DR: Essential Tools for Production-Ready Helm Charts
- helm-diff — Preview changes before applying
- helm-secrets — Securely manage sensitive information
- helm-mapkubeapis — Handle Kubernetes API deprecations
- Chart Testing (ct) — Comprehensive chart testing for CI
- helm-unittest — Unit test chart templates
- helm-docs — Automate chart documentation
- Trivy — Security scanning for vulnerabilities
- Infracost — Estimate cloud costs before deployment
- Helmfile — Declarative Helm chart management
1. Visualizing Changes with helm-diff
What is helm-diff?
Helm-diff is a plugin that shows a preview of what a helm upgrade would change, presented as a colored diff. This allows you to catch potential issues before they reach your cluster and provides visibility into exactly what’s changing in your deployments.
Key Benefits
- Prevent Unexpected Changes: Visualize all changes before applying them to your cluster
- Pre-Deployment Verification: Ensure your configuration updates will have the intended effect
- Integration with CI/CD: Add verification steps in your pipeline to confirm expected changes
- Support for Multiple Commands: Use with upgrade, rollback, and revision to compare different states
Getting Started with helm-diff
Installation is straightforward:
|
|
To see what changes a Helm upgrade would introduce:
|
|
For comparing specific releases or revisions:
The plugin helps you catch configuration drift and avoid unintended side effects when updating applications, making it an indispensable tool for production environments.
2. Securing Secrets with helm-secrets
What is helm-secrets?
Helm-secrets is a plugin that helps securely manage sensitive information in your Helm deployments. It supports various backends including SOPS (Mozilla’s Secrets OPerationS) and vals, allowing you to store secrets in cloud providers like AWS Secrets Manager, Azure Key Vault, or HashiCorp Vault.
Key Benefits
- Secure Secret Management: Keep sensitive data encrypted in your Git repositories
- Multiple Backend Support: Use your preferred secret store, from cloud-native solutions to local encryption
- Cloud Integration: Reference secrets directly from your cloud provider
- GitOps Friendly: Works well with GitOps workflows, including ArgoCD integration
Getting Started with helm-secrets
Install the plugin:
|
|
Create encrypted values files (example with SOPS backend):
Using cloud provider secrets with vals:
Helm-secrets ensures your sensitive data remains protected throughout your development and deployment processes, a critical requirement for production deployments.
3. Managing API Deprecations with helm-mapkubeapis
What is helm-mapkubeapis?
Helm-mapkubeapis is a plugin that updates Helm release metadata containing deprecated or removed Kubernetes APIs to use supported APIs. This is crucial when upgrading your Kubernetes cluster to a version that removes APIs used in your existing Helm releases.
Key Benefits
- Kubernetes Upgrade Readiness: Ensure your Helm releases continue to work after cluster upgrades
- Metadata Modernization: Update release data to use supported APIs without changing the deployed resources
- No Reinstallation Required: Fix API issues without redeploying your applications
- Supports Multiple Resources: Works with various resource types affected by API deprecations
Getting Started with helm-mapkubeapis
Install the plugin:
|
|
Map a release’s APIs to supported versions:
With Kubernetes constantly evolving, this plugin is essential for maintaining the health of long-running Helm deployments across cluster upgrades.
4. Testing Charts with Chart Testing (ct) and helm-unittest
What is Chart Testing (ct)?
Chart Testing (ct) is a tool designed for testing Helm charts. It’s particularly useful in CI environments and provides comprehensive testing capabilities including linting, installing, and testing Helm charts, and generating comprehensive reports.
Key Benefits
- Comprehensive Testing: Performs linting, validation, installation, and chart testing
- CI/CD Integration: Designed for seamless integration with CI platforms
- Version Management: Detects and tests only changed charts
- Multiple Cluster Support: Can test charts across different Kubernetes versions
- Extensible: Supports custom validators and test hooks
Getting Started with Chart Testing
Install chart-testing:
|
|
Create a ct.yaml configuration file:
Run chart testing:
5. Unit Testing with helm-unittest
Helm-unittest is a plugin that allows you to write and run unit tests for your Helm charts in YAML. It provides a way to validate chart templates locally without deploying to a cluster.
Key Benefits
- Local Testing: Test charts without a Kubernetes cluster
- Comprehensive Testing: Validate template rendering, values injection, and more
- YAML-based Tests: Write tests in a familiar YAML format
- CI/CD Integration: Easily incorporate into your continuous integration workflows
Getting Started with helm-unittest
Install the plugin:
|
|
Create a test file in charts/mychart/tests/:
|
|
Run your tests:
|
|
Unit testing your Helm charts ensures they behave as expected with different input values, critical for maintaining reliability in production deployments.
6. Documenting Charts with helm-docs
What is helm-docs?
Helm-docs automatically generates documentation from your Helm chart’s values.yaml file and other metadata, ensuring your chart documentation stays up-to-date with your code.
Key Benefits
- Automated Documentation: Keep README files in sync with chart changes
- Standardized Format: Ensure consistent documentation across all charts
- Multiple Output Formats: Generate Markdown, AsciiDoc, or other formats
- Template Customization: Define your own templates for specialized documentation
Getting Started with helm-docs
Install helm-docs:
Create a .helm-docs.yaml configuration:
|
|
Generate documentation:
Having well-maintained documentation is essential for team collaboration and maintenance of production-grade Helm charts.
7. Cost Estimation with Infracost
What is Infracost?
While originally designed for Terraform, Infracost now supports analyzing Helm charts to provide cloud cost estimates before deployment. This helps you understand the financial implications of your Kubernetes infrastructure.
Key Benefits
- Cost Awareness: Understand the cost implications of your deployments
- Resource Optimization: Identify expensive components before deployment
- Budget Planning: Project costs for new services and upgrades
- Cloud Provider Comparison: Compare costs across different providers
Getting Started with Infracost
Install Infracost:
Initialize with your API key and scan a Helm chart:
Incorporating cost estimates into your Helm workflow helps maintain financial control while scaling your Kubernetes applications.
8. Declarative Management with Helmfile
What is Helmfile?
Helmfile is a declarative specification for deploying and managing multiple Helm charts. It lets you define your entire application stack in a single file or organized directory structure.
Key Benefits
- Declarative Configuration: Define your entire stack in version-controlled files
- Environment Management: Deploy to multiple environments with different values
- Template Support: Use Go templating for dynamic values
- Dependency Management: Handle relationships between different charts
- Release Ordering: Control the sequence of deployments
Getting Started with Helmfile
Install Helmfile:
Create a helmfile.yaml:
|
|
Apply your configuration:
Helmfile brings GitOps best practices to your Helm deployments, making it easier to manage complex applications across multiple environments.
9. Security Scanning with Trivy
What is Trivy for Helm?
Trivy is a comprehensive security scanner that can analyze Helm charts for vulnerabilities and misconfigurations. It identifies security issues before deployment, helping you maintain a strong security posture in your Kubernetes environments.
Key Benefits
- Comprehensive Security Scanning: Detects vulnerabilities and misconfigurations in Helm charts
- Built-in Policies: Includes security policies based on industry best practices
- Custom Policy Support: Define your own security policies with Rego
- CI/CD Integration: Seamlessly integrates with popular CI/CD platforms
- Wide Detection Scope: Scans for issues in templates, values, and container images referenced in charts
Getting Started with Trivy
Install Trivy:
|
|
Scan a Helm chart:
By incorporating Trivy into your Helm workflow, you can catch security issues early in the development lifecycle, reducing the risk of deploying vulnerable applications to production.
Conclusion
In this article, we’ve explored the essential plugins and features that can transform your Helm deployments into production-ready, robust and easy-to-maintain solutions. By including these tools in your workflow, you can create a sustainable approach to Kubernetes application management that is secure, testable and well-documented.
The right combination of these tools will depend on your specific needs, but together they provide a comprehensive toolkit for the professional development and deployment of Helm charts. As your Kubernetes infrastructure grows, these tools will help you maintain the quality and reliability of all your applications.
Originally published in AWS Morocco on Medium, where people are continuing the conversation by highlighting and responding to this story.