Kubernetes
k9s
Kubernetes Services
DevOps
Cloud Computing

How to list kubernetes services in k9s?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

In k9s, listing Kubernetes services is mostly about knowing the resource alias and how namespace scope works. Once you understand those two ideas, finding services is fast: you can jump straight to the service view, switch namespaces, and inspect service details without repeatedly typing long kubectl commands.

Basic Command Inside k9s

After starting k9s, type the service resource alias at the command prompt.

text
:svc

or, depending on your setup and alias support:

text
:services

That opens the service list for the current namespace. From there, the table becomes your starting point for almost every service-related inspection task in k9s, including port review and namespace-aware navigation.

Start k9s in the Right Context First

k9s reads your current Kubernetes context. If the wrong cluster or namespace is active, the service list will be misleading even though the command itself is correct.

A typical workflow is:

bash
kubectl config current-context
k9s

Then inside k9s, confirm the visible namespace and context in the header before assuming the service list is complete.

List Services Across Namespaces

If you want to view services outside the current namespace, either switch namespaces or enable all-namespaces mode.

Inside k9s, a common pattern is:

text
:all-ns
:svc

This gives you a cluster-wide service view. That is useful when you do not remember which namespace owns a service or when you are debugging cross-namespace traffic.

Filter the List Quickly

Once the service list is open, you can type / and filter by name.

text
/checkout

This is much faster than scanning a long table manually, especially in clusters with many services.

What You Can Read from the Service View

The service table usually shows important fields such as:

  • service name
  • namespace
  • type, such as ClusterIP, NodePort, or LoadBalancer
  • cluster IP
  • exposed ports
  • age

That makes k9s useful not just for listing services, but for answering quick operational questions such as “is this a NodePort service?” or “what port is exposed?”

Drill into a Specific Service

After selecting a service in the list, you can inspect details and related resources. Exact key bindings may vary with version, but the normal workflow is to highlight the row and use the action keys shown in the k9s help footer.

This is where k9s becomes more useful than a plain one-line list: you can navigate interactively rather than reissuing multiple kubectl get commands.

When kubectl Is Still Better

k9s is excellent for navigation, but the terminal remains better for scripted output or precise automation.

bash
kubectl get svc -A

Use k9s for fast exploration and manual operations. Use kubectl when you need stable machine-readable output or want to pipe the result into other tools.

Common Pitfalls

A common mistake is typing :svc and assuming the result is cluster-wide when k9s is still scoped to one namespace. Another is forgetting that k9s follows the active kubeconfig context, so the services shown may belong to a different cluster than expected. Developers also sometimes search for a service by eye instead of using / filtering, which makes large clusters feel harder to navigate than they really are.

Summary

  • In k9s, use :svc or :services to list services.
  • The current context and namespace determine what you see.
  • Use all-namespaces mode when you need a cluster-wide service view.
  • Filter with / to find a service quickly.
  • 'k9s is great for interactive service inspection, while kubectl remains better for scripted output.'

Course illustration
Course illustration

All Rights Reserved.