link icon replaced

This commit is contained in:
govardhan
2025-06-19 14:09:10 +05:30
parent 60adbde60c
commit 172f8e2b34
158 changed files with 996 additions and 996 deletions

View File

@ -1,11 +1,11 @@
GitOps with Argo CD on CloudFerro Cloud Kubernetes[](#gitops-with-argo-cd-on-brand-name-kubernetes "Permalink to this headline")
GitOps with Argo CD on CloudFerro Cloud Kubernetes[🔗](#gitops-with-argo-cd-on-brand-name-kubernetes "Permalink to this headline")
=================================================================================================================================
Argo CD is a continuous deployment tool for Kubernetes, designed with GitOps and Infrastructure as Code (IaC) principles in mind. It automatically ensures that the state of applications deployed on a Kubernetes cluster is always in sync with a dedicated Git repository where we define such desired state.
In this article we will demonstrate installing Argo CD on a Kubernetes cluster and deploying an application using this tool.
What We Are Going To Cover[](#what-we-are-going-to-cover "Permalink to this headline")
What We Are Going To Cover[🔗](#what-we-are-going-to-cover "Permalink to this headline")
---------------------------------------------------------------------------------------
> * Install Argo CD
@ -14,7 +14,7 @@ What We Are Going To Cover[](#what-we-are-going-to-cover "Permalink to this h
> * Create and deploy Argo CD application resource
> * View the deployed resources
Prerequisites[](#prerequisites "Permalink to this headline")
Prerequisites[🔗](#prerequisites "Permalink to this headline")
-------------------------------------------------------------
No. 1 **Account**
@ -47,7 +47,7 @@ No. 7 **Access to exemplary Flask application**
You should have access to the [example Flask application](https://github.com/CloudFerro/K8s-samples/tree/main/Flask-K8s-deployment), to be downloaded from GitHub in the article. It will serve as an example of a minimal application and by changing it, we will demonstrate that Argo CD is capturing those changes in a continual manner.
Step 1 Install Argo CD[](#step-1-install-argo-cd "Permalink to this headline")
Step 1 Install Argo CD[🔗](#step-1-install-argo-cd "Permalink to this headline")
-------------------------------------------------------------------------------
Lets install Argo CD first, under the following assumptions:
@ -74,7 +74,7 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/st
```
Step 2 Access Argo CD from your browser[](#step-2-access-argo-cd-from-your-browser "Permalink to this headline")
Step 2 Access Argo CD from your browser[🔗](#step-2-access-argo-cd-from-your-browser "Permalink to this headline")
-----------------------------------------------------------------------------------------------------------------
The Argo CD web application by default is not accessible from the browser. To enable this, change the applicable service from **ClusterIP** to **LoadBalancer** type with the command:
@ -110,7 +110,7 @@ After typing in your credentials to the login form, you get transferred to the f
![image-2024-5-14_15-34-0.png](../_images/image-2024-5-14_15-34-0.png)
Step 3 Create a Git repository[](#step-3-create-a-git-repository "Permalink to this headline")
Step 3 Create a Git repository[🔗](#step-3-create-a-git-repository "Permalink to this headline")
-----------------------------------------------------------------------------------------------
You need to create a git repository first. The state of the application on your Kubernetes cluster will be synced to the state of this repo. It is recommended that it is a separate repository from your application code, to avoid triggering the CI pipelines whenever we change the configuration.
@ -123,7 +123,7 @@ Create the repository first, we call ours **argocd-sample**. While filling in th
In that view, project URL will be pre-filled and corresponding to the URL of your GitLab instance. In the place denoted with a blue rectangle, you should enter your user name; usually, it will be **root** but can be anything else. If there already are some users defined in GitLab, their names will appear in a drop-down menu.
Step 4 Download Flask application[](#step-4-download-flask-application "Permalink to this headline")
Step 4 Download Flask application[🔗](#step-4-download-flask-application "Permalink to this headline")
-----------------------------------------------------------------------------------------------------
The next goal is to download two yaml files to a folder called **ArgoCD-sample** and its subfolder **deployment**.
@ -146,7 +146,7 @@ rm K8s-samples/ -rf
Files **deployment.yaml** and **service.yaml** deploy a sample Flask application on Kubernetes and expose it as a service. These are typical minimal examples for deployment and service and can be obtained from the CloudFerro Kubernetes samples repository.
Step 5 Push your app deployment configurations[](#step-5-push-your-app-deployment-configurations "Permalink to this headline")
Step 5 Push your app deployment configurations[🔗](#step-5-push-your-app-deployment-configurations "Permalink to this headline")
-------------------------------------------------------------------------------------------------------------------------------
Then you need to upload files **deployment.yaml** and **service.yaml** files to the remote repository. Since you are using git, you perform the upload by *syncing* your local repo with the remote. First initiate the repo locally, then push the files to your remote with the following commands (replace to your own git repository instance):
@ -165,7 +165,7 @@ As a result, at this point, we have the two files available in remote repository
![image-2024-5-17_11-20-27.png](../_images/image-2024-5-17_11-20-27.png)
Step 6 Create Argo CD application resource[](#step-6-create-argo-cd-application-resource "Permalink to this headline")
Step 6 Create Argo CD application resource[🔗](#step-6-create-argo-cd-application-resource "Permalink to this headline")
-----------------------------------------------------------------------------------------------------------------------
Argo CD configuration for a specific application is defined using an application custom resource. Such resource connects a Kubernetes cluster with a repository where deployment configurations are stored.
@ -227,7 +227,7 @@ spec.destination.server
spec.destination.namespace
: The namespace in the cluster where the application will be deployed.
Step 7 Deploy Argo CD application[](#step-7-deploy-argo-cd-application "Permalink to this headline")
Step 7 Deploy Argo CD application[🔗](#step-7-deploy-argo-cd-application "Permalink to this headline")
-----------------------------------------------------------------------------------------------------
After we created the **application.yaml** file, the next step is to commit it and push to the remote repo. We can do this with the following commands:
@ -246,7 +246,7 @@ kubectl apply -f application.yaml
```
Step 8 View the deployed resources[](#step-8-view-the-deployed-resources "Permalink to this headline")
Step 8 View the deployed resources[🔗](#step-8-view-the-deployed-resources "Permalink to this headline")
-------------------------------------------------------------------------------------------------------
After performing the steps above, switch views to the Argo CD UI. We can see that our application appears on the list of applications and that the state to be applied on the cluster was properly captured from the Git repo. It will take a few minutes to complete the deployment of resources on the cluster:
@ -263,7 +263,7 @@ After clicking on the applications box, we can also see the details of all th
With the default settings, Argo CD will poll the Git repository every 3 minutes to capture the desired state of the cluster. If any changes in the repo are detected, the applications on the cluster will be automatically relaunched with the new configuration applied.
What To Do Next[](#what-to-do-next "Permalink to this headline")
What To Do Next[🔗](#what-to-do-next "Permalink to this headline")
-----------------------------------------------------------------
* test applying changes to the deployment in the repository (e.g. commit a deployment with different image in the container spec), verify ArgoCD capturing the change and changing the cluster state