turbot/kubernetes

steampipe plugin install kubernetessteampipe plugin install kubernetes

Table: kubernetes_node

A Node is a worker machine in Kubernetes and may be either a virtual or a physical machine, depending on the cluster.

Examples

Basic Info

select
name,
pod_cidr,
pod_cidrs,
provider_id,
creation_timestamp,
addresses,
capacity
from
kubernetes_node;

List conditions for node

select
name,
cond ->> 'type' as type,
lower(cond ->> 'status')::bool as status,
(cond ->> 'lastHeartbeatTime')::timestamp as last_heartbeat_time,
(cond ->> 'lastTransitionTime')::timestamp as last_transition_time,
cond ->> 'reason' as reason,
cond ->> 'message' as message
from
kubernetes_node,
jsonb_array_elements(conditions) as cond
order by
name,
status desc;

Get system info for nodes

select
name,
node_info ->> 'machineID' as machine_id,
node_info ->> 'systemUUID' as systemUUID,
node_info ->> 'bootID' as bootID,
node_info ->> 'kernelVersion' as kernelVersion,
node_info ->> 'osImage' as osImage,
node_info ->> 'operatingSystem' as operatingSystem,
node_info ->> 'architecture' as architecture,
node_info ->> 'containerRuntimeVersion' as containerRuntimeVersion,
node_info ->> 'kubeletVersion' as kubeletVersion,
node_info ->> 'kubeProxyVersion' as kubeProxyVersion
from
kubernetes_node;

Node IP info

select
name,
jsonb_path_query_array(
addresses,
'$[*] ? (@.type == "ExternalIP").address'
) as public_ips,
jsonb_path_query_array(
addresses,
'$[*] ? (@.type == "InternalIP").address'
) as internal_ips,
jsonb_path_query_array(
addresses,
'$[*] ? (@.type == "InternalDNS").address'
) as internal_dns,
jsonb_path_query_array(
addresses,
'$[*] ? (@.type == "Hostname").address'
) as hostnames
from
kubernetes_node;

.inspect kubernetes_node

Kubernetes Node is a worker node in Kubernetes.

NameTypeDescription
addressesjsonbEndpoints of daemons running on the Node.
allocatablejsonbAllocatable represents the resources of a node that are available for scheduling. Defaults to capacity.
annotationsjsonbAnnotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
capacityjsonbCapacity represents the total resources of a node.
conditionsjsonbList of current observed node conditions.
configjsonbStatus of the config assigned to the node via the dynamic Kubelet config feature.
config_sourcejsonbThe source to get node configuration from.
context_nametextKubectl config context name.
creation_timestamptimestamp without time zoneCreationTimestamp is a timestamp representing the server time when this object was created.
daemon_endpointsjsonbSet of ids/uuids to uniquely identify the node.
deletion_grace_period_secondsbigintNumber 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_timestamptimestamp without time zoneDeletionTimestamp is RFC 3339 date and time at which this resource will be deleted.
finalizersjsonbMust 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_nametextGenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided.
generationbigintA sequence number representing a specific generation of the desired state.
imagesjsonbList of container images on this node.
labelsjsonbMap 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.
nametextName of the object. Name must be unique within a namespace.
node_infojsonbList of container images on this node.
owner_referencesjsonbList 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.
phasetextThe recently observed lifecycle phase of the node.
pod_cidrcidrPod IP range assigned to the node.
pod_cidrsjsonbList of the IP ranges assigned to the node for usage by Pods.
provider_idtextID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>.
resource_versiontextAn opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed.
tagsjsonbA map of tags for the resource. This includes both labels and annotations.
taintsjsonbList of the taints attached to the node to has the "effect" on pod that does not tolerate the Taint
titletextTitle of the resource.
uidtextUID is the unique in time and space value for this object.
unschedulablebooleanUnschedulable controls node schedulability of new pods. By default, node is schedulable.
volumes_attachedjsonbList of volumes that are attached to the node.
volumes_in_usejsonbList of attachable volumes in use (mounted) by the node.