So far, we have seen Argo CD with UI mostly and now let’s see another feature provided by Argo CD, which CLI to manage the Argo CD. CLI provides almost same feature as GUI, you can perform most of the operation done via UI using CLI. Let’s see more of the useful commands in this post.
Before starting, lets see how to install Argo CD CLI in different operating systems. You can download the latest Argo CD version from the latest release page of this repository, which will include the Argo CD CLI.
Linux
ArchLinux
# pacman -S argocd
Homebrew
# brew install argocd
Download With CurlDownload latest version
# curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
# chmod +x /usr/local/bin/argocd
Download selected version
Set VERSION replacing <TAG> in the command below with the version of Argo CD you would like to download:
# VERSION=<TAG>
Select desired TAG from https://github.com/argoproj/argo-cd/releases
# curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/$VERSION/argocd-linux-amd64
# chmod +x /usr/local/bin/argocd
Mac
# brew install argocdVERSION=$(curl --silent "https://api.github.com/repos/argoproj/argo-cd/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
Replace VERSION in the command below with the version of Argo CD you would like to download:
Windows
Download With PowerShell: Invoke-WebRequest
You can view the latest version of Argo CD at the link above or run the following command to grab the version:
$version = (Invoke-RestMethod https://api.github.com/repos/argoproj/argo-cd/releases/latest).tag_name
Replace $version in the command below with the version of Argo CD you would like to download:
$url = "https://github.com/argoproj/argo-cd/releases/download/" + $version + "/argocd-windows-amd64.exe"
$output = "argocd.exe"Invoke-WebRequest -Uri $url -OutFile $output
Also please note you will probably need to move the file into your PATH.
After finishing the instructions above, you should now be able to run argocd commands.
Prerequisites:
- Azure Kubernetes Service up and running, if you don’t have one, please follow the steps with terraform to create it. How to create Azure Kubernetes Service using Terraform — FoxuTech
- Kubectl installed in the VM or machine you are going to manage the AKS.
- Have a kubeconfig file (default location is ~/.kube/config).
- Argo CD setup. If not, available you can refer Setup ArgoCD on Azure Kubernetes Services — FoxuTech
Argo CD Commands:
For now, we have completed the installation and hope you have the argoCD up and running already. Now let’s check the available commands in Argo CD. As there are multiple commands, let’s see with serios of posts. Here is first set of commands,
Video Demo
Version:
To check the argo cd version detail please use following commands.
# argocd version [flags]
Print the full version of client and server to stdout
# argocd version
argocd: v2.3.4+ac8b7df
BuildDate: 2022-05-18T13:06:25Z
GitCommit: ac8b7df9467ffcc0920b826c62c4b603a7bfed24
GitTreeState: clean
GoVersion: go1.17.9
Compiler: gc
Platform: linux/amd64
argocd-server: v2.4.6+a48bca0
BuildDate: 2022-07-12T22:31:17Z
GitCommit: a48bca03c79b6d63be0c34d6094831bc6916b3bc
GitTreeState: clean
GoVersion: go1.18.3
Compiler: gc
Platform: linux/amd64
Kustomize Version: v4.4.1 2021-11-11T23:36:27Z
Helm Version: v3.8.1+g5cb9af4
Kubectl Version: v0.23.1
Jsonnet Version: v0.18.0
Note: To get the server version details, you should login to the argocd instance. otherwise the command will be hung endless. Please refer login section to login instance.
Print only full version of the client — no connection to server will be made
Continue Reading on Argo CD CLI Installation and Commands — FoxuTech
You can follow us on social media, to get some short knowledges regularly.
- Facebook: https://www.facebook.com/foxutech/
- Instagram: https://www.instagram.com/foxutech/
- YouTube: Foxutech
- Twitter: https://twitter.com/foxutech
- Medium: FoxuTech — Medium
- BuyMeCoffee: (buymeacoffee.com)