Table: digitalocean_kubernetes_node_pool - Query DigitalOcean Kubernetes Node Pools using SQL
A Kubernetes Node Pool in DigitalOcean is a subset of machines within a Kubernetes cluster that have similar configurations. Node Pools enable you to create and manage multiple groups of nodes within the same Kubernetes cluster, each tailored to the specific compute requirements of your workloads. It provides a way to manage different types of workloads in a Kubernetes cluster more efficiently.
Table Usage Guide
The digitalocean_kubernetes_node_pool
table provides insights into Kubernetes Node Pools within DigitalOcean. As a DevOps engineer, you can explore node pool-specific details through this table, including configurations, node count, and associated metadata. Use it to manage and monitor the health and performance of your node pools, ensuring optimal operation of your Kubernetes workloads.
Examples
Basic info
Analyze the settings to understand the configuration of DigitalOcean Kubernetes node pools. This can help in managing resources and scaling strategies more effectively.
select id, name, cluster_id auto_scalefrom digitalocean_kubernetes_node_pool;
select id, name, cluster_id, auto_scalefrom digitalocean_kubernetes_node_pool;
List node pools with autoscaling disabled
Explore which node pools within your Kubernetes cluster have autoscaling disabled. This is beneficial for understanding your resource utilization and identifying potential areas for optimization.
select id, name, cluster_id, auto_scalefrom digitalocean_kubernetes_node_poolwhere not auto_scale;
select id, name, cluster_id, auto_scalefrom digitalocean_kubernetes_node_poolwhere auto_scale = 0;
Count numbers of nodes per node pool
Explore the distribution of nodes within your DigitalOcean Kubernetes clusters. This query helps to balance workload by showing the number of nodes in each node pool.
select id, name, cluster_id, count as node_countfrom digitalocean_kubernetes_node_pool;
select id, name, cluster_id, count as node_countfrom digitalocean_kubernetes_node_pool;
Get node details of node pools
Discover the details of your node pools, including creation and update times, to understand their status and manage them more effectively. This can be particularly useful in managing resources and troubleshooting issues within your digital ocean Kubernetes environment.
select p.id, p.name, n ->> 'created_at' as node_created_at, n ->> 'droplet_id' as node_droplet_id, n ->> 'id' as node_id, n ->> 'name' as node_name, n ->> 'status' as node_status, n ->> 'updated_at' as node_updated_atfrom digitalocean_kubernetes_node_pool as p, jsonb_array_elements(nodes) as n;
select p.id, p.name, json_extract(n.value, '$.created_at') as node_created_at, json_extract(n.value, '$.droplet_id') as node_droplet_id, json_extract(n.value, '$.id') as node_id, json_extract(n.value, '$.name') as node_name, json_extract(n.value, '$.status') as node_status, json_extract(n.value, '$.updated_at') as node_updated_atfrom digitalocean_kubernetes_node_pool as p, json_each(p.nodes) as n;
Get the top five node pools with the most nodes
Analyze the settings to understand which five node pools in your DigitalOcean Kubernetes service have the highest number of nodes. This can help manage resources by identifying areas of high resource concentration.
select id, name, cluster_id, max_nodesfrom digitalocean_kubernetes_node_poolorder by max_nodes desclimit 5;
select id, name, cluster_id, max_nodesfrom digitalocean_kubernetes_node_poolorder by max_nodes desclimit 5;
Get cluster details for the node pools
Determine the status and endpoint details of your DigitalOcean Kubernetes clusters by examining the associated node pools. This can aid in monitoring cluster health and connectivity.
select n.id as node_pool_id, n.name, n.cluster_id, c.status as cluster_status, c.cluster_subnet, c.endpoint as cluster_endpointfrom digitalocean_kubernetes_node_pool as n, digitalocean_kubernetes_cluster as cwhere c.id = cluster_id;
select n.id as node_pool_id, n.name, n.cluster_id, c.status as cluster_status, c.cluster_subnet, c.endpoint as cluster_endpointfrom digitalocean_kubernetes_node_pool as n, digitalocean_kubernetes_cluster as cwhere c.id = n.cluster_id;
Query examples
Schema for digitalocean_kubernetes_node_pool
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
auto_scale | boolean | A boolean value indicating whether the node pool has autoscaling enabled. | |
cluster_id | text | = | The unique universal identifier of the associated cluster. |
count | bigint | The number of nodes in the node pool. | |
id | text | = | The unique universal identifier of this node pool. |
labels | jsonb | The labels for the node pool. | |
max_nodes | bigint | The maximum number of nodes allowed in the node pool. | |
min_nodes | bigint | The minimum number of nodes allowed in the node pool. | |
name | text | The globally unique human-readable name for the node pool. | |
nodes | jsonb | The nodes available in the node pool. | |
size | text | The size of the node pool. | |
tags | jsonb | A map of tags for the resource. | |
taints | jsonb | The taints of the node pool. | |
title | text | Title of the resource. | |
urn | text | The uniform resource name (URN) for the node pool. |