Table: gcp_compute_node_template - Query Google Cloud Compute Node Templates using SQL
A Google Cloud Compute Node Template is a resource within Google Cloud's Compute Engine that defines the properties of a node group to be created. Node Templates specify the server configuration of instances in a node group. This includes the type of CPU, amount of memory, and disk size and type.
Table Usage Guide
The gcp_compute_node_template
table provides insights into node templates within Google Cloud's Compute Engine. As a Cloud Engineer, explore template-specific details through this table, including CPU and memory configurations, disk size and type, and associated metadata. Utilize it to uncover information about node templates, such as those with specific configurations, the properties of each node template, and the verification of node template properties.
Examples
List of n2-node-80-640 type node templates
Determine the areas in which specific node templates of type 'n2-node-80-640' are used in your Google Cloud Platform. This can be helpful to understand the distribution and usage of this particular node type across different locations.
select name, id, location, node_typefrom gcp_compute_node_templatewhere node_type = 'n2-node-80-640';
select name, id, location, node_typefrom gcp_compute_node_templatewhere node_type = 'n2-node-80-640';
List of node templates where cpu overcommit is enabled
Determine the areas in which CPU overcommit is enabled within node templates, to manage resource allocation effectively and optimize cloud infrastructure performance.
select name, id, node_typefrom gcp_compute_node_templatewhere cpu_overcommit_type = 'ENABLED';
select name, id, node_typefrom gcp_compute_node_templatewhere cpu_overcommit_type = 'ENABLED';
Count of node templates per location
Determine the distribution of node templates across different locations in your Google Cloud Platform. This can help you understand the geographical spread of your compute resources for better resource management and planning.
select location, count(*)from gcp_compute_node_templategroup by location;
select location, count(*)from gcp_compute_node_templategroup by location;
Find unused node templates
Explore which node templates in your Google Cloud Platform are not currently being used. This can help in identifying unused resources, potentially leading to cost savings and better resource management.
select t.name, t.idfrom gcp_compute_node_template as t left join gcp_compute_node_group as g on g.node_template = t.self_linkwhere g is null;
select t.name, t.idfrom gcp_compute_node_template as t left join gcp_compute_node_group as g on g.node_template = t.self_linkwhere g.node_template is null;
Schema for gcp_compute_node_template
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
cpu_overcommit_type | text | !=, = | Specifies the CPU overcommit. |
creation_timestamp | timestamp with time zone | The creation timestamp of the resource. | |
description | text | A user-specified, human-readable description of the node template. | |
iam_policy | jsonb | An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. | |
id | bigint | The unique identifier for the resource. | |
kind | text | The type of the resource. | |
location | text | The GCP multi-region, region, or zone in which the resource is located. | |
name | text | = | A friendly name that identifies the resource. |
node_affinity_labels | jsonb | A list of labels to use for node affinity, which will be used in instance scheduling. | |
node_type | text | !=, = | Specifies the type of the nodes to use for node groups, that are created from this template. |
node_type_flexibility_cpus | text | The URL of the network in which to reserve the address. | |
node_type_flexibility_local_ssd | text | Specifies the networking tier used for configuring this address. | |
node_type_flexibility_memory | text | Specifies the prefix length if the resource represents an IP range. | |
project | text | =, !=, ~~, ~~*, !~~, !~~* | The GCP Project in which the resource is located. |
region | text | The name of the region where the node template resides. | |
self_link | text | The server-defined URL for the resource. | |
server_binding_type | text | Specifies the binding properties for the physical server. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | !=, = | Specifies the status of the node template. |
status_message | text | A human-readable explanation of the resource status. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- gcp
You can pass the configuration to the command with the --config
argument:
steampipe_export_gcp --config '<your_config>' gcp_compute_node_template