Node Pool Args
Example Usage
The managed cluster configuration,
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.KeyPair;
import com.pulumi.alicloud.ecs.KeyPairArgs;
import com.pulumi.alicloud.cs.ManagedKubernetes;
import com.pulumi.alicloud.cs.ManagedKubernetesArgs;
import com.pulumi.codegen.internal.KeyedValue;
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 config = ctx.config();
final var name = config.get("name").orElse("tf-test");
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.cpuCoreCount(2)
.memorySize(4)
.kubernetesNodeRole("Worker")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.1.0.0/21")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.vpcId(defaultNetwork.id())
.cidrBlock("10.1.1.0/24")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultKeyPair = new KeyPair("defaultKeyPair", KeyPairArgs.builder()
.keyPairName(name)
.build());
for (var i = 0; i < (1 == true); i++) {
new ManagedKubernetes("defaultManagedKubernetes-" + i, ManagedKubernetesArgs.builder()
.clusterSpec("ack.pro.small")
.isEnterpriseSecurityGroup(true)
.podCidr("172.20.0.0/16")
.serviceCidr("172.21.0.0/20")
.workerVswitchIds(defaultSwitch.id())
.build());
}
}
}
Import
Cluster nodepool can be imported using the id, e.g. Then complete the nodepool.tf accords to the result of terraform plan
.
$ pulumi import alicloud:cs/nodePool:NodePool custom_nodepool cluster_id:nodepool_id
Constructors
Functions
Properties
Whether enable worker node to support cis security reinforcement, its valid value true
or false
. Default to false
and apply to AliyunLinux series. See CIS Reinforcement.
After you select this check box, if data disks have been attached to the specified ECS instances and the file system of the last data disk is uninitialized, the system automatically formats the last data disk to ext4 and mounts the data disk to /var/lib/docker and /var/lib/kubelet. The original data on the disk will be cleared. Make sure that you back up data in advance. If no data disk is mounted on the ECS instance, no new data disk will be purchased. Default is false
.
An KMS encryption context used to decrypt kms_encrypted_password
before creating or updating a cs kubernetes with kms_encrypted_password
. See Encryption Context. It is valid when kms_encrypted_password
is set.
Kubelet configuration parameters for worker nodes. Detailed below. More information in Kubelet Configuration.
A List of Kubernetes labels to assign to the nodes . Only labels that are applied with the ACK API are managed by this argument. Detailed below. More information in Labels.
Each node name consists of a prefix, an IP substring, and a suffix, the input format is customized,<prefix>,IPSubStringLen,<suffix>
. For example "customized,aliyun.com-,5,-test", if the node IP address is 192.168.59.176, the prefix is aliyun.com-, IP substring length is 5, and the suffix is -test, the node name will be aliyun.com-59176-test.
The runtime name of containers. If not set, the cluster runtime will be used as the node pool runtime. If you select another container runtime, see Comparison of Docker, containerd, and Sandboxed-Container.
Auto scaling node pool configuration. For more details, see scaling_config
. With auto-scaling is enabled, the nodes in the node pool will be labeled with k8s.aliyun.com=true
to prevent system pods such as coredns, metrics-servers from being scheduled to elastic nodes, and to prevent node shrinkage from causing business abnormalities.
The scaling mode. Valid values: release
, recycle
, default is release
. Standard mode(release): Create and release ECS instances based on requests.Swift mode(recycle): Create, stop, and restart ECS instances based on needs. New ECS instances are only created when no stopped ECS instance is avalible. This mode further accelerates the scaling process. Apart from ECS instances that use local storage, when an ECS instance is stopped, you are only chatged for storage space.
Whether enable worker node to support soc security reinforcement, its valid value true
or false
. Default to false
and apply to AliyunLinux series. See SOC Reinforcement.
A List of Kubernetes taints to assign to the nodes. Detailed below. More information in Taints and Toleration.