Skip to content

ArgoCD

Documentation

Install

  • Quick Install (Non HA)
Bash
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
  • Proper Install (Kustomize)

Create folder argocd and add files

  • kustomization.yaml
YAML
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - https://raw.githubusercontent.com/argoproj/argo-cd/v2.8.0/manifests/install.yaml

## changes to config maps
patchesStrategicMerge:
  - argocd-cmd-params-cm-patch.yaml
  - argocd-cm-patch.yaml
  - argocd-server-clusterrole-patch.yaml

namespace: argocd
  • argocd/argocd-cmd-params-cm-patch.yaml
YAML
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cmd-params-cm
#data:
#  server.insecure: "true"
  • argocd-cm-patch.yaml
YAML
# Enabling Terminal
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
data:
  exec.enabled: "true"
  exec.shells: bash,ash,sh
  • argocd-server-clusterrole-patch.yaml
Bash
# Allow Terminal to exec in web
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: argocd-server
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - delete
  - get
  - patch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - list
- apiGroups:
  - ""
  resources:
  - pods
  - pods/log
  verbs:
  - get
- apiGroups:
  - argoproj.io
  resources:
  - applications
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - pods/exec
  verbs:
  - create
Bash
kubectl apply -k argocd

ArgoCD as App using argocd 💀

YAML
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: argocd-arrr
  namespace: argocd
spec:
  project: default

  source:
    repoURL: [email protected]:urgitrepo/argocd.git
    targetRevision: HEAD
    path: your/git/path
  destination:
    server: https://kubernetes.default.svc
    namespace: default

  syncPolicy:
    syncOptions:
    - CreateNamespace=true

    automated:
      selfHeal: true
      prune: true