Skip to content

loicalbertin/ocm-argocd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Cluster Management + Argo CD experiments

This repository contains experiment materials to setup an Argo CD cluster that can use OCM to place applications to target clusters.

Setup an infrastructure

We provide 2 infrastructures to deploy OCM and Argo:

  • using kind to run it on your computer
  • using GKE clusters

Setup using kind

kind is a tool for running local Kubernetes clusters using Docker.

This setup will create a 3 single-node kind clusters:

  • hub: contains the OCM hub and Argo CD server
  • cluster1 and cluster2: are OCM managed clusters and are used as deploy environments by Argo

The following binaries should be present in our path for setting up this infrastructure:

Then you can run the setup_with_kind.sh to install the infrastructure. If you need some proxies to access internet you should export your proxy settings before running the command:

export http_proxy="..."
export https_proxy="..."
export no_proxy="127.0.0.1,172.17.0.1(,...)"
./setup_with_kind.sh

Setup using GKE

GKE is a Google Cloud managed Kubernetes engine. You need a Google Cloud account to use this installation method.

In addition, the following binaries should be present in our path for setting up this infrastructure:

Then you can run the setup_with_gke.sh to install the infrastructure. If you need some proxies to access internet you should export your proxy settings before running the command:

export http_proxy="..."
export https_proxy="..."
./setup_with_gke.sh

Deploy the demo application

Now we will first deploy a placement policy that in our case will request to deploy the application on both cluster1 and cluster2. And then we will deploy the actual application using an ApplicationSet (a kind of application template).

You can follow the deployment in the Argo UI.

CONTEXT_HUB="$(kubectl config get-contexts -o name | grep hub)"
# Deploy a placement policy
kubectl -n argocd  --context "${CONTEXT_HUB}"  apply --wait -f ./manifests/placement.yaml
# Deploy the app
kubectl -n argocd  --context "${CONTEXT_HUB}"  apply --wait -f ./manifests/argocd_application_set.yaml

Cleanup

Cleanup for kind

Simply run the following command to delete kind clusters:

kind delete clusters hub cluster1 cluster2

Cleanup for GKE

Simply run the following command to delete GKE clusters:

gcloud container clusters delete ocm-hub ocm-mcluster1 ocm-mcluster2 --region=europe-west1-b

About

Experiment on OCM + Argo CD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages