• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Kubernetes | kubectl get
  1. kubectl get
  2. Usage
  3. Options
  4. Examples

  1. kubectl get
    Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you will only see results in your current namespace unless you pass --all-namespaces.

    Uninitialized objects are not shown unless --include-uninitialized is passed.

    By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.

    To list kubectl get supported resources, type: kubectl api-resources

    To list kubectl get options, type: kubectl get --help

    To print the list of kubectl global command-line options (applies to all commands), type: kubectl options
  2. Usage
    Usage: kubectl get [(-o|--output=) format] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags] [options]
  3. Options
  4. Examples
    List all pods:

    List all pods with more information (such as ip address, node name, ...):

    List a single pod in JSON output format:

    List a pod identified by type and name specified in "pod.yaml" in JSON output format:

    List deployments in JSON output format, in the "v1" version of the "apps" API group:

    Return only the phase value of the specified pod:

    List resource information in custom columns:

    List all pods and services together:

    List one or more resources by their types and names:
© 2025  mtitek