---
title: "Kustomize: configurazione Kubernetes dichiarativa senza template"
description: "Kustomize 1.0 (luglio 2018) di Google (Jeff Regan, Phillip Wittrock): template-free customization di manifest Kubernetes con patch, overlay, base. Destinato all'integrazione in kubectl. Alternativa a Helm per configurazione."
url: "https://www.noze.it/insights/kustomize-1-0/"
lang: "it"
alternate: "https://www.noze.it/en/insights/kustomize-1-0/"
published: "2018-10-15"
author: "noze S.r.l."
keywords: "Open Source, Kustomize, Kubernetes, Google, Configuration, kubectl"
---

# Kustomize: configurazione Kubernetes dichiarativa senza template

Kustomize 1.0 (luglio 2018) di Google (Jeff Regan, Phillip Wittrock): template-free customization di manifest Kubernetes con patch, overlay, base. Destinato all'integrazione in kubectl. Alternativa a Helm per configurazione.

15 ottobre 2018

## Template o non template?

Gestire configurazioni Kubernetes multi-environment (dev/staging/prod) richiede trasformazioni di YAML. Due filosofie:

- **Template-based** — Helm usa Go templates con `{{ .Values.foo }}`: potente ma inquina YAML
- **Template-free** — manifest sempre-valid YAML, modifiche tramite **patch** e **overlay**

Kustomize segue la seconda strada.

## Il rilascio

**Kustomize** è sviluppato in **Google** da **Jeff Regan** e **Phillip Wittrock**. Il primo ramo **1.0.x** è pubblicato a **metà 2018** (la 1.0.8 è del 30 settembre 2018). Scritto in **Go**, licenza **Apache 2.0**. Sottoprogetto **SIG-CLI** di Kubernetes. L’integrazione nativa in `kubectl apply -k ./` è attesa in una prossima release di kubectl.

## Struttura

```
base/
  kustomization.yaml
  deployment.yaml
  service.yaml
overlays/
  dev/
    kustomization.yaml
    replica-patch.yaml
  prod/
    kustomization.yaml
    replica-patch.yaml
    ingress.yaml
```

`kustomization.yaml` in ogni overlay eredita la `base/` e applica trasformazioni.

```
# overlays/prod/kustomization.yaml
bases:
  - ../../base
namespace: production
patches:
  - replica-patch.yaml
images:
  - name: app
    newTag: v2.1.0
configMapGenerator:
  - name: app-config
    envs: [config.env]
```

## Feature

- **Patches strategic merge** — patch YAML con semantica K8s
- **JSON 6902 patches** — modifiche puntuali RFC-standard
- **Common labels/annotations** — aggiunti a tutte le risorse
- **Namespace prefix/suffix** — per multi-tenant
- **ConfigMap/Secret generator** — da file o literal
- **Image tags override** — per deploy release
- **Component** (più recenti) — moduli riusabili

## Integrazione

- **kubectl** — `kubectl apply -k` nativo
- **ArgoCD** — supporto kustomize first-class
- **Flux CD** — Kustomization CRD è il meccanismo primario
- **Helm + Kustomize** — render Helm, kustomize patch on top (pattern “post-render”)

## Kustomize vs Helm

|                       | Kustomize | Helm                        |
| --------------------- | --------- | --------------------------- |
| Template              | No        | Sì (Go templates)           |
| YAML sempre valido    | Sì        | No (mixed template)         |
| Distribuzione package | No        | Sì (chart repository)       |
| Release management    | No        | Sì (helm upgrade, rollback) |
| Complessità logic     | Bassa     | Alta                        |

In pratica coesistono: Helm per distribuire software di terzi (cert-manager, Prometheus), Kustomize per configurazione interna dei team.

## Nel contesto italiano

Kustomize inizia a diffondersi nei cluster Kubernetes italiani per scenari multi-environment (dev/test/prod) e multi-tenant, grazie alla leggibilità dei manifest sempre validi.

Aggiornamento — 2024

Kustomize è integrato nativamente in **kubectl 1.14** (marzo 2019) come `kubectl apply -k ./`. L’adozione cresce rapidamente con **ArgoCD** e **Flux CD** (Kustomization CRD è il meccanismo primario), diventando standard per pipeline GitOps. Nei team italiani è diffuso in PA digitale (PSN), banking, telco per configurazioni versionate in Git.

---

_Riferimenti: Kustomize ramo 1.0 (2018, 1.0.8 del 30 settembre 2018). Google (SIG-CLI Kubernetes). Jeff Regan, Phillip Wittrock. Licenza Apache 2.0._
