You must install and run the ArgoCD using a local Kubernetes (e.g. Docker for Desktop or Minikube) first. This will help you understand the application, but also get your local environment set-up.
Then, to get a good grounding in Go, try out the tutorial.
Install:
- docker
- git and git-lfs
- golang
- dep
- ksonnet
- helm
- kustomize
- kubectl
- kubectx
- minikube or Docker for Desktop
Brew users can quickly install the lot:
brew install go git-lfs kubectl kubectx dep ksonnet/tap/ks helm@2 kustomizeCheck the versions:
go version ;# must be v1.12.x
helm version ;# must be v2.13.x
kustomize version ;# must be v3.1.xSet up environment variables (e.g. is ~/.bashrc):
export GOPATH=~/go
export PATH=$PATH:$GOPATH/binCheckout the code:
go get -u github.com/argoproj/argo-cd
cd ~/go/src/github.com/argoproj/argo-cdEnsure dependencies are up to date first:
dep ensure
make dev-tools-image
make install-lint-tools
go get github.com/mattn/goreman
go get github.com/jstemmer/go-junit-reportCommon make targets:
make codegen- Run code generationmake lint- Lint codemake test- Run unit testsmake cli- Make theargocdCLI tool
Check out the following documentation for instructions on running the e2e tests.
It is much easier to run and debug if you run ArgoCD on your local machine than in the Kubernetes cluster.
You should scale the deployments to zero:
kubectl -n argocd scale deployment/argocd-application-controller --replicas 0
kubectl -n argocd scale deployment/argocd-dex-server --replicas 0
kubectl -n argocd scale deployment/argocd-repo-server --replicas 0
kubectl -n argocd scale deployment/argocd-server --replicas 0
kubectl -n argocd scale deployment/argocd-redis --replicas 0Download Yarn dependencies and Compile:
~/go/src/github.com/argoproj/argo-cd/ui
yarn install
yarn buildThen start the services:
cd ~/go/src/github.com/argoproj/argo-cd
make startYou can now execute argocd command against your locally running ArgoCD by appending --server localhost:8080 --plaintext --insecure, e.g.:
argocd app create guestbook --path guestbook --repo https://github.com/argoproj/argocd-example-apps.git --dest-server https://kubernetes.default.svc --dest-namespace default --server localhost:8080 --plaintext --insecureYou can open the UI: http://localhost:4000
As an alternative to using the above command line parameters each time you call argocd CLI, you can set the following environment variables:
export ARGOCD_SERVER=127.0.0.1:8080
export ARGOCD_OPTS="--plaintext --insecure"You may need to run containers locally, so here's how:
Create login to Docker Hub, then login.
docker loginAdd your username as the environment variable, e.g. to your ~/.bash_profile:
export IMAGE_NAMESPACE=alexcollinsintuitIf you don't want to use latest as the image's tag (the default), you can set it from the environment too:
export IMAGE_TAG=yourtagBuild the image:
DOCKER_PUSH=true make imageUpdate the manifests (be sure to do that from a shell that has above environment variables set)
make manifestsInstall the manifests:
kubectl -n argocd apply --force -f manifests/install.yamlScale your deployments up:
kubectl -n argocd scale deployment/argocd-application-controller --replicas 1
kubectl -n argocd scale deployment/argocd-dex-server --replicas 1
kubectl -n argocd scale deployment/argocd-repo-server --replicas 1
kubectl -n argocd scale deployment/argocd-server --replicas 1
kubectl -n argocd scale deployment/argocd-redis --replicas 1Now you can set-up the port-forwarding and open the UI or CLI.