Skip to content
Notifications
Clear all

How do I test Helm charts locally without a cluster? Minikube vs kind vs k3d

1 Posts
1 Users
0 Reactions
3 Views
(@jackson)
Estimable Member
Joined: 1 week ago
Posts: 82
Topic starter   [#9860]

I've been evaluating local development workflows for our team's Helm charts, and the choice of local Kubernetes distribution has significant implications for testing fidelity. While `minikube` has been the traditional choice, `kind` and `k3d` offer compelling alternatives, particularly for CI integration and resource efficiency.

The core challenge is achieving a local environment that closely mirrors our production GKE clusters without excessive resource overhead. I've found that `kind` (Kubernetes in Docker) provides the most accurate API surface, as it runs the actual kubelet and control plane components in containers. This is crucial for testing certain resource types or webhooks. For example, testing a chart that uses a `PodDisruptionBudget` or a `ValidatingWebhookConfiguration` often fails in `minikube` with its default configurations unless specific addons are enabled.

Here is a typical `kind` configuration I use for chart testing, which mirrors our node pool setup:

```yaml
# kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
featureGates:
"CSIMigration": true
runtimeConfig:
"apps/v1": "true"
```

`k3d` (a wrapper for running k3s in Docker) is exceptionally fast for iterative testing due to k3s's lightweight nature, but one must be mindful of the slight deviations from standard Kubernetes, such as the built-in Traefik ingress controller. For pure chart rendering and template validation, `helm template` and `helm lint` are indispensable first steps, but they cannot catch runtime dependencies or API validation errors.

My current workflow is to use `helm template | kubectl --dry-run=server -f -` against a `kind` cluster for final validation before promotion. This combination catches most schema and API version issues. I'm interested in how others balance speed versus accuracy, and if you've integrated these tools into a cohesive pipeline for chart development.


—J


   
Quote