Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created January 24, 2021 23:58
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save vfarcic/764b402c8979678dfde01fd8f63c22e2 to your computer and use it in GitHub Desktop.
Save vfarcic/764b402c8979678dfde01fd8f63c22e2 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/764b402c8979678dfde01fd8f63c22e2
###########################################################
# Kustomize vs Helm #
# The Fight Between Templating and Patching in Kubernetes #
# https://youtu.be/ZMFYSm0ldQ0 #
###########################################################
# Links to referenced videos:
# - https://youtu.be/sUPkGChvD54
#########
# Setup #
#########
minikube start
minikube addons enable ingress
git clone https://github.com/vfarcic/helm-vs-kustomize.git
cd helm-vs-kustomize
#########################
# Defining applications #
#########################
# Helm
cat helm/templates/ingress.yaml
# Kustomize
cat kustomize/base/ingress.yaml
# Helm
cat helm/values.yaml
# Kustomize
cat kustomize/base/kustomization.yaml
# Helm
helm upgrade --install \
devops-toolkit helm \
--namespace helm-dev \
--create-namespace
# Kustomize
kubectl create namespace kustomize-dev
# Kustomize
kustomize build \
kustomize/base \
| kubectl --namespace kustomize-dev \
apply --filename -
#############################################
# Defining environment-specific application #
#############################################
# Helm
cat helm/values-production.yaml
# Kustomize
cat kustomize/overlays/production/kustomization.yaml
# Kustomize
cat kustomize/overlays/production/ingress-patch.yaml
# Helm
helm upgrade --install \
devops-toolkit helm \
--namespace helm-production \
--create-namespace \
--values helm/values-production.yaml
# Kustomize
kustomize build \
kustomize/overlays/production \
| kubectl apply --filename -
#####################################
# Applying unplanned customizations #
#####################################
# Helm
vim helm/values.yaml
# Helm
cat snippets/deployment-resources.yaml
# Helm
vim helm/templates/deployment.yaml
# Kustomize
cat kustomize/overlays/production/deployment-patch.yaml
# Kustomize
vim kustomize/overlays/production/kustomization.yaml
# Helm
vim helm/values-production.yaml
@maocorte
Copy link

maocorte commented Feb 4, 2021

why not using kubectl apply -k kustomize/base instead of kustomize build kustomize/base | kubectl apply --filename - ?
are not the same thing?
anyway many thanks all the stuff you share to us!

@vfarcic
Copy link
Author

vfarcic commented Feb 4, 2021

They are not the same. kustomize is currently v3.x while kubectl -k uses Kustomize v2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment