argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

Introduce `argocd app pods` command to display pod information

Open nitishfy opened this issue 6 months ago • 0 comments

Summary

Right now, there’s no easy way to see the IP addresses of pods using the ArgoCD CLI. This information is valuable for monitoring, and various operational tasks without requiring direct kubectl access to the cluster. The API call to You can call https://cd.apps.argoproj.io/swagger-ui#tag/ApplicationService/operation/ApplicationService_GetResource solves this problem. However, it would be a great addition to add this functionality wrapped into the CLI as well.

Motivation

https://github.com/argoproj/argo-cd/issues/22945

Proposal

Command Syntax

argocd app pods <APPNAME> [flags]

Example Usage

argocd app pods guestbook
argocd app pods guestbook -n dev
argocd app pods guestbook --output json
argocd app pods guestbook --watch

Flags

Flag | Type | Description
|       |    
-n, --namespace | string | Filter pods by a specific namespace. Defaults to the namespace(s) defined in the app spec.
-l, --selector | string | Label selector to filter pods.
-o, --output | string | Output format: wide, json, yaml (default: wide)

Output Format

Similar to kubectl get pods, but scoped to the application's live state

Wide Output (default)

NAME                       READY   STATUS    RESTARTS   AGE   NAMESPACE IP
guestbook-76f5b67c6f-l7ql7 1/1     Running   0          2d    dev      192.112....
redis-master-0            1/1     Running   0          2d    dev.      192.112...

When using the --output json|yaml, return raw pod data as serialized JSON/YAML.

nitishfy avatar May 29 '25 06:05 nitishfy