List resources in overlay

Quickly list all resource kinds in a kustomize build

kustomize build ./overlays/prod | grep "^kind:"

tool
kustomize23 commands
tags
kustomizek8sresources

More kustomize commands

  • # Add patchesStrategicMerge in kustomization.yaml

    Use patchesStrategicMerge to partially override base resources

  • cat > patch.yaml <<EOF apiVersion: apps/v1 kind: Deployment metadata: name: myapp spec: replicas: 3 template: spec: containers: - name: myapp resources: limits: memory: 512Mi EOF echo 'patches:\n- path: patch.yaml' >> kustomization.yaml

    Create a strategic merge patch and register it in kustomization.yaml

  • kustomize build --enable-helm ./overlay

    Render helmCharts: block to manifests; note: needs helm in PATH

  • cat <<'EOF' >> kustomization.yaml components: - ../../components/monitoring EOF

    Mixin reusable patches/resources via components: (Kustomize v4+)

  • cat <<'EOF' >> kustomization.yaml replacements: - source: {kind: ConfigMap, name: cfg, fieldPath: data.host} targets: - select: {kind: Deployment} fieldPaths: [spec.template.spec.containers.0.env.0.value] EOF

    modern: replacements: copies a field cross-resource, replaces deprecated vars:

all 23 kustomize commands