How to use the command `argocd` (with examples)

How to use the command `argocd` (with examples)

The argocd command-line interface is used to control an Argo CD server. It provides various subcommands, such as argocd app, which have their own usage documentation. This article will showcase two common use cases of the argocd command, including logging in to the Argo CD server and listing applications.

Use case 1: Login to Argo CD server

Code:

argocd login --insecure --username user --password password argocd_server:port

Motivation: The argocd login command is used to authenticate and establish a session with the Argo CD server. By logging in, you gain access to the server’s resources and can perform various actions.

Explanation:

  • --insecure: This flag is used to disable SSL certificate verification. It is commonly used in development environments where self-signed certificates are used.
  • --username user: This option specifies the username to be used for authentication.
  • --password password: This option specifies the password corresponding to the provided username.
  • argocd_server:port: This argument specifies the address and port of the Argo CD server.

Example output:

INFO[0000] 'user' logged in successfully

Use case 2: List applications

Code:

argocd app list

Motivation: The argocd app list command allows you to retrieve a list of applications managed by the Argo CD server. This is useful to get an overview of the deployed applications and their current states.

Explanation: The argocd app list command does not require any additional arguments or options. It simply fetches the list of applications from the Argo CD server and displays them in the console.

Example output:

NAME            CLUSTER         NAMESPACE       PROJECT         STATUS      HEALTH   SYNCPOLICY
my-app          my-cluster      default         my-project      Synced      Healthy  Auto
another-app     my-cluster      default         another-project Synced      Healthy  Manual

Conclusion:

The argocd command-line interface provides a convenient way to control an Argo CD server. By using the argocd login command, you can authenticate and establish a session with the server. Furthermore, the argocd app list command allows you to retrieve a list of applications managed by the server. With these functionalities, you can effectively manage and monitor your applications deployed through Argo CD.

Related Posts

How to use the command pbmlife (with examples)

How to use the command pbmlife (with examples)

The pbmlife command applies Conway’s Rules of Life to a PBM (Portable Bitmap) image.

Read More
How to use the command xonsh (with examples)

How to use the command xonsh (with examples)

Xonsh is a Python-powered, cross-platform, Unix-gazing shell. It allows users to write and mix sh/Python code in the Xonsh shell, providing a powerful and flexible environment for shell scripting and interactive shell sessions.

Read More
How to use the command xclip (with examples)

How to use the command xclip (with examples)

The command xclip is a tool for manipulating the clipboard in the X11 window system.

Read More