V
VidyaSV
Installation of Argo CD
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. It allows you to define the desired state of your applications using Kubernetes manifests and synchronize them with your cluster automatically. Argo CD also provides a web UI and a CLI to monitor and manage your deployments.
To install Argo CD on Azure, you need to have the following prerequisites:
- An Azure subscription and an active Azure account
- An Azure Kubernetes Service (AKS) cluster with at least two nodes and RBAC enabled
- The Azure CLI and the kubectl command-line tool installed on your local machine
- The Helm package manager installed on your local machine
The installation steps are as follows:
- Create an AKS cluster, with following settings –
- Login to respective subscription where we have the AKS cluster created with the below command
Az account set –subscription <subscription-id>
- Install ArgoCD within in cluster
A Kubernetes namespace provides the scope for Pods, Services, and Deployments within the cluster. This ensures that users working within one namespace cannot see the contents of another namespace. In a Kubernetes cluster, namespaces help partition resources and isolate workloads, acting as virtual clusters within a physical cluster. This enables multiple teams or projects to operate independently.
Install Argo CD within the cluster:
- Create a namespace for Argo CD:
kubectl create namespace argocd
- Install Argo CD in the created namespace:
kubectl apply -n argocd -f URL à [URL]https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- Argo CD resources have been created. To check the status of the pods, use the following command:
kubectl get pods -n argocd
Argo CD will monitor the Git repository for any changes. If changes are detected, Argo CD will automatically update the GitOps tool. These changes will be reflected in the Kubernetes cluster.
To log in to the Argo CD platform, follow these steps:
- Retrieve the secrets:
kubectl get secrets -n argocd
- A secret is an object that stores sensitive information, such as the credentials that pods use to access services.
kubectl edit secret argocd-initial-admin-secret -n argocd
- Find the password in the argocd-initial-admin-secret file.
- Decrypt the password
echo <secret> | base64 -d
Base64 is an encoding and decoding technique used to convert binary data to an ASCII text format, and vice versa.
- Use the admin password to access the Argo CD UI.
- Retrieve the service information:
kubectl get svc -n argocd
A Service is an abstraction that represents a logical set of Pods and a policy for accessing them. Each Pod has a unique IP address, which is not exposed outside the cluster without a Service.
Edit the Argo CD server service:
kubectl edit svc argocd-server -n argocd
-
- ClusterIP: Used for Pod-to-Pod communication within the same Kubernetes cluster.
- NodePort and LoadBalancer Services: Used for communication between applications within the cluster and external clients outside the cluster.
- Save the changes and run the service command again:
kubectl get svc -n argocd
The NodePort has been changed.
- Get the NodePort IP address:
kubectl get nodes -o wide
- Retrieve the NodePort external IP address.
- IP address: 171.177.146.175
- Port No: 31419
- If accessing 171.177.146.175: 31419 does not work, allow the port in Azure Security Group:
- Go to the VMSS → Instances → Networking → Add inbound rules → Add Port
Refer to the site Getting Started - Argo CD - Declarative GitOps CD for Kubernetes for further information
Continue reading...