How to Deploy the Application automatically using Argo CD

FoxuTech
2 min readJul 16, 2022

--

Back to Argo CD…!! So far on Argo CD we have see how to create the deploy Argo CD and create the application manually. In this post let’s see how we can automate the Argo CD application creation. We all aware of and also seen in previous post Argo CD makes pull based GitOps deployment. In sort it simply listens to the repo and apply the manifest files to the cluster. Same will be applied here, we can keep all the configuration in repo including its internals, Rest will be taken care by Argo CD.

In this post will see couple of application created automatically from github.

Prerequisites:

Let’s create sample deployments

Before we created the Argo CD Applications, lets create the basic deployment, let’s create the sample deployments with nginx. I have followed the folder structure, argocd/example/app-of-app in my repository and inside that have create two applications.

Here the sample deployments for your reference.

Webapp-1:

apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp-1
labels:
app: webapp-1
spec:
replicas: 3
selector:
matchLabels:
app: webapp-1
template:
metadata:
labels:
app: webapp-1
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80

Webapp-2:

apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp-2
labels:
app: webapp-2
spec:
replicas: 3
selector:
matchLabels:
app: webapp-2
template:
metadata:
labels:
app: webapp-2
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80

We are good with our deployment, now we should create Argo CD Applications pointing to this deployment Manifests.

Argo CD can be configured in three different ways: using the GUI, using the CLI, or using Kubernetes Manifest files. In previous post we have seen first two options, now let’s see third method.

Create the following Manifest files in a new folder argocd/test-apps. This is test-apps/webapp-1.yml:

Continue reading on https://foxutech.com/how-to-create-the-application-automatically-using-argo-cd/

YouTube: Check the complete demo on or only related to this article can referred from 17:00 minute.

You can follow us on social media, to get some short knowledges regularly.

--

--

FoxuTech
FoxuTech

Written by FoxuTech

Discuss about #Linux, #DevOps, #Docker, #kubernetes, #HowTo’s, #cloud & IT technologies like #argocd #crossplane #azure https://foxutech.com/

No responses yet