Code Monkey home page Code Monkey logo

argocd-capi-demo's Introduction

Argo CD with Cluster API

This demos the ability to create Kubernetes clusters using Argo CD, Argo Workflows, Argo Events, and Cluster API.

diagram

Prerequisites

At a minimum you need

Create Managment Cluster

You need to create a KIND cluster that will be your management cluster. You first need to set up the configuration.

cat <<EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  extraMounts:
    - hostPath: /var/run/docker.sock
      containerPath: /var/run/docker.sock
EOF

Next, use this config to create your KIND cluster

kind create cluster --config=kind-config.yaml --name=manager

Once you see this output, you're good to go.

Creating cluster "manager" ...
 โœ“ Ensuring node image (kindest/node:v1.25.0) ๐Ÿ–ผ
 โœ“ Preparing nodes ๐Ÿ“ฆ  
 โœ“ Writing configuration ๐Ÿ“œ 
 โœ“ Starting control-plane ๐Ÿ•น๏ธ 
 โœ“ Installing CNI ๐Ÿ”Œ 
 โœ“ Installing StorageClass ๐Ÿ’พ 
Set kubectl context to "kind-manager"
You can now use your cluster with:

kubectl cluster-info --context kind-manager

Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community ๐Ÿ™‚

You should have a KIND cluster running

kind get clusters 

Initialize with CAPD

Initialize this cluster with the Docker Cluster API infrastructure provider.

export CLUSTER_TOPOLOGY=true
clusterctl init --infrastructure docker

Install Argo Components

Install Argo Components onto the management cluster

until kubectl apply -k https://github.com/christianh814/argocd-capi-demo/bootstrap/install/; do sleep 3; done

This installs the following

  • Argo CD
  • Argo Workflows
  • Argo Events

Open another terminal tab and run port-forward to get to the Argo CD UI.

kubectl port-forward -n argocd svc/argocd-server 8080:80

Extract the Argo CD password so you can login to the UI as the admin user

๐Ÿšจ NOTE For the purposes of this demo, don't change the Argo CD Admin password

kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d ; echo

Before deploying the argo components, make sure everything is up and running

kubectl rollout status -n argo-events $(kubectl get deployment -n argo-events -l eventsource-name=webhook -o name)
kubectl rollout status -n argo-events $(kubectl get deployment -n argo-events -l sensor-name=webhook -o name)
kubectl rollout status sts/argocd-application-controller -n argocd

Create the ApplicationSets

kubectl apply -k https://github.com/christianh814/argocd-capi-demo/apps/argo/overlays/default

SUCCESS

You should have (after a few minutes) two Kubernetes clusters running in KIND.

capi-argocd-image

Also, each one of these CAPI Clusters have a sample workload running on them.

workload-argocd-image

Running the following...

kind get clusters

Should now show that you have a management cluster and two CAPI Clusters.

cluster1
cluster2
manager

Cleanup

Just delete your KIND clusters

kind delete clusters --all

argocd-capi-demo's People

Contributors

christianh814 avatar

Watchers

 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.