Table: gcp_compute_node_group - Query Google Cloud Platform Compute Node Groups using SQL
A Compute Node Group is a resource in Google Cloud Platform's Compute Engine service. It represents a group of Compute Engine instances that are part of the same node group, enabling you to manage, scale, and deploy instances in a unified way. Node Groups are typically used to manage homogeneous instances that need to be created and managed as a group.
Table Usage Guide
The gcp_compute_node_group
table provides insights into Compute Node Groups within Google Cloud Platform's Compute Engine service. As a cloud engineer or system administrator, you can explore details about each node group, including its configuration, operational status, and associated metadata. This table is particularly useful for managing and monitoring groups of instances, ensuring they are correctly configured and performing as expected.
Examples
Node group basic info
Explore the status and size of your Google Cloud Platform compute node groups to understand their current state and capacity. This can help manage resources effectively and optimize cloud infrastructure.
select name, status, size, self_linkfrom gcp_compute_node_group;
select name, status, size, self_linkfrom gcp_compute_node_group;
List of node groups where the autoscaler is not enabled
Explore which node groups within your Google Cloud Platform's Compute Engine have not enabled the autoscaler. This is useful to ensure optimal resource allocation and cost efficiency by automatically adjusting the number of nodes based on the workload.
select name, id, status, autoscaling_policy_modefrom gcp_compute_node_groupwhere autoscaling_policy_mode <> 'ON';
select name, id, status, autoscaling_policy_modefrom gcp_compute_node_groupwhere autoscaling_policy_mode <> 'ON';
List of node groups with default maintenance settings
Analyze the settings to understand which node groups are operating with default maintenance policies in your Google Cloud Platform compute engine. This is useful to ensure that your nodes are being maintained according to your preferred standards.
select name, id, status, autoscaling_policy_modefrom gcp_compute_node_groupwhere maintenance_policy = 'DEFAULT';
select name, id, status, autoscaling_policy_modefrom gcp_compute_node_groupwhere maintenance_policy = 'DEFAULT';
List node types for node groups
Analyze the settings to understand the different types of nodes within each group in your Google Cloud Platform's compute engine. This is useful for managing resources and optimizing your cloud infrastructure.
select g.name, g.id, g.location, t.node_typefrom gcp_compute_node_group as g, gcp_compute_node_template as twhere g.node_template = t.self_link;
select g.name, g.id, g.location, t.node_typefrom gcp_compute_node_group as g join gcp_compute_node_template as t on g.node_template = t.self_link;
Schema for gcp_compute_node_group
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. | |
autoscaling_policy_max_nodes | bigint | The maximum number of nodes that the group should have. Must be set if autoscaling is enabled. Maximum value allowed is 100. | |
autoscaling_policy_min_nodes | bigint | The minimum number of nodes that the group should have. | |
autoscaling_policy_mode | text | Specifies the autoscaling mode of the node group. Set to one of: ON, OFF, or ONLY_SCALE_OUT. | |
creation_timestamp | timestamp with time zone | The creation timestamp of the resource. | |
description | text | A user-specified, human-readable description of the node group. | |
fingerprint | text | An unique system generated string, to reduce conflicts when multiple users change any property of the resource. | |
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. | |
maintenance_policy | text | !=, = | Specifies how to handle instances when a node in the group undergoes maintenance. |
name | text | = | A friendly name that identifies the resource. |
node_template | text | The URL of the node template to create the node group from. | |
project | text | =, !=, ~~, ~~*, !~~, !~~* | The GCP Project in which the resource is located. |
self_link | text | The server-defined URL for the resource. | |
size | bigint | The total number of nodes in the node group. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | !=, = | Specifies the current state of the node group. |
title | text | Title of the resource. | |
zone | text | The name of the zone where the node group resides. | |
zone_name | text | The zone name in which the node group resides. |
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_group