How to use argo-cd to deploy your service

Xiao Qiang Lv4

how to set up argo-cd-config

  • pre

  • defination

    • argo cd is a common CD tool for kubernates
  • steps

    • create a namespace in local k8s cluster by follow cmd:

      kubectl create namespace argocd

    • pull necessary resource to namespace

      kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

    • check argo cd resource

      kubectl get pods -n argocd
      result

    • how to see argocd UI

      kubectl get svc -n argocd
      result

      kubectl port-forward -n argocd svc/argocd-server 8080:443
      result

    • how to login argo ci ui

      kubectl get secret argocd-initial-admin-secret -n argocd -o yaml

      "apiVersion": "v1",
      "data": {
          "password": "QXp0TnVWZWVra1NSa3Jxdw=="
      },
      "kind": "Secret",
      "metadata": {
          "creationTimestamp": "2021-12-20T14:17:16Z",
          "managedFields": [
              {
                  "apiVersion": "v1",
                  "fieldsType": "FieldsV1",
                  "fieldsV1": {
                      "f:data": {
                          ".": {},
                          "f:password": {}
                      },
                      "f:type": {}
                  },
                  "manager": "argocd-server",
                  "operation": "Update",
                  "time": "2021-12-20T14:17:16Z"
              }
          ],
          "name": "argocd-initial-admin-secret",
          "namespace": "argocd",
          "resourceVersion": "3856",
          "selfLink": "/api/v1/namespaces/argocd/secrets/argocd-initial-admin-secret",
          "uid": "0d60128c-7140-429e-89e9-6fe59ae9e86d"
      },
      "type": "Opaque"}
      
    • decode pwd by base64

      echo QXp0TnVWZWVra1NSa3Jxdw== | base64 --decode

    • how to make the argo cd config work

      kubectl apply -f application.yaml
      result

noted

  • if your repository is not a public repo, it will need to be public or config authorization
  • must use the stable manifest for argocd install.yaml

    • kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
    • issue: cannot async
  • syncOptions: - CreateNameSpace=true

not use,
cannot create a namespace automatically.

argocd

  • Title: How to use argo-cd to deploy your service
  • Author: Xiao Qiang
  • Created at : 2023-03-05 14:56:21
  • Updated at : 2025-03-08 10:49:30
  • Link: http://fdslk.github.io/tech/ops/CD/2023/03/05/ops-argocd/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
How to use argo-cd to deploy your service