Deploy an Nginx application in civo cloud using argocd .
Introduction:
Argocd: Argocd is GitOps continuous delivery tool and it is a declarative type.
Lens IDE: Lens IDE for Kubernetes, The system you'll ever need to take control of your Kubernetes clusters. It's open source and free Increased visibility, real-time statistics, log streams, and hands-on troubleshooting capabilities.
In this article, we discuss deploying an Nginx application in civo cloud using a continuous delivery tool based on GitOps principles and we use Lens IDE.
Step1:Create a Kubernetes cluster in civo cloud.
Create a Kubernetes cluster in civo web UI and while creating the cluster u can add Argocd to be installed from the marketplace option.
Download the config file and add it to lens IDE File->Add cluster.
connect to the cluster now you can control your Kubernetes cluster from lens IDE.
Step2:setup source-code in github
github.com/krishnarayapudi25/argo-cd.git.
U can create a manifest file by using Lens IDE.
.
As of now we create the Deployment file and Service file and push them to GitHub as a source for our application.
Deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
name: nginx
Service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: nginx
name: nginx
namespace: argocd
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: LoadBalancer
Step3:Argocd
Now u have argocd installed in your Kubernetes cluster. Argocd is an application based on GitOps.
Now we can access the application using an external IP address and port forward or using lens IDE u can forward it to the local host.
Login to Argocd username: admin and initial password can be found in lens IDE in Config->argocd-initial-admin-secret.
select new app
on the top left corner and fill in the details like the name of the application
Click on create if it is out of sync, sync the application.
Now u can find the external IP address of the Nginx application and have access to it.
It's done!!