NodeGroupArgs

data class NodeGroupArgs(val autoscalingPolicy: Output<NodeGroupAutoscalingPolicyArgs>? = null, val description: Output<String>? = null, val initialSize: Output<Int>? = null, val maintenancePolicy: Output<String>? = null, val maintenanceWindow: Output<NodeGroupMaintenanceWindowArgs>? = null, val name: Output<String>? = null, val nodeTemplate: Output<String>? = null, val project: Output<String>? = null, val shareSettings: Output<NodeGroupShareSettingsArgs>? = null, val size: Output<Int>? = null, val zone: Output<String>? = null) : ConvertibleToJava<NodeGroupArgs>

Represents a NodeGroup resource to manage a group of sole-tenant nodes. To get more information about NodeGroup, see:

Warning: Due to limitations of the API, this provider cannot update the number of nodes in a node group and changes to node group size either through provider config or through external changes will cause the provider to delete and recreate the node group.

Example Usage

Node Group Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.NodeTemplate;
import com.pulumi.gcp.compute.NodeTemplateArgs;
import com.pulumi.gcp.compute.NodeGroup;
import com.pulumi.gcp.compute.NodeGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var soletenant_tmpl = new NodeTemplate("soletenant-tmpl", NodeTemplateArgs.builder()
.region("us-central1")
.nodeType("n1-node-96-624")
.build());
var nodes = new NodeGroup("nodes", NodeGroupArgs.builder()
.zone("us-central1-a")
.description("example google_compute_node_group for the Google Provider")
.size(1)
.nodeTemplate(soletenant_tmpl.id())
.build());
}
}

Node Group Autoscaling Policy

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.NodeTemplate;
import com.pulumi.gcp.compute.NodeTemplateArgs;
import com.pulumi.gcp.compute.NodeGroup;
import com.pulumi.gcp.compute.NodeGroupArgs;
import com.pulumi.gcp.compute.inputs.NodeGroupMaintenanceWindowArgs;
import com.pulumi.gcp.compute.inputs.NodeGroupAutoscalingPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var soletenant_tmpl = new NodeTemplate("soletenant-tmpl", NodeTemplateArgs.builder()
.region("us-central1")
.nodeType("n1-node-96-624")
.build());
var nodes = new NodeGroup("nodes", NodeGroupArgs.builder()
.zone("us-central1-a")
.description("example google_compute_node_group for Google Provider")
.maintenancePolicy("RESTART_IN_PLACE")
.maintenanceWindow(NodeGroupMaintenanceWindowArgs.builder()
.startTime("08:00")
.build())
.initialSize(1)
.nodeTemplate(soletenant_tmpl.id())
.autoscalingPolicy(NodeGroupAutoscalingPolicyArgs.builder()
.mode("ONLY_SCALE_OUT")
.minNodes(1)
.maxNodes(10)
.build())
.build());
}
}

Node Group Share Settings

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.compute.NodeTemplate;
import com.pulumi.gcp.compute.NodeTemplateArgs;
import com.pulumi.gcp.compute.NodeGroup;
import com.pulumi.gcp.compute.NodeGroupArgs;
import com.pulumi.gcp.compute.inputs.NodeGroupShareSettingsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var guestProject = new Project("guestProject", ProjectArgs.builder()
.projectId("project-id")
.orgId("123456789")
.build());
var soletenant_tmpl = new NodeTemplate("soletenant-tmpl", NodeTemplateArgs.builder()
.region("us-central1")
.nodeType("n1-node-96-624")
.build());
var nodes = new NodeGroup("nodes", NodeGroupArgs.builder()
.zone("us-central1-f")
.description("example google_compute_node_group for Terraform Google Provider")
.size(1)
.nodeTemplate(soletenant_tmpl.id())
.shareSettings(NodeGroupShareSettingsArgs.builder()
.shareType("SPECIFIC_PROJECTS")
.projectMaps(NodeGroupShareSettingsProjectMapArgs.builder()
.id(guestProject.projectId())
.projectId(guestProject.projectId())
.build())
.build())
.build());
}
}

Import

NodeGroup can be imported using any of these accepted formats

$ pulumi import gcp:compute/nodeGroup:NodeGroup default projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}}
$ pulumi import gcp:compute/nodeGroup:NodeGroup default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:compute/nodeGroup:NodeGroup default {{zone}}/{{name}}
$ pulumi import gcp:compute/nodeGroup:NodeGroup default {{name}}

Constructors

Link copied to clipboard
constructor(autoscalingPolicy: Output<NodeGroupAutoscalingPolicyArgs>? = null, description: Output<String>? = null, initialSize: Output<Int>? = null, maintenancePolicy: Output<String>? = null, maintenanceWindow: Output<NodeGroupMaintenanceWindowArgs>? = null, name: Output<String>? = null, nodeTemplate: Output<String>? = null, project: Output<String>? = null, shareSettings: Output<NodeGroupShareSettingsArgs>? = null, size: Output<Int>? = null, zone: Output<String>? = null)

Properties

Link copied to clipboard

If you use sole-tenant nodes for your workloads, you can use the node group autoscaler to automatically manage the sizes of your node groups. Structure is documented below.

Link copied to clipboard
val description: Output<String>? = null

An optional textual description of the resource.

Link copied to clipboard
val initialSize: Output<Int>? = null

The initial number of nodes in the node group. One of initial_size or size must be specified.

Link copied to clipboard
val maintenancePolicy: Output<String>? = null

Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT.

Link copied to clipboard

contains properties for the timeframe of maintenance Structure is documented below.

Link copied to clipboard
val name: Output<String>? = null

Name of the resource.

Link copied to clipboard
val nodeTemplate: Output<String>? = null

The URL of the node template to which this node group belongs.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard

Share settings for the node group. Structure is documented below.

Link copied to clipboard
val size: Output<Int>? = null

The total number of nodes in the node group. One of initial_size or size must be specified.

Link copied to clipboard
val zone: Output<String>? = null

Zone where this node group is located

Functions

Link copied to clipboard
open override fun toJava(): NodeGroupArgs