Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active September 5, 2022 16:48
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save vfarcic/f11e690295311d8d7dd53b5128bd6d3e to your computer and use it in GitHub Desktop.
Save vfarcic/f11e690295311d8d7dd53b5128bd6d3e to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/f11e690295311d8d7dd53b5128bd6d3e
#####################################
# Tekton vs. Argo Workflows #
# Kubernetes-Native CI/CD Pipelines #
# https://youtu.be/dAUpAq7hfeA #
#####################################
# Referenced videos:
# - Tekton - Kubernetes Cloud-Native CI/CD Pipelines And Workflows: https://youtu.be/7mvrpxz_BfE
# - Argo Workflows and Pipelines - CI/CD, Machine Learning, and Other Kubernetes Workflows: https://youtu.be/UMaivwrAyTA
# - Argo Events - Event-Based Dependency Manager for Kubernetes: https://youtu.be/sUPkGChvD54
# - Automation of Everything - How To Combine Argo Events, Workflows & Pipelines, CD, and Rollouts: https://youtu.be/XNXJtxkUKeY
# - Kustomize - How to Simplify Kubernetes Configuration Management: https://youtu.be/Twtbg6LFnAg
# - GitHub CLI - How to manage repositories more efficiently: https://youtu.be/BII6ZY2Rnlc
# - Kaniko - Building Container Images In Kubernetes Without Docker: https://youtu.be/EgwVQN6GNJg
#########
# Setup #
#########
# Create a k8s cluster
# Watch https://youtu.be/BII6ZY2Rnlc if you are not familiar with GitHub CLI
gh repo fork vfarcic/argo-workflows-vs-tekton-demo \
--clone
cd argo-workflows-vs-tekton-demo
export REGISTRY_SERVER=https://index.docker.io/v1/
# Replace `[...]` with the registry username
export REGISTRY_USER=[...]
# Replace `[...]` with the registry password
export REGISTRY_PASS=[...]
# Replace `[...]` with the registry email
export REGISTRY_EMAIL=[...]
cat argo-workflows-pipeline.yaml \
| sed -e "s@vfarcic/devops-toolkit@$REGISTRY_USER/devops-toolkit@g" \
| tee argo-workflows-pipeline.yaml
cat tekton-pipeline.yaml \
| sed -e "s@vfarcic/devops-toolkit@$REGISTRY_USER/devops-toolkit@g" \
| tee tekton-pipeline.yaml
cat kustomize/base/deployment.yaml \
| sed -e "s@vfarcic/devops-toolkit@$REGISTRY_USER/devops-toolkit@g" \
| tee kustomize/base/deployment.yaml
git add .
git commit -m "Changed the registry user"
git push
kubectl create namespace staging
kubectl create namespace production
########################
# Setup Argo Workflows #
########################
# Watch https://youtu.be/Twtbg6LFnAg if you are not familiar with Kustomize
kustomize build \
argo-workflows/overlays/production \
| kubectl apply --filename -
# You might need to repeat the previous command if the output contains `unable to recognize` errors.
kubectl --namespace workflows \
create secret \
docker-registry regcred \
--docker-server $REGISTRY_SERVER \
--docker-username $REGISTRY_USER \
--docker-password $REGISTRY_PASS \
--docker-email $REGISTRY_EMAIL
################
# Setup Tekton #
################
kustomize build \
tekton/overlays/production \
| kubectl apply --filename -
# You might need to repeat the previous command if the output contains `unable to recognize` errors.
kubectl --namespace tekton-builds \
create secret \
docker-registry regcred \
--docker-server $REGISTRY_SERVER \
--docker-username $REGISTRY_USER \
--docker-password $REGISTRY_PASS \
--docker-email $REGISTRY_EMAIL
#############
# Templates #
#############
# Argo Workflows
cat argo-workflows/overlays/workflows/templates.yaml
# Tekton
cat tekton/overlays/builds/tasks.yaml
#############
# Pipelines #
#############
# Argo Workflows
cat argo-workflows-pipeline.yaml
# Tekton
cat tekton-pipeline.yaml
# Argo Workflows
argo --namespace workflows submit \
argo-workflows-pipeline.yaml
# Tekton
kubectl apply \
--filename tekton-pipeline.yaml
# Tekton
cat tekton-run.yaml
# Tekton
kubectl create --filename tekton-run.yaml
# Argo Workflows
argo --namespace workflows list
# Tekton
tkn --namespace tekton-builds \
pipelinerun list
# Argo Workflows
argo --namespace workflows \
get @latest
# Tekton
tkn --namespace tekton-builds \
pipelinerun describe --last
# Argo Workflows
argo --namespace workflows \
logs @latest --follow
# Tekton
tkn --namespace tekton-builds \
pipelinerun logs --last --follow
##########
# Web UI #
##########
# Argo Workflows
argo server
# Tekton
kubectl --namespace tekton-pipelines \
port-forward svc/tekton-dashboard \
9097:9097
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment