Refer Doc:
Using Azure Devops CI CD Code For AKS:-
https://github.com/shivscloud/azure-devops-aks/tree/main
https://github.com/mabusaa/argocd-course-issues-tracker/blob/main/slides.pdf
AKS login to the AKS Cluster
az aks get-credentials --resource-group rajesh-aks-deploy --name dev-rajesh-aks
What is GitOps:-
GitOps is a methodology for implementing and managing cloud-native infrastructure and applications. It leverages Git as a single source of truth for declarative infrastructure and application code. The core idea of GitOps is to use Git repositories as the canonical source for defining and versioning the desired state of the entire system, including infrastructure configuration, application code, and deployment manifests.
Key principles of GitOps include:
Declarative Configuration: Infrastructure and application configuration are declared in a human-readable format (e.g., YAML) and stored in Git repositories. This declarative approach defines the desired state of the system rather than relying on imperative scripts or commands.
Version Control: Git repositories serve as a version-controlled history of changes to infrastructure and application code. This enables easy rollback to previous configurations, auditability, and collaboration among team members.
Continuous Delivery: Changes to the Git repository trigger automated workflows for deployment and reconciliation of the actual state of the system with the desired state. Continuous integration/continuous delivery (CI/CD) pipelines automate the deployment process based on changes to the Git repository.
Observability and Control: GitOps platforms typically provide monitoring and observability tools to track the state of the system in real-time. Operators have full visibility into changes, deployments, and system health. GitOps also emphasizes the importance of applying Git-based access controls to manage who can make changes to the system.
Self-Healing and Reconciliation: GitOps systems continuously monitor the actual state of the system and automatically reconcile any deviations from the desired state. If the actual state diverges from the desired state due to manual changes or external factors, the system automatically applies the necessary corrections to bring the system back to the desired state.
By adopting GitOps practices, organizations can achieve greater reliability, repeatability, and scalability in managing their cloud-native infrastructure and applications. GitOps simplifies deployment workflows, enhances collaboration among development and operations teams, and promotes a culture of automation and continuous improvement. Popular tools for implementing GitOps include ArgoCD, Flux, and Jenkins X.
Why GitOPS:
Easy rollbacks:
If bad version got deployed we can revert using git revert.
GitOps follows pull model:ArgoCD is the GitOps based CD tool with pull model design.(When ever changes happen in git will apply in destination i.e K8)
It will track your manifest versions.ArgoCD is not CI tool we have CI tools like azuredevops,GitLAB & Github actions
It support
Application Controller: ArgoCD's application controller is responsible for reconciling the desired state of applications defined in Git repositories with the actual state of applications running in Kubernetes clusters. It continuously monitors the Git repositories for changes and applies those changes to the target clusters, ensuring that the applications are deployed and configured correctly. It will define source and destination deploy group of k8 resource
Project : It will provide logical grouping of applications
Application CRDs: ArgoCD uses Custom Resource Definitions (CRDs) to define applications and their associated configuration in Kubernetes. Users define applications as custom resources (e.g.,
Application
orAppProject
) in YAML format, specifying details such as the Git repository URL, target cluster, sync policy, and other parameters.API Server: ArgoCD provides an API server that exposes RESTful endpoints for managing applications, repositories, and other resources. The API server allows users to interact with ArgoCD programmatically via HTTP requests, enabling automation and integration with other tools and systems.
Web UI: ArgoCD includes a web-based user interface (UI) that provides a graphical interface for managing applications and clusters. The UI allows users to view the status of applications, compare the desired and actual states, trigger manual syncs, view logs, and perform other administrative tasks.
CLI Tool: In addition to the web UI, ArgoCD provides a command-line interface (CLI) tool (
argocd
) for interacting with the ArgoCD API and performing administrative tasks from the command line. The CLI tool allows users to manage applications, repositories, clusters, and other resources using simple commands.Repository Server: ArgoCD includes a repository server component that manages Git repositories containing application manifests and configuration files. The repository server periodically polls Git repositories for changes and synchronizes them with the internal state of ArgoCD, triggering application deployments as needed.
Health Monitoring and Metrics: ArgoCD includes built-in health monitoring and metrics collection capabilities to track the health and performance of the system. Metrics such as application sync status, repository sync status, and resource utilization are exposed via Prometheus-compatible endpoints for monitoring and alerting purposes.
These core components work together to enable continuous delivery of applications to Kubernetes clusters using Git as the source of truth. ArgoCD automates the deployment and configuration of applications, enforces desired state management, and provides visibility and control over the deployment process.
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
0 Comments