helm_charthelm_releasehelm_templatehelm_template_renderedhelm_valuekubernetes_cluster_rolekubernetes_cluster_role_bindingkubernetes_config_mapkubernetes_cronjobkubernetes_custom_resource_definitionkubernetes_daemonsetkubernetes_deploymentkubernetes_endpointkubernetes_endpoint_slicekubernetes_eventkubernetes_horizontal_pod_autoscalerkubernetes_ingresskubernetes_jobkubernetes_limit_rangekubernetes_namespacekubernetes_network_policykubernetes_nodekubernetes_persistent_volumekubernetes_persistent_volume_claimkubernetes_podkubernetes_pod_disruption_budgetkubernetes_pod_security_policykubernetes_pod_templatekubernetes_replicasetkubernetes_replication_controllerkubernetes_resource_quotakubernetes_rolekubernetes_role_bindingkubernetes_secretkubernetes_servicekubernetes_service_accountkubernetes_stateful_setkubernetes_storage_classkubernetes_{custom_resource_singular_name}
Table: kubernetes_pod
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
A Pod is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers.
Examples
Basic Info
select namespace, name, phase, age(current_timestamp, creation_timestamp), pod_ip, node_name, jsonb_array_length(containers) as container_count, jsonb_array_length(init_containers) as init_container_count, jsonb_array_length(ephemeral_containers) as ephemeral_container_countfrom kubernetes_podorder by namespace, name;
List Unowned (Naked) Pods
select name, namespace, phase, pod_ip, node_namefrom kubernetes_podwhere owner_references is null;
List Privileged Containers
select name as pod_name, namespace, phase, jsonb_pretty(owner_references) as owners, c ->> 'name' as container_name, c ->> 'image' as container_imagefrom kubernetes_pod, jsonb_array_elements(containers) as cwhere c -> 'securityContext' ->> 'privileged' = 'true';
List Pods with access to the host process ID, IPC, or network namespace
select name, namespace, phase, host_pid, host_ipc, host_network, jsonb_pretty(owner_references) as ownersfrom kubernetes_podwhere host_pid or host_ipc or host_network;
Container Statuses
select namespace, name as pod_name, phase, cs ->> 'name' as container_name, cs ->> 'image' as image, cs ->> 'ready' as ready, cs_state as state, cs ->> 'started' as started, cs ->> 'restartCount' as restartsfrom kubernetes_pod, jsonb_array_elements(container_statuses) as cs, jsonb_object_keys(cs -> 'state') as cs_stateorder by namespace, name, container_name;
kubectl get pods
columns
select namespace, name, phase, count(cs) filter ( where cs -> 'state' -> 'running' is not null ) as running_container_count, jsonb_array_length(containers) as container_count, age(current_timestamp, creation_timestamp), COALESCE(sum((cs ->> 'restartCount') :: int), 0) as restarts, pod_ip, node_namefrom kubernetes_pod left join jsonb_array_elements(container_statuses) as cs on truegroup by namespace, name, phase, containers, creation_timestamp, pod_ip, node_nameorder by namespace, name;
List manifest resources
select namespace, name, phase, pod_ip, node_name, jsonb_array_length(containers) as container_count, jsonb_array_length(init_containers) as init_container_count, jsonb_array_length(ephemeral_containers) as ephemeral_container_count, pathfrom kubernetes_podwhere path is not nullorder by namespace, name;
Query examples
- cluster_containers_count
- cluster_pods_count
- configmaps_for_container
- configmaps_for_pod
- container_allow_privilege_escalation
- container_allow_privilege_escalation_count
- container_by_context
- container_by_context_name
- container_by_namespace
- container_by_pod
- container_count
- container_immutable_root_filesystem
- container_immutable_root_filesystem_count
- container_input
- container_liveness_probe
- container_liveness_probe_count
- container_overview
- container_ports
- container_privileged
- container_privileged_count
- container_readiness_probe
- container_readiness_probe_count
- container_volume_mount
- containers_for_cronjob
- containers_for_daemonset
- containers_for_deployment
- containers_for_job
- containers_for_pod
- containers_for_replicaset
- cronjob_pods_detail
- cronjob_tree
- daemonset_pods_detail
- daemonset_tree
- daemonsets_for_pod
- deployment_pods_detail
- deployment_tree
- deployments_for_pod
- deployments_for_service
- init_containers_for_pod
- job_pods_detail
- job_tree
- jobs_for_pod
- namespace_pod_count
- namespace_pod_table
- node_containers_count
- node_hierarchy
- node_pod_details
- node_pods_count
- nodes_for_cronjob
- nodes_for_daemonset
- nodes_for_deployment
- nodes_for_job
- nodes_for_replicaset
- nodes_for_statefulset
- persistent_volume_claims_for_container
- persistent_volumes_for_container
- persistent_volumes_for_pod
- pod_1_year_count
- pod_24_hours_count
- pod_30_90_days_count
- pod_30_days_count
- pod_90_365_days_count
- pod_age_table
- pod_annotations
- pod_by_context
- pod_by_context_name
- pod_by_creation_month
- pod_by_namespace
- pod_by_phase
- pod_configuration
- pod_container
- pod_container_basic_detail
- pod_container_count
- pod_container_host_ipc
- pod_container_host_ipc_count
- pod_container_host_network
- pod_container_host_network_count
- pod_container_host_pid
- pod_container_host_pid_count
- pod_count
- pod_default_namespace
- pod_default_namespace_count
- pod_host_table
- pod_init_containers_detail
- pod_input
- pod_labels
- pod_overview
- pod_persistent_volume_claims
- pod_volumes
- pods_for_container
- pods_for_cronjob
- pods_for_daemonset
- pods_for_deployment
- pods_for_job
- pods_for_node
- pods_for_replicaset
- pods_for_service
- pods_for_service_account
- pods_for_statefulset
- replicaset_pods_detail
- replicaset_tree
- replicasets_for_pod
- replicasets_for_service
- secrets_for_container
- secrets_for_pod
- service_accounts_for_pod
- service_pods_detail
- service_tree
- services_for_deployment
- services_for_replicaset
- statefulset_containers
- statefulset_pods_detail
- statefulset_tree
- statefulsets_for_pod
- statefulsets_for_service
.inspect kubernetes_pod
Kubernetes Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.
Name | Type | Description |
---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. |
active_deadline_seconds | text | Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. |
affinity | jsonb | If specified, the pod's scheduling constraints. |
annotations | jsonb | Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. |
automount_service_account_token | boolean | AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. |
conditions | jsonb | Current service state of pod. |
container_statuses | jsonb | The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. |
containers | jsonb | List of containers belonging to the pod. |
context_name | text | Kubectl config context name. |
creation_timestamp | timestamp with time zone | CreationTimestamp is a timestamp representing the server time when this object was created. |
deletion_grace_period_seconds | bigint | Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. |
deletion_timestamp | timestamp with time zone | DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. |
dns_config | jsonb | Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. |
dns_policy | text | DNS policy for pod. Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. |
enable_service_links | boolean | EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. |
end_line | bigint | The path to the manifest file. |
ephemeral_container_statuses | jsonb | Status for any ephemeral containers that have run in this pod. This field is alpha-level and is only populated by servers that enable the EphemeralContainers feature. |
ephemeral_containers | jsonb | List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature. |
finalizers | jsonb | Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. |
generate_name | text | GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. |
generation | bigint | A sequence number representing a specific generation of the desired state. |
host_aliases | jsonb | HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. |
host_ip | inet | IP address of the host to which the pod is assigned. Empty if not yet scheduled. |
host_ipc | boolean | Use the host's ipc namespace. |
host_network | boolean | Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. |
host_pid | boolean | Use the host's pid namespace. |
hostname | text | Specifies the hostname of the Pod. If not specified, the pod's hostname will be set to a system-defined value. |
image_pull_secrets | jsonb | ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. |
init_container_statuses | jsonb | The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. |
init_containers | jsonb | List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. |
labels | jsonb | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. |
name | text | Name of the object. Name must be unique within a namespace. |
namespace | text | Namespace defines the space within which each name must be unique. |
node_name | text | NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements. |
node_selector | jsonb | NodeSelector is a selector which must be true for the pod to fit on a node. |
nominated_node_name | text | nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled. |
overhead | jsonb | Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. |
owner_references | jsonb | List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. |
path | text | The path to the manifest file. |
phase | text | The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values: Pending, Running, Succeeded, Failed, Unknown |
pod_ip | inet | IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated. |
pod_ips | jsonb | podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list is empty if no IPs have been allocated yet. |
preemption_policy | text | PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. |
priority | bigint | The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. |
priority_class_name | text | If specified, indicates the pod's priority. 'system-node-critical' and 'system-cluster-critical' are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. |
qos_class | text | The Quality of Service (QOS) classification assigned to the pod based on resource requirements. |
readiness_gates | jsonb | If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to 'True' |
resource_version | text | An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. |
restart_policy | text | Restart policy for all containers within the pod. One of Always, OnFailure, Never. |
runtime_class_name | text | RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the 'legacy' RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. |
scheduler_name | text | If specified, the pod will be dispatched by specified scheduler. |
security_context | jsonb | SecurityContext holds pod-level security attributes and common container settings. |
selector_search | text | A label selector string to restrict the list of returned objects by their labels. |
service_account_name | text | ServiceAccountName is the name of the ServiceAccount to use to run this pod. |
set_hostname_as_fqdn | boolean | If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters to FQDN. If a pod does not have FQDN, this has no effect. |
share_process_namespace | boolean | Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. |
source_type | text | The source of the resource. Possible values are: deployed and manifest. If the resource is fetched from the spec file the value will be manifest. |
start_line | bigint | The path to the manifest file. |
start_time | timestamp with time zone | Date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod. |
status_message | text | A human readable message indicating details about why the pod is in this condition. |
status_reason | text | A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted' |
subdomain | text | If specified, the fully qualified Pod hostname will be '<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>'. If not specified, the pod will not have a domainname at all. |
tags | jsonb | A map of tags for the resource. This includes both labels and annotations. |
termination_grace_period_seconds | bigint | Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. |
title | text | Title of the resource. |
tolerations | jsonb | If specified, the pod's tolerations. |
topology_spread_constraints | jsonb | TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. |
uid | text | UID is the unique in time and space value for this object. |
volumes | jsonb | List of volumes that can be mounted by containers belonging to the pod. |