Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

448
Vistas
Listing Pods with name and field selector

I need to list down all the pods with status complete and with given name.

user@host:~$ kubectl get pods
NAME                             READY     STATUS    RESTARTS   AGE
App1-something                    1/1       Running   570        2d
App2-something                    1/1       completed 597        2d
App3-something                    1/1       completed 570        2d
App4-something                    1/1       Running   597        2d

Using Field Selector i can list completed pods, but not able to find the correct command to list down required pod with specific name

Something to get below output

App3-something                    1/1       completed 570        2d

kubectl get pod --field-selector=status.phase==Succeeded and pod name is App3-something

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You can use comma to add multiple conditions like --field-selector=metadata.name=app3-something,,status.phase=Succeeded.

kubectl get pod --field-selector=metadata.name=App3-something,status.phase=Completed  

Reference: https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/

--

C:\>kubectl get pods
NAME             READY   STATUS    RESTARTS   AGE
app1-something   1/1     Running   0          62s
app2-something   1/1     Running   0          56s
app3-something   1/1     Running   0          52s

C:\>kubectl get pod --field-selector=metadata.name=app3-something,,status.phase=Running
NAME             READY   STATUS    RESTARTS   AGE
app3-something   1/1     Running   0          57s
over 4 years ago · Santiago Trujillo Denunciar

0

Use grep on the output of the kubectl command:

kubectl get pod --field-selector=status.phase==Succeeded | grep -n 'App3-something'
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda