steampipe plugin install gcp

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_link
from
gcp_compute_node_group;
select
name,
status,
size,
self_link
from
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_mode
from
gcp_compute_node_group
where
autoscaling_policy_mode <> 'ON';
select
name,
id,
status,
autoscaling_policy_mode
from
gcp_compute_node_group
where
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_mode
from
gcp_compute_node_group
where
maintenance_policy = 'DEFAULT';
select
name,
id,
status,
autoscaling_policy_mode
from
gcp_compute_node_group
where
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_type
from
gcp_compute_node_group as g,
gcp_compute_node_template as t
where
g.node_template = t.self_link;
select
g.name,
g.id,
g.location,
t.node_type
from
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

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
autoscaling_policy_max_nodesbigintThe maximum number of nodes that the group should have. Must be set if autoscaling is enabled. Maximum value allowed is 100.
autoscaling_policy_min_nodesbigintThe minimum number of nodes that the group should have.
autoscaling_policy_modetextSpecifies the autoscaling mode of the node group. Set to one of: ON, OFF, or ONLY_SCALE_OUT.
creation_timestamptimestamp with time zoneThe creation timestamp of the resource.
descriptiontextA user-specified, human-readable description of the node group.
fingerprinttextAn unique system generated string, to reduce conflicts when multiple users change any property of the resource.
iam_policyjsonbAn 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`.
idbigintThe unique identifier for the resource.
kindtextThe type of the resource.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
maintenance_policytext!=, =Specifies how to handle instances when a node in the group undergoes maintenance.
nametext=A friendly name that identifies the resource.
node_templatetextThe URL of the node template to create the node group from.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
self_linktextThe server-defined URL for the resource.
sizebigintThe total number of nodes in the node group.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statustext!=, =Specifies the current state of the node group.
titletextTitle of the resource.
zonetextThe name of the zone where the node group resides.
zone_nametextThe 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