ArgoCD for Continuous Delivery/Deployment

ArgoCD for Continuous Delivery/Deployment

Introduction:

ArgoCD is a powerful continuous delivery tool that allows you to deploy the applications and configurations to Kubernetes clusters with ease. Here we will go through the steps to install and configure ArgoCD in an Amazon Web Services (AWS) Elastic Kubernetes Service (EKS) cluster.

Prerequisites:

1.An AWS EKS cluster should be set up and in the running state.

2.kubectl installed and configured to connect to the EKS cluster.

3.Helm 3 installed.

Why Argo CD?

It allows the teams to achieve?GitOps, which has the following principles:

1.Automated Deployment: ArgoCD automates the deployment process of applications, ensuring that the Kubernetes cluster is always up-to-date with the latest changes in your Git repository.

2.Rollbacks and Revisions: ArgoCD supports rollbacks and revisions, allowing you to quickly and easily revert to a previous version of your application in case of issues or errors.

3.Monitoring: ArgoCD provides built-in monitoring and alerting capabilities, making it easier to keep track of the health and status of the applications.

Flow diagram:

Complete CI/CD flow, CI with jenkins and CD with Argo:

2.ArgoCD configuration for the deployment for custom Applications:

Refer: https://artifacthub.io/packages/helm/argo/argo-cd

Open the link and Click on Install.

Steps:

1.Add helm repository:

>helm repo add argo https://argoproj.github.io/argo-helm

2.Install/pull, download the helm chart:

>mkdir argo

>cd argo

helm chart creation for custom installation

>helm pull argo/argo-cd --version 5.50.1 ??

Extract it:

>tar -zxvf? argo-cd-5.50.1.tgzx??

?Updates in values.yaml file as below for customization:

ingress:
    enabled: true
    className: "nginx"
    annotations: {}
    hosts:
      - argocd.edshopper.com        

values.yaml

nginx:
  deployment:
    name: nginx
    image:
      name: nginx
      tag: 1.25
    replicas: 1
    port: 80

prometheus:
  replicaCount: 1
  image:
    repository: prom/prometheus
    pullPolicy: IfNotPresent
    tag: "latest"
  imagePullSecrets: []
  nameOverride: ""
  fullnameOverride: ""
  serviceAccount:
    create: true
    annotations: {}
    name: ""
  podAnnotations: {}
  podSecurityContext: {}
  securityContext: {}
  service:
    type: NodePort
    port: 9090
  ingress:
    enabled: true
    className: "nginx"
    annotations: {}
    hosts:
      - host: argocd.edshopper.com
      
        paths:
          - path: /
            pathType: ImplementationSpecific
    tls: []
  resources: {}
  autoscaling:
    enabled: false
    minReplicas: 1
    maxReplicas: 100
    targetCPUUtilizationPercentage: 80
  nodeSelector: {}
  tolerations: {}
  affinity: {}

grafana:
  replicaCount: 1
  image:
    repository: grafana/grafana
    pullPolicy: IfNotPresent
    tag: "latest"
  imagePullSecrets: []
  nameOverride: ""
  fullnameOverride: ""
  serviceAccount:
    create: true
    annotations: {}
    name: ""
  podAnnotations: {}
  podSecurityContext: {}
  securityContext: {}
  service:
    type: NodePort
    port: 3000
  ingress:
    enabled: true
    className: "nginx"
    annotations: {}
    hosts:  
      - host: argocd.edshopper.com
        paths:
          - path: /
            pathType: ImplementationSpecific
    tls: []
  resources:
    limits:
      cpu: 100m
      memory: 128Mi
    requests:
      cpu: 100m
      memory: 128Mi
  autoscaling:
    enabled: false
    minReplicas: 1
    maxReplicas: 100
    targetCPUUtilizationPercentage: 80
  nodeSelector: {}
  tolerations: {}
  affinity: {}        

install Argocd:

$ helm install argocd -f values.yaml . ?-n argocd --create-namespace

Resolute the argocd server endpoint in Route53 for external access.

As cname records.

$ kubectl get ingress -n argocd ?????:to get the server endpoint to resolute in Route53.

Configure the Port forward for external access:

$ kubectl port-forward service/argocd-server –n argocd 8080:443

Get the default PW for Argocd login:

Default User name:? Admin

Get the default PW from the below cmd for argo login home page:

$ kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath =”{.data.password}” | base64 -d

Settings in ArgoCD:

Settings----Repositories----connect repo

To inter-connect ArgoCD with BitBucket follow the below config:

Go to BitBucket and create a Repo: "Argo-k8s-demo"? to store the helm charts,

Create an App password to connect with BitBucket.

Go to ArgoCD-----Connect Repo---

Do the below settings in ArgoCD-----enter the data to access the Repo

Connection Method: https

Git

Project: default

Provide Bit Bucket Repo URL ?of Repo and test the connection

User Name: Bit Bucket username

PW: BB login PW.

Test the Connectivity with BB/Git

Create an Application by using manifest file.

Create a namespace: dev

$ kubectl create ns dev

"The environment name where the application would deployed is specified in argo-app manifest file as defined below"

Create the argo-app.yaml:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: eos
  namespace: argocd
spec:
  project: default
  source: 
    repoURL: git clone https://xyz@bitbucket.org/edwikieos/eos-platform-repo.git
    targetRevision: HEAD    #master branch
    path: eos/nginx
    helm:
      valueFiles:
        - values.yaml
destination:                 # where to deplooy application
  server: https://kubernetes.default.svc    # since Argo & kubernetes cluster are running in same cluster
  namespace: dev

syncPolicy: 
  syncOptions:
  - CreateNamespace=true

   automated:
     selfHeal: true
    prune: true        

Deploy the application:

$ kubectl apply -f argo-app.yaml

Go to Argo app and verify app deployment:

Push the helm chart to BitBucket Repository for the deployment in kubernetes:

whenever the developer push the helm chart to Git/Bit Bucket Repository Argo get triggered and automatically deploy to the kubernetes.








要查看或添加评论,请登录

Vijay Poojary的更多文章

  • The Science of Mutual Funds: Interpreting Technical Data for Better Returns.

    The Science of Mutual Funds: Interpreting Technical Data for Better Returns.

    Mutual funds are investment vehicles that pool money from multiple investors to invest in a diversified portfolio of…

  • Unlocking the Benefits: Advantages of Being Fit and Active

    Unlocking the Benefits: Advantages of Being Fit and Active

    In today's fast-paced world, prioritizing a fit and active lifestyle is more important than ever. From physical…

  • Unlocking the Power of ChatGPT: Exploring Its Advantages.

    Unlocking the Power of ChatGPT: Exploring Its Advantages.

    In the age of advanced technology and artificial intelligence, ChatGPT emerges as a revolutionary tool, offering a…

  • EKS Cluster Node Autoscaling-Karpenter

    EKS Cluster Node Autoscaling-Karpenter

    What is AWS Karpenter? Karpenter is an open-source, flexible, high-performance Kubernetes cluster autoscaler built with…

    1 条评论
  • EKS Cluster backup-Velero

    EKS Cluster backup-Velero

    1.Introduction: Kubernetes backup is the process of creating a copy of the Kubernetes resources and data to protect…

    1 条评论
  • Cloud Migration-Rehost(Lift & Shift)

    Cloud Migration-Rehost(Lift & Shift)

    Lift and shift ( Rehosting) Cloud Migration method: Also known as “rehosting,” is the process of migrating an exact…

    1 条评论
  • HELM Chart in Kubernetes

    HELM Chart in Kubernetes

    Helm chart Artefactoty deploy to store and resolution to download from Jfrog Helm definition: Helm is a Kubernetes…

  • A glance on Ansible

    A glance on Ansible

    What Is Ansible? It is an open source software that automates software provisioning, configuration management, and…

  • An Introduction to Kubernetes

    An Introduction to Kubernetes

    Architecture, working flow and an overview of Kubernetes components: Kubernetes is a portable, extensible, open source…

  • Monolythic vs Micro services Archetecture:

    Monolythic vs Micro services Archetecture:

    Monolithic architecture: All the services/software modules are bundled in single build and deployed to host machine. In…

社区洞察

其他会员也浏览了