Class NodePool


  • public class NodePool
    extends com.pulumi.resources.CustomResource
    "A set of Kubernetes nodes in a cluster with common configuration and specification." To get more information about NodePool, see: * [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/container/rest/v1/projects.locations.clusters.nodePools) * How-to Guides * [Google Distributed Cloud Edge](https://cloud.google.com/distributed-cloud/edge/latest/docs) ## Example Usage ### Edgecontainer Node Pool ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.organizations.OrganizationsFunctions; import com.pulumi.gcp.organizations.inputs.GetProjectArgs; import com.pulumi.gcp.edgecontainer.Cluster; import com.pulumi.gcp.edgecontainer.ClusterArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs; import com.pulumi.gcp.edgecontainer.NodePool; import com.pulumi.gcp.edgecontainer.NodePoolArgs; 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) { final var project = OrganizationsFunctions.getProject(); var cluster = new Cluster("cluster", ClusterArgs.builder() .location("us-central1") .authorization(ClusterAuthorizationArgs.builder() .adminUsers(ClusterAuthorizationAdminUsersArgs.builder() .username("[email protected]") .build()) .build()) .networking(ClusterNetworkingArgs.builder() .clusterIpv4CidrBlocks("10.0.0.0/16") .servicesIpv4CidrBlocks("10.1.0.0/16") .build()) .fleet(ClusterFleetArgs.builder() .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number()))) .build()) .build()); var default_ = new NodePool("default", NodePoolArgs.builder() .cluster(cluster.name()) .location("us-central1") .nodeLocation("us-central1-edge-example-edgesite") .nodeCount(3) .labels(Map.ofEntries( Map.entry("my_key", "my_val"), Map.entry("other_key", "other_val") )) .build()); } } ``` ### Edgecontainer Node Pool With Cmek ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.organizations.OrganizationsFunctions; import com.pulumi.gcp.organizations.inputs.GetProjectArgs; import com.pulumi.gcp.edgecontainer.Cluster; import com.pulumi.gcp.edgecontainer.ClusterArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs; import com.pulumi.gcp.kms.KeyRing; import com.pulumi.gcp.kms.KeyRingArgs; import com.pulumi.gcp.kms.CryptoKey; import com.pulumi.gcp.kms.CryptoKeyArgs; import com.pulumi.gcp.kms.CryptoKeyIAMMember; import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs; import com.pulumi.gcp.edgecontainer.NodePool; import com.pulumi.gcp.edgecontainer.NodePoolArgs; import com.pulumi.gcp.edgecontainer.inputs.NodePoolLocalDiskEncryptionArgs; import com.pulumi.resources.CustomResourceOptions; 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) { final var project = OrganizationsFunctions.getProject(); var cluster = new Cluster("cluster", ClusterArgs.builder() .location("us-central1") .authorization(ClusterAuthorizationArgs.builder() .adminUsers(ClusterAuthorizationAdminUsersArgs.builder() .username("[email protected]") .build()) .build()) .networking(ClusterNetworkingArgs.builder() .clusterIpv4CidrBlocks("10.0.0.0/16") .servicesIpv4CidrBlocks("10.1.0.0/16") .build()) .fleet(ClusterFleetArgs.builder() .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number()))) .build()) .build()); var keyRing = new KeyRing("keyRing", KeyRingArgs.builder() .location("us-central1") .build()); var cryptoKeyCryptoKey = new CryptoKey("cryptoKeyCryptoKey", CryptoKeyArgs.builder() .keyRing(keyRing.id()) .build()); var cryptoKeyCryptoKeyIAMMember = new CryptoKeyIAMMember("cryptoKeyCryptoKeyIAMMember", CryptoKeyIAMMemberArgs.builder() .cryptoKeyId(cryptoKeyCryptoKey.id()) .role("roles/cloudkms.cryptoKeyEncrypterDecrypter") .member(String.format("serviceAccount:service-%[email protected]", project.applyValue(getProjectResult -> getProjectResult.number()))) .build()); var default_ = new NodePool("default", NodePoolArgs.builder() .cluster(cluster.name()) .location("us-central1") .nodeLocation("us-central1-edge-example-edgesite") .nodeCount(3) .localDiskEncryption(NodePoolLocalDiskEncryptionArgs.builder() .kmsKey(cryptoKeyCryptoKey.id()) .build()) .build(), CustomResourceOptions.builder() .dependsOn(cryptoKeyCryptoKeyIAMMember) .build()); } } ``` ### Edgecontainer Local Control Plane Node Pool ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.organizations.OrganizationsFunctions; import com.pulumi.gcp.organizations.inputs.GetProjectArgs; import com.pulumi.gcp.edgecontainer.Cluster; import com.pulumi.gcp.edgecontainer.ClusterArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterControlPlaneArgs; import com.pulumi.gcp.edgecontainer.inputs.ClusterControlPlaneLocalArgs; import com.pulumi.gcp.edgecontainer.NodePool; import com.pulumi.gcp.edgecontainer.NodePoolArgs; 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) { final var project = OrganizationsFunctions.getProject(); var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder() .location("us-central1") .authorization(ClusterAuthorizationArgs.builder() .adminUsers(ClusterAuthorizationAdminUsersArgs.builder() .username("[email protected]") .build()) .build()) .networking(ClusterNetworkingArgs.builder() .clusterIpv4CidrBlocks("10.0.0.0/16") .servicesIpv4CidrBlocks("10.1.0.0/16") .build()) .fleet(ClusterFleetArgs.builder() .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number()))) .build()) .externalLoadBalancerIpv4AddressPools("10.100.0.0-10.100.0.10") .controlPlane(ClusterControlPlaneArgs.builder() .local(ClusterControlPlaneLocalArgs.builder() .nodeLocation("us-central1-edge-example-edgesite") .nodeCount(1) .machineFilter("machine-name") .sharedDeploymentPolicy("ALLOWED") .build()) .build()) .build()); var defaultNodePool = new NodePool("defaultNodePool", NodePoolArgs.builder() .cluster(google_edgecontainer_cluster.cluster().name()) .location("us-central1") .nodeLocation("us-central1-edge-example-edgesite") .nodeCount(3) .build()); } } ``` ## Import NodePool can be imported using any of these accepted formats* `projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}` * `{{project}}/{{location}}/{{cluster}}/{{name}}` * `{{location}}/{{cluster}}/{{name}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import NodePool using one of the formats above. For exampletf import { id = "projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}" to = google_edgecontainer_node_pool.default } ```sh $ pulumi import gcp:edgecontainer/nodePool:NodePool When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), NodePool can be imported using one of the formats above. For example ``` ```sh $ pulumi import gcp:edgecontainer/nodePool:NodePool default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}} ``` ```sh $ pulumi import gcp:edgecontainer/nodePool:NodePool default {{project}}/{{location}}/{{cluster}}/{{name}} ``` ```sh $ pulumi import gcp:edgecontainer/nodePool:NodePool default {{location}}/{{cluster}}/{{name}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      NodePool​(java.lang.String name)  
      NodePool​(java.lang.String name, NodePoolArgs args)  
      NodePool​(java.lang.String name, NodePoolArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> cluster()  
      com.pulumi.core.Output<java.lang.String> createTime()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> effectiveLabels()  
      static NodePool get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, NodePoolState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()  
      com.pulumi.core.Output<java.util.Optional<NodePoolLocalDiskEncryption>> localDiskEncryption()  
      com.pulumi.core.Output<java.lang.String> location()  
      com.pulumi.core.Output<java.lang.String> machineFilter()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<NodePoolNodeConfig> nodeConfig()  
      com.pulumi.core.Output<java.lang.Integer> nodeCount()  
      com.pulumi.core.Output<java.lang.String> nodeLocation()  
      com.pulumi.core.Output<java.lang.String> nodeVersion()  
      com.pulumi.core.Output<java.lang.String> project()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> pulumiLabels()  
      com.pulumi.core.Output<java.lang.String> updateTime()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodePool

        public NodePool​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • NodePool

        public NodePool​(java.lang.String name,
                        NodePoolArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • NodePool

        public NodePool​(java.lang.String name,
                        NodePoolArgs args,
                        @Nullable
                        com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • cluster

        public com.pulumi.core.Output<java.lang.String> cluster()
        Returns:
        The name of the target Distributed Cloud Edge Cluster. ***
      • createTime

        public com.pulumi.core.Output<java.lang.String> createTime()
        Returns:
        The time when the node pool was created.
      • effectiveLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> effectiveLabels()
        Returns:
        All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
      • labels

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()
        Returns:
        Labels associated with this resource. **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field `effective_labels` for all of the labels present on the resource.
      • localDiskEncryption

        public com.pulumi.core.Output<java.util.Optional<NodePoolLocalDiskEncryption>> localDiskEncryption()
        Returns:
        Local disk encryption options. This field is only used when enabling CMEK support. Structure is documented below.
      • location

        public com.pulumi.core.Output<java.lang.String> location()
        Returns:
        The location of the resource.
      • machineFilter

        public com.pulumi.core.Output<java.lang.String> machineFilter()
        Returns:
        Only machines matching this filter will be allowed to join the node pool. The filtering language accepts strings like "name=<name>", and is documented in more detail in [AIP-160](https://google.aip.dev/160).
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The resource name of the node pool.
      • nodeConfig

        public com.pulumi.core.Output<NodePoolNodeConfig> nodeConfig()
        Returns:
        Configuration for each node in the NodePool Structure is documented below.
      • nodeCount

        public com.pulumi.core.Output<java.lang.Integer> nodeCount()
        Returns:
        The number of nodes in the pool.
      • nodeLocation

        public com.pulumi.core.Output<java.lang.String> nodeLocation()
        Returns:
        Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: `us-central1-edge-customer-a`.
      • nodeVersion

        public com.pulumi.core.Output<java.lang.String> nodeVersion()
        Returns:
        The lowest release version among all worker nodes.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
      • pulumiLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> pulumiLabels()
        Returns:
        The combination of labels configured directly on the resource and default labels configured on the provider.
      • updateTime

        public com.pulumi.core.Output<java.lang.String> updateTime()
        Returns:
        The time when the node pool was last updated.
      • get

        public static NodePool get​(java.lang.String name,
                                   com.pulumi.core.Output<java.lang.String> id,
                                   @Nullable
                                   NodePoolState state,
                                   @Nullable
                                   com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.