Giter Site home page Giter Site logo

rahmanuk / kubecon-2024-eu-argocon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gitops-bridge-dev/kubecon-2024-eu-argocon

0.0 0.0 0.0 1.58 MB

Migrating to Karpenter

License: Apache License 2.0

Shell 2.00% Python 44.32% Smarty 3.65% HCL 49.43% Dockerfile 0.60%

kubecon-2024-eu-argocon's Introduction

Live Migration from Node-AutocScaler to Karpenter with Argo-Workflows

Using Argo Workflows for live migration from CNCF Cluster AutoScaler to CNCF Karpenter

Slides: Migrate-to-Karpenter-Argo-Workflows.pdf

Watch the video on youtube: https://youtu.be/rq57liGu0H4 Watch the video

Run the Demo

Tools:

Terminal: Terraform

cd terraform/
terraform init
terraform apply

Review the output and run

export KUBECONFIG="/tmp/argocon-1"
aws eks --region us-east-2 update-kubeconfig --name argocon-1
kubectl get pods -A

Terminal: Any new terminal run this command to setup kubectl config

export KUBECONFIG="/tmp/argocon-1"

Terminal: Port forward argocd

export KUBECONFIG="/tmp/argocon-1"
echo "ArgoCD Username: admin"
echo "ArgoCD Password: $(kubectl get secrets argocd-initial-admin-secret -n argocd --template="{{index .data.password | base64decode}}")"
echo "ArgoCD URL: http://localhost:8080"
kubectl port-forward -n argocd svc/argo-cd-argocd-server 8080:80

Terminal: Port forward argo-workflows New shell

export KUBECONFIG="/tmp/argocon-1"
echo "http://localhost:8081"
kubectl port-forward -n argo-workflows svc/argo-workflows-server 8081:2746

Terminal: List Node Group nodes New shell

export KUBECONFIG="/tmp/argocon-1"
eks-node-viewer --kubeconfig /tmp/argocon-1 -node-selector eks.amazonaws.com/nodegroup  -disable-pricing

Terminal: List Karpenter nodes New shell

export KUBECONFIG="/tmp/argocon-1"
eks-node-viewer -kubeconfig /tmp/argocon-1 -node-selector karpenter.sh/nodepool -disable-pricing

Delete Demo

cd terraform
./destroy.sh

Workflows

Migrate workloads from nodegroup to karpenter (mode=karpenter)

  1. Take as input the nodegroup name team-a-12345
  2. Check if nodepool is present with nodegroup name if it is then stop
  3. Generate karpenter nodeclass and nodepool, otherwise skip
  4. Apply karpenter resources via apply or gitops (ie. ArgoCD)
  5. Scale down nodegroup

Migrate workloads from karpenter to nodegroups (mode=nodegroup)

  1. Take as input the nodegroup name team-a-12345
  2. Check if there is a karpenter nodepool with nodegroup name, otherwise stop
  3. Scale up nodgroup
  4. Remove nodepool with nodegroup name to cordon, drain, and delete all pods
  5. Remove nodeclass with nodegroup name

Listing Node from Node Group

To get all the nodes created by a node group

watch kubectl get nodes -l eks.amazonaws.com/nodegroup

To get all the nodes created by a node group and used by team-1

watch kubectl get nodes -l eks.amazonaws.com/nodegroup,team=team-1

Listing Node from Karpenter Node Pool

To get all the nodes created by a node group

watch kubectl get nodes -l karpenter.sh/nodepool

To get all the nodes created by a node group and used by team-1

watch kubectl get nodes -l karpenter.sh/nodepool,team=team-1

Smoke test for argo-workflows:

argo submit -n argo-workflows --serviceaccount argo-workflow https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/hello-world.yaml

argo list -n argo-workflows

argo logs @latest -n argo-workflows

TODOs:

GitOps:

  • save karpenters in gitops repo for argocd to sync

Argo Workflows

  • save the original value for min,desire,max in nodegorup tags instead of karpenter
  • multicluster support (handle multiple kubeconfigs)

Terraform:

  • rename appset cluster-addons to bootstrap

kubecon-2024-eu-argocon's People

Contributors

csantanapr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.