Skip to content

utrains/argocd-app-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 

Repository files navigation

Prerequisites:

  • Have AWS CLI and eksctl installed
  • Have an AWS account with sufficient IAM permissions to create clusters, IAM roles, and EBS volumes
  • Have kubectl installed and configured for Kubernetes operations

Create your EKS cluster in AWS

To create the EKS cluster for this lab, use the following commands:

1. Set up a directory for cluster configuration:
mkdir eksctl-argo-project
cd eksctl-argo-project

2. Verify your AWS identity:
aws sts get-caller-identity

3. Create an EKS cluster:
eksctl create cluster --name utrains-eksctl-cluster --region us-east-1 --nodegroup-name my-nodes --node-type t3.medium --nodes 2 --nodes-min 1 --nodes-max 2

4- Update the kubeconfig for the new cluster:
aws eks --region us-east-1 update-kubeconfig --name utrains-eksctl-cluster

5- Verify Cluster Nodes:
kubectl get nodes

Install and start Argo CD in a Kubernetes cluster

# install ArgoCD in k8s cluster

# create a namespace for argo CD
kubectl create namespace argocd

# install argo CD on the created namespace
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# check the pods created
kubectl get pods -n argocd

# check the services
kubectl get svc -n argocd

# Change the argocd-server service type to LoadBalancer
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'

# Show services and Copy the dns name of Loadbalancer from argocd-server service
kubectl get svc -n argocd

# get the password to connect to the admin account
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

# Connect on the Argo UI with username: admin and the password generated by the below command

# you can change and delete init password

Create an application in Argo-CD using a YAML file

  1. Clone the git repository: git clone https://github.com/utrains/argocd-app-config.git
  2. Create the application by applying the application.yaml file in argocd namespace: kubectl apply -f application.yaml -n argocd
  3. Open the Argo CD UI to see all the resources. Navigate through them to see their specifications.

Exercise:

Make the following actions on the deployment file to see how Argo CD update the deployment to match the repo state:

  1. Change the deployment name
  2. Change the container image to nginx:stable-alpine-perl
  3. change the number of replicas to 4
  4. Modify the service name

Delete resources

After successfully done this lab, you must delete all the resources created to avoid charges:

1. Delete the Argo CD application:
kubectl delete -f application.yaml -n argocd

2. Delete all resources inside argocd namespace:
kubectl delete all --all -n argocd

3. Delete argocd and myapp namespaces:
kubectl delete namespace argocd
kubectl delete namespace myapp

4. Delete the EKS cluster:
eksctl delete cluster --name utrains-eksctl-cluster


Links to Official Documentation of Argo CD:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published