Created
February 21, 2021 00:50
-
-
Save vfarcic/09f94e7713488ddc2dfc063cbab41485 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## | |
# Ketch # | |
# How to Simplify Kubernetes Deployments # | |
# https://youtu.be/sMOIiTfGnj0 # | |
########################################## | |
######### | |
# Setup # | |
######### | |
# Requirements: | |
# - `ketch` CLI (https://github.com/shipa-corp/ketch/releases) | |
# - A Kubernetes cluster with Istio | |
# - Environment variable `ISTIO_HOST` | |
kubectl apply \ | |
--filename https://github.com/jetstack/cert-manager/releases/download/v1.0.3/cert-manager.yaml \ | |
--validate=false | |
echo "apiVersion: cert-manager.io/v1 | |
kind: ClusterIssuer | |
metadata: | |
name: le | |
spec: | |
acme: | |
server: https://acme-v02.api.letsencrypt.org/directory | |
privateKeySecretRef: | |
name: my-account-key | |
solvers: | |
- http01: | |
ingress: | |
class: istio" \ | |
| kubectl apply --filename - | |
kubectl apply \ | |
--filename https://github.com/shipa-corp/ketch/releases/download/v0.2.0/ketch-controller.yaml | |
####################### | |
# Managing node pools # | |
####################### | |
ketch pool add staging \ | |
--namespace staging \ | |
--ingress-service-endpoint $ISTIO_HOST \ | |
--ingress-type istio | |
ketch pool add production \ | |
--namespace production \ | |
--ingress-service-endpoint $ISTIO_HOST \ | |
--ingress-type istio | |
ketch pool list | |
kubectl get namespaces | |
######################### | |
# Creating applications # | |
######################### | |
ketch app create devops-toolkit-staging \ | |
--pool staging | |
ketch app create devops-toolkit \ | |
--pool production | |
########################## | |
# Deploying applications # | |
########################## | |
ketch app deploy --help | |
ketch app deploy devops-toolkit-staging \ | |
--image vfarcic/devops-toolkit-series:2.9.10 | |
ketch app list | |
ketch app info devops-toolkit-staging | |
kubectl --namespace staging get all | |
helm list -A | |
################################################## | |
# Scaling, upgrading, and promoting applications # | |
################################################## | |
ketch unit add 2 \ | |
--app devops-toolkit-staging | |
ketch app deploy devops-toolkit-staging \ | |
--image vfarcic/devops-toolkit-series:2.9.18 | |
ketch app log devops-toolkit-staging | |
ketch app deploy devops-toolkit \ | |
--image vfarcic/devops-toolkit-series:2.9.18 | |
######################### | |
# Removing applications # | |
######################### | |
ketch app remove devops-toolkit-staging | |
ketch app remove devops-toolkit | |
# Destroy the cluster |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment