GitOps is a mechanism to automate infrastructure for the DevOps and other specialized engineers. GitOps is mainly defined as "GitOps uses Git repositories as a single source of truth to deliver infrastructure as code."
~ ArgoCD ~ FluxCD ~ Code Fresh ~ Jenkins X
Go to: https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/
-
Start the minikube which starts the local Minikube Kubernetes cluster.
Use the below command:
minikube start
-
Use the below command to create the ArgoCD namespace:
kubectl create namespace argocd
-
Use the below command to install ArgoCD, a GitOps-based continuous delivery tool for Kubernetes, by applying the resource definitions provided in the specified YAML file to the argocd namespace in your Kubernetes cluster.
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- Let's check if the pods have come up using the below command:
`` kubectl get pods -n argocd -w
- argocd server interacts with the CLI. We are going to edit the file by using the below command. We are editing the service because by default it comes with the service type as ClusterIP mode and we want this to be NodePort mode so that we can access this service over the web browser.
kubectl edit svc argocd-server -n argocd
- We need port forwarding to access:
minikube service list -n argocd
- Minikube creates a tunnel and provides the Ip address as shown below using the cmd:
minikube service argocd-server -n argocd
-
We can access the ArgoCD on our browser using the IPs given by above command.
-
ArgoCD UI is up! Yay!
- Let's try to login now.
Now use the command to check the password prseent in the ArgoCD secret file. `` kubectl get secret -n argocd
kubectl edit secret argocd-initial-admin-secret -n argocd
Now get the password and then decrypt the secrets.
echo secret_password | base64 --decode
Now paste the password in the browser and we can login!
Lets try out some projects:
-
In Sync Policy, select Automatic so, ARgo CD automatically deploys the app.
-
Now ArgoCD is getting the application from the GitHub link that we have provided earlier. It will start fetching the configurations mentioned in guestbook-ui-deployment.yaml & guestbook-ui-svc.yaml
-
Run the command
kubectl get deploy
-
We can delete the resources that got created by clicking on the "Delete" button.
-
If we are not able to access the ArgoCD UI then all the steps can be performed by using ArgoCD CLI.
ArgoCD Architecture comprises of below components: ~ API Server (exposes the API consumed by the Web UI, CLI, and CI/CD systems) ~ Repository Server (connects to Git and fetches the state) ~ Application Controller (connects to K8s and fetches the state)
https://argo-cd.readthedocs.io/en/stable/
GitOps tools, ArgoCD, Architecture, Implementation