Skip to content
Skillpedia
Deploy & cloud (DevOps)48k Β· #5020

kustomize

What it does

Kustomize is a tool that helps customize Kubernetes configuration files without using complicated templates. It allows you to modify existing configurations or create new versions from a base.

When to use it

  • βœ“When you need to manage Kubernetes configurations for different environments (development, production).
  • βœ“When you want to make small changes to configuration files without altering them directly.
  • βœ“When you need to create configuration variations from a base set.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/kustomize/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/kustomize/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHow can I adjust my application's configuration for the production environment, changing the image and the number of replicas?”

5 new skills a week. 1 minute to read.

How it works

Kustomize works by organizing your configuration files into a 'base' and 'overlays'. The overlays take the base and apply specific modifications for each environment, such as changing the number of copies or the image name.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Kustomize

Customize Kubernetes resources declaratively without templating.

When to Use This Skill

Use this skill when:

  • Managing Kubernetes configs across environments
  • Patching existing manifests without modification
  • Creating configuration variants from bases
  • Customizing third-party manifests
  • Preferring declarative over templating approach

Prerequisites

  • kubectl 1.14+ (includes kustomize)
  • Or standalone kustomize CLI
  • Basic Kubernetes manifest knowledge

Directory Structure

myapp/
β”œβ”€β”€ base/
β”‚   β”œβ”€β”€ kustomization.yaml
β”‚   β”œβ”€β”€ deployment.yaml
β”‚   β”œβ”€β”€ service.yaml
β”‚   └── configmap.yaml
└── overlays/
    β”œβ”€β”€ development/
    β”‚   β”œβ”€β”€ kustomization.yaml
    β”‚   └── replica-patch.yaml
    β”œβ”€β”€ staging/
    β”‚   β”œβ”€β”€ kustomization.yaml
    β”‚   └── namespace.yaml
    └── production/
        β”œβ”€β”€ kustomization.yaml
        β”œβ”€β”€ replica-patch.yaml
        └── resource-patch.yaml

Base Configuration

kustomization.yaml

# base/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - deployment.yaml
  - service.yaml
  - configmap.yaml

commonLabels:
  app: myapp
  
commonAnnotations:
  managed-by: kustomize

Base Resources

# base/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: myapp
        image: myapp:latest
        ports:
        - containerPort: 8080
        resources:
          requests:
            memory: "64Mi"
            cpu: "100m"
          limits:
            memory: "128Mi"
            cpu: "200m"

Overlays

Development Overlay

# overlays/development/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - ../../base

namespace: myapp-dev

namePrefix: dev-

commonLabels:
  environment: development

images:
  - name: myapp
    newTag: dev-latest

Production Overlay

# overlays/production/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - ../../base

namespace: myapp-prod

namePrefix: prod-

commonLabels:
  environment: production

replicas:
  - name: myapp
    count: 5

images:
  - name: myapp
    newName: registry.example.com/myapp
    newTag: v2.0.0

patches:
  - path: resource-patch.yaml

Patching

Strategic Merge Patch

# overlays/production/resource-patch.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
spec:
  template:
    spec:
      containers:
      - name: myapp
        resources:
          requests:
            memory: "256Mi"
            cpu: "500m"
          limits:
            memory: "512Mi"
            cpu: "1000m"

JSON Patch

# kustomization.yaml
patches:
  - target:
      kind: Deployment
      name: myapp
    patch: |-
      - op: replace
        path: /spec/replicas
        value: 5
      - op: add
        path: /spec/template/spec/containers/0/env
        value:
          - name: LOG_LEVEL
            value: info

Inline Patches

# kustomization.yaml
patches:
  - patch: |-
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: myapp
      spec:
        replicas: 3
    target:
      kind: Deployment
      name: myapp

Configuration Generation

ConfigMap Generator

# kustomization.yaml
configMapGenerator:
  - name: myapp-config
    literals:
      - APP_ENV=production
      - LOG_LEVEL=info
    files:
      - config.yaml
    envs:
      - config.env
    options:
      disableNameSuffixHash: false

Secret Generator

# kustomization.yaml
secretGenerator:
  - name: myapp-secrets
    literals:
      - api-key=secret123
    files:
      - tls.crt
      - tls.key
    type: kubernetes.io/tls

Image Transformations

# kustomization.yaml
images:
  # Change tag
  - name: myapp
    newTag: v2.0.0
  
  # Change registry
  - name: myapp
    newName: registry.example.com/myapp
    newTag: v2.0.0
  
  # Use digest
  - name: myapp
    digest: sha256:abc123...

Resource Transformations

Name Prefix/Suffix

# kustomization.yaml
namePrefix: prod-
nameSuffix: -v2

Namespace

# kustomization.yaml
namespace: production

Labels and Annotations

# kustomization.yaml
commonLabels:

…
FAQ

What is a Kubernetes 'manifest'?

A manifest is a text file (usually YAML) that describes how Kubernetes resources (like applications, databases) should be configured and run.

What's the difference between Kustomize and using templating?

Templates use programming languages to generate configurations, which can be complex. Kustomize is declarative, meaning you describe the desired final state without needing programming logic.

Do I need to know how to code to use Kustomize?

You don't need to know how to code, but it's helpful to have a basic understanding of how Kubernetes configuration files work.

Details

Original description by the author

Customize Kubernetes manifests without templating using Kustomize.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#5020
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills