EdgeKubernetesArgs

data class EdgeKubernetesArgs(val addons: Output<List<EdgeKubernetesAddonArgs>>? = null, val availabilityZone: Output<String>? = null, val clientCert: Output<String>? = null, val clientKey: Output<String>? = null, val clusterCaCert: Output<String>? = null, val clusterSpec: Output<String>? = null, val deletionProtection: Output<Boolean>? = null, val installCloudMonitor: Output<Boolean>? = null, val isEnterpriseSecurityGroup: Output<Boolean>? = null, val keyName: Output<String>? = null, val kubeConfig: Output<String>? = null, val loadBalancerSpec: Output<String>? = null, val logConfig: Output<EdgeKubernetesLogConfigArgs>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val newNatGateway: Output<Boolean>? = null, val nodeCidrMask: Output<Int>? = null, val password: Output<String>? = null, val podCidr: Output<String>? = null, val proxyMode: Output<String>? = null, val rdsInstances: Output<List<String>>? = null, val resourceGroupId: Output<String>? = null, val retainResources: Output<List<String>>? = null, val runtime: Output<EdgeKubernetesRuntimeArgs>? = null, val securityGroupId: Output<String>? = null, val serviceCidr: Output<String>? = null, val skipSetCertificateAuthority: Output<Boolean>? = null, val slbInternetEnabled: Output<Boolean>? = null, val tags: Output<Map<String, String>>? = null, val userData: Output<String>? = null, val version: Output<String>? = null, val workerDataDisks: Output<List<EdgeKubernetesWorkerDataDiskArgs>>? = null, val workerDiskCategory: Output<String>? = null, val workerDiskPerformanceLevel: Output<String>? = null, val workerDiskSize: Output<Int>? = null, val workerDiskSnapshotPolicyId: Output<String>? = null, val workerInstanceChargeType: Output<String>? = null, val workerInstanceTypes: Output<List<String>>? = null, val workerNumber: Output<Int>? = null, val workerVswitchIds: Output<List<String>>? = null) : ConvertibleToJava<EdgeKubernetesArgs>

This resource will help you to manage a Edge Kubernetes Cluster in Alibaba Cloud Kubernetes Service, see What is edge kubernetes.

NOTE: Kubernetes cluster only supports VPC network and it can access internet while creating kubernetes cluster. A Nat Gateway and configuring a SNAT for it can ensure one VPC network access internet. If there is no nat gateway in the VPC, you can set new_nat_gateway to "true" to create one automatically. NOTE: Creating kubernetes cluster need to install several packages and it will cost about 15 minutes. Please be patient. NOTE: The provider supports to download kube config, client certificate, client key and cluster ca certificate after creating cluster successfully, and you can put them into the specified location, like '~/.kube/config'. NOTE: The provider supports disabling internet load balancer for API Server by setting false to slb_internet_enabled. NOTE: If you want to manage Kubernetes, you can use Kubernetes Provider. NOTE: Available since v1.103.0. NOTE: From version 1.185.0+, support new fields cluster_spec, runtime and load_balancer_spec.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const _default = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const defaultGetInstanceTypes = _default.then(_default => alicloud.ecs.getInstanceTypes({
availabilityZone: _default.zones?.[0]?.id,
cpuCoreCount: 4,
memorySize: 8,
kubernetesNodeRole: "Master",
}));
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: name,
cidrBlock: "10.4.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vswitchName: name,
cidrBlock: "10.4.0.0/24",
vpcId: defaultNetwork.id,
zoneId: _default.then(_default => _default.zones?.[0]?.id),
});
const defaultEdgeKubernetes = new alicloud.cs.EdgeKubernetes("default", {
namePrefix: name,
workerVswitchIds: [defaultSwitch&#46;id],
workerInstanceTypes: [defaultGetInstanceTypes&#46;then(defaultGetInstanceTypes => defaultGetInstanceTypes&#46;instanceTypes?&#46;[0]?&#46;id)],
version: "1.26.3-aliyun.1",
workerNumber: 1,
password: "Test12345",
podCidr: "10.99.0.0/16",
serviceCidr: "172.16.0.0/16",
workerInstanceChargeType: "PostPaid",
newNatGateway: true,
nodeCidrMask: 24,
installCloudMonitor: true,
slbInternetEnabled: true,
isEnterpriseSecurityGroup: true,
skipSetCertificateAuthority: true,
workerDataDisks: [{
category: "cloud_ssd",
size: "200",
encrypted: "false",
}],
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.get_zones(available_resource_creation="VSwitch")
default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
cpu_core_count=4,
memory_size=8,
kubernetes_node_role="Master")
default_network = alicloud.vpc.Network("default",
vpc_name=name,
cidr_block="10.4.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vswitch_name=name,
cidr_block="10.4.0.0/24",
vpc_id=default_network.id,
zone_id=default.zones[0].id)
default_edge_kubernetes = alicloud.cs.EdgeKubernetes("default",
name_prefix=name,
worker_vswitch_ids=[default_switch&#46;id],
worker_instance_types=[default_get_instance_types&#46;instance_types[0]&#46;id],
version="1.26.3-aliyun.1",
worker_number=1,
password="Test12345",
pod_cidr="10.99.0.0/16",
service_cidr="172.16.0.0/16",
worker_instance_charge_type="PostPaid",
new_nat_gateway=True,
node_cidr_mask=24,
install_cloud_monitor=True,
slb_internet_enabled=True,
is_enterprise_security_group=True,
skip_set_certificate_authority=True,
worker_data_disks=[{
"category": "cloud_ssd",
"size": "200",
"encrypted": "false",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var @default = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
CpuCoreCount = 4,
MemorySize = 8,
KubernetesNodeRole = "Master",
});
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = name,
CidrBlock = "10.4.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VswitchName = name,
CidrBlock = "10.4.0.0/24",
VpcId = defaultNetwork.Id,
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
});
var defaultEdgeKubernetes = new AliCloud.CS.EdgeKubernetes("default", new()
{
NamePrefix = name,
WorkerVswitchIds = new[]
{
defaultSwitch.Id,
},
WorkerInstanceTypes = new[]
{
defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
},
Version = "1.26.3-aliyun.1",
WorkerNumber = 1,
Password = "Test12345",
PodCidr = "10.99.0.0/16",
ServiceCidr = "172.16.0.0/16",
WorkerInstanceChargeType = "PostPaid",
NewNatGateway = true,
NodeCidrMask = 24,
InstallCloudMonitor = true,
SlbInternetEnabled = true,
IsEnterpriseSecurityGroup = true,
SkipSetCertificateAuthority = true,
WorkerDataDisks = new[]
{
new AliCloud.CS.Inputs.EdgeKubernetesWorkerDataDiskArgs
{
Category = "cloud_ssd",
Size = "200",
Encrypted = "false",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
CpuCoreCount: pulumi.IntRef(4),
MemorySize: pulumi.Float64Ref(8),
KubernetesNodeRole: pulumi.StringRef("Master"),
}, nil)
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("10.4.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.String(name),
CidrBlock: pulumi.String("10.4.0.0/24"),
VpcId: defaultNetwork.ID(),
ZoneId: pulumi.String(_default.Zones[0].Id),
})
if err != nil {
return err
}
_, err = cs.NewEdgeKubernetes(ctx, "default", &cs.EdgeKubernetesArgs{
NamePrefix: pulumi.String(name),
WorkerVswitchIds: pulumi.StringArray{
defaultSwitch.ID(),
},
WorkerInstanceTypes: pulumi.StringArray{
pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
},
Version: pulumi.String("1.26.3-aliyun.1"),
WorkerNumber: pulumi.Int(1),
Password: pulumi.String("Test12345"),
PodCidr: pulumi.String("10.99.0.0/16"),
ServiceCidr: pulumi.String("172.16.0.0/16"),
WorkerInstanceChargeType: pulumi.String("PostPaid"),
NewNatGateway: pulumi.Bool(true),
NodeCidrMask: pulumi.Int(24),
InstallCloudMonitor: pulumi.Bool(true),
SlbInternetEnabled: pulumi.Bool(true),
IsEnterpriseSecurityGroup: pulumi.Bool(true),
SkipSetCertificateAuthority: pulumi.Bool(true),
WorkerDataDisks: cs.EdgeKubernetesWorkerDataDiskArray{
&cs.EdgeKubernetesWorkerDataDiskArgs{
Category: pulumi.String("cloud_ssd"),
Size: pulumi.String("200"),
Encrypted: pulumi.String("false"),
},
},
})
if err != nil {
return err
}
return nil
})
}
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.cs.EdgeKubernetes;
import com.pulumi.alicloud.cs.EdgeKubernetesArgs;
import com.pulumi.alicloud.cs.inputs.EdgeKubernetesWorkerDataDiskArgs;
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-example");
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(default_.zones()[0].id())
.cpuCoreCount(4)
.memorySize(8)
.kubernetesNodeRole("Master")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.4.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("10.4.0.0/24")
.vpcId(defaultNetwork.id())
.zoneId(default_.zones()[0].id())
.build());
var defaultEdgeKubernetes = new EdgeKubernetes("defaultEdgeKubernetes", EdgeKubernetesArgs.builder()
.namePrefix(name)
.workerVswitchIds(defaultSwitch.id())
.workerInstanceTypes(defaultGetInstanceTypes.instanceTypes()[0].id())
.version("1.26.3-aliyun.1")
.workerNumber(1)
.password("Test12345")
.podCidr("10.99.0.0/16")
.serviceCidr("172.16.0.0/16")
.workerInstanceChargeType("PostPaid")
.newNatGateway(true)
.nodeCidrMask(24)
.installCloudMonitor(true)
.slbInternetEnabled(true)
.isEnterpriseSecurityGroup(true)
.skipSetCertificateAuthority(true)
.workerDataDisks(EdgeKubernetesWorkerDataDiskArgs.builder()
.category("cloud_ssd")
.size("200")
.encrypted("false")
.build())
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
defaultNetwork:
type: alicloud:vpc:Network
name: default
properties:
vpcName: ${name}
cidrBlock: 10.4.0.0/16
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
vswitchName: ${name}
cidrBlock: 10.4.0.0/24
vpcId: ${defaultNetwork.id}
zoneId: ${default.zones[0].id}
defaultEdgeKubernetes:
type: alicloud:cs:EdgeKubernetes
name: default
properties:
namePrefix: ${name}
workerVswitchIds:
- ${defaultSwitch.id}
workerInstanceTypes:
- ${defaultGetInstanceTypes.instanceTypes[0].id}
version: 1.26.3-aliyun.1
workerNumber: 1
password: Test12345
podCidr: 10.99.0.0/16
serviceCidr: 172.16.0.0/16
workerInstanceChargeType: PostPaid
newNatGateway: true
nodeCidrMask: 24
installCloudMonitor: true
slbInternetEnabled: true
isEnterpriseSecurityGroup: true
skipSetCertificateAuthority: true
workerDataDisks:
- category: cloud_ssd
size: '200'
encrypted: 'false'
variables:
default:
fn::invoke:
function: alicloud:getZones
arguments:
availableResourceCreation: VSwitch
defaultGetInstanceTypes:
fn::invoke:
function: alicloud:ecs:getInstanceTypes
arguments:
availabilityZone: ${default.zones[0].id}
cpuCoreCount: 4
memorySize: 8
kubernetesNodeRole: Master

You could create a professional kubernetes edge cluster now.

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf_example";
const _default = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const defaultGetInstanceTypes = _default.then(_default => alicloud.ecs.getInstanceTypes({
availabilityZone: _default.zones?.[0]?.id,
cpuCoreCount: 4,
memorySize: 8,
kubernetesNodeRole: "Master",
}));
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: name,
cidrBlock: "10.4.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vswitchName: name,
cidrBlock: "10.4.0.0/24",
vpcId: defaultNetwork.id,
zoneId: _default.then(_default => _default.zones?.[0]?.id),
});
const defaultEdgeKubernetes = new alicloud.cs.EdgeKubernetes("default", {
namePrefix: name,
workerVswitchIds: [defaultSwitch&#46;id],
workerInstanceTypes: [defaultGetInstanceTypes&#46;then(defaultGetInstanceTypes => defaultGetInstanceTypes&#46;instanceTypes?&#46;[0]?&#46;id)],
clusterSpec: "ack.pro.small",
workerNumber: 1,
password: "Test12345",
podCidr: "10.99.0.0/16",
serviceCidr: "172.16.0.0/16",
workerInstanceChargeType: "PostPaid",
newNatGateway: true,
nodeCidrMask: 24,
loadBalancerSpec: "slb.s2.small",
installCloudMonitor: true,
slbInternetEnabled: true,
isEnterpriseSecurityGroup: true,
skipSetCertificateAuthority: true,
workerDataDisks: [{
category: "cloud_ssd",
size: "200",
encrypted: "false",
}],
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf_example"
default = alicloud.get_zones(available_resource_creation="VSwitch")
default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
cpu_core_count=4,
memory_size=8,
kubernetes_node_role="Master")
default_network = alicloud.vpc.Network("default",
vpc_name=name,
cidr_block="10.4.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vswitch_name=name,
cidr_block="10.4.0.0/24",
vpc_id=default_network.id,
zone_id=default.zones[0].id)
default_edge_kubernetes = alicloud.cs.EdgeKubernetes("default",
name_prefix=name,
worker_vswitch_ids=[default_switch&#46;id],
worker_instance_types=[default_get_instance_types&#46;instance_types[0]&#46;id],
cluster_spec="ack.pro.small",
worker_number=1,
password="Test12345",
pod_cidr="10.99.0.0/16",
service_cidr="172.16.0.0/16",
worker_instance_charge_type="PostPaid",
new_nat_gateway=True,
node_cidr_mask=24,
load_balancer_spec="slb.s2.small",
install_cloud_monitor=True,
slb_internet_enabled=True,
is_enterprise_security_group=True,
skip_set_certificate_authority=True,
worker_data_disks=[{
"category": "cloud_ssd",
"size": "200",
"encrypted": "false",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf_example";
var @default = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
CpuCoreCount = 4,
MemorySize = 8,
KubernetesNodeRole = "Master",
});
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = name,
CidrBlock = "10.4.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VswitchName = name,
CidrBlock = "10.4.0.0/24",
VpcId = defaultNetwork.Id,
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
});
var defaultEdgeKubernetes = new AliCloud.CS.EdgeKubernetes("default", new()
{
NamePrefix = name,
WorkerVswitchIds = new[]
{
defaultSwitch.Id,
},
WorkerInstanceTypes = new[]
{
defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
},
ClusterSpec = "ack.pro.small",
WorkerNumber = 1,
Password = "Test12345",
PodCidr = "10.99.0.0/16",
ServiceCidr = "172.16.0.0/16",
WorkerInstanceChargeType = "PostPaid",
NewNatGateway = true,
NodeCidrMask = 24,
LoadBalancerSpec = "slb.s2.small",
InstallCloudMonitor = true,
SlbInternetEnabled = true,
IsEnterpriseSecurityGroup = true,
SkipSetCertificateAuthority = true,
WorkerDataDisks = new[]
{
new AliCloud.CS.Inputs.EdgeKubernetesWorkerDataDiskArgs
{
Category = "cloud_ssd",
Size = "200",
Encrypted = "false",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf_example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
CpuCoreCount: pulumi.IntRef(4),
MemorySize: pulumi.Float64Ref(8),
KubernetesNodeRole: pulumi.StringRef("Master"),
}, nil)
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("10.4.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.String(name),
CidrBlock: pulumi.String("10.4.0.0/24"),
VpcId: defaultNetwork.ID(),
ZoneId: pulumi.String(_default.Zones[0].Id),
})
if err != nil {
return err
}
_, err = cs.NewEdgeKubernetes(ctx, "default", &cs.EdgeKubernetesArgs{
NamePrefix: pulumi.String(name),
WorkerVswitchIds: pulumi.StringArray{
defaultSwitch.ID(),
},
WorkerInstanceTypes: pulumi.StringArray{
pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
},
ClusterSpec: pulumi.String("ack.pro.small"),
WorkerNumber: pulumi.Int(1),
Password: pulumi.String("Test12345"),
PodCidr: pulumi.String("10.99.0.0/16"),
ServiceCidr: pulumi.String("172.16.0.0/16"),
WorkerInstanceChargeType: pulumi.String("PostPaid"),
NewNatGateway: pulumi.Bool(true),
NodeCidrMask: pulumi.Int(24),
LoadBalancerSpec: pulumi.String("slb.s2.small"),
InstallCloudMonitor: pulumi.Bool(true),
SlbInternetEnabled: pulumi.Bool(true),
IsEnterpriseSecurityGroup: pulumi.Bool(true),
SkipSetCertificateAuthority: pulumi.Bool(true),
WorkerDataDisks: cs.EdgeKubernetesWorkerDataDiskArray{
&cs.EdgeKubernetesWorkerDataDiskArgs{
Category: pulumi.String("cloud_ssd"),
Size: pulumi.String("200"),
Encrypted: pulumi.String("false"),
},
},
})
if err != nil {
return err
}
return nil
})
}
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.cs.EdgeKubernetes;
import com.pulumi.alicloud.cs.EdgeKubernetesArgs;
import com.pulumi.alicloud.cs.inputs.EdgeKubernetesWorkerDataDiskArgs;
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_example");
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(default_.zones()[0].id())
.cpuCoreCount(4)
.memorySize(8)
.kubernetesNodeRole("Master")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.4.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("10.4.0.0/24")
.vpcId(defaultNetwork.id())
.zoneId(default_.zones()[0].id())
.build());
var defaultEdgeKubernetes = new EdgeKubernetes("defaultEdgeKubernetes", EdgeKubernetesArgs.builder()
.namePrefix(name)
.workerVswitchIds(defaultSwitch.id())
.workerInstanceTypes(defaultGetInstanceTypes.instanceTypes()[0].id())
.clusterSpec("ack.pro.small")
.workerNumber(1)
.password("Test12345")
.podCidr("10.99.0.0/16")
.serviceCidr("172.16.0.0/16")
.workerInstanceChargeType("PostPaid")
.newNatGateway(true)
.nodeCidrMask(24)
.loadBalancerSpec("slb.s2.small")
.installCloudMonitor(true)
.slbInternetEnabled(true)
.isEnterpriseSecurityGroup(true)
.skipSetCertificateAuthority(true)
.workerDataDisks(EdgeKubernetesWorkerDataDiskArgs.builder()
.category("cloud_ssd")
.size("200")
.encrypted("false")
.build())
.build());
}
}
configuration:
name:
type: string
default: tf_example
resources:
defaultNetwork:
type: alicloud:vpc:Network
name: default
properties:
vpcName: ${name}
cidrBlock: 10.4.0.0/16
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
vswitchName: ${name}
cidrBlock: 10.4.0.0/24
vpcId: ${defaultNetwork.id}
zoneId: ${default.zones[0].id}
defaultEdgeKubernetes:
type: alicloud:cs:EdgeKubernetes
name: default
properties:
namePrefix: ${name}
workerVswitchIds:
- ${defaultSwitch.id}
workerInstanceTypes:
- ${defaultGetInstanceTypes.instanceTypes[0].id}
clusterSpec: ack.pro.small
workerNumber: 1
password: Test12345
podCidr: 10.99.0.0/16
serviceCidr: 172.16.0.0/16
workerInstanceChargeType: PostPaid
newNatGateway: true
nodeCidrMask: 24
loadBalancerSpec: slb.s2.small
installCloudMonitor: true
slbInternetEnabled: true
isEnterpriseSecurityGroup: true
skipSetCertificateAuthority: true
workerDataDisks:
- category: cloud_ssd
size: '200'
encrypted: 'false'
variables:
default:
fn::invoke:
function: alicloud:getZones
arguments:
availableResourceCreation: VSwitch
defaultGetInstanceTypes:
fn::invoke:
function: alicloud:ecs:getInstanceTypes
arguments:
availabilityZone: ${default.zones[0].id}
cpuCoreCount: 4
memorySize: 8
kubernetesNodeRole: Master

Import

Kubernetes edge cluster can be imported using the id, e.g. Then complete the main.tf accords to the result of pulumi preview.

$ pulumi import alicloud:cs/edgeKubernetes:EdgeKubernetes main cluster-id

Constructors

Link copied to clipboard
constructor(addons: Output<List<EdgeKubernetesAddonArgs>>? = null, availabilityZone: Output<String>? = null, clientCert: Output<String>? = null, clientKey: Output<String>? = null, clusterCaCert: Output<String>? = null, clusterSpec: Output<String>? = null, deletionProtection: Output<Boolean>? = null, installCloudMonitor: Output<Boolean>? = null, isEnterpriseSecurityGroup: Output<Boolean>? = null, keyName: Output<String>? = null, kubeConfig: Output<String>? = null, loadBalancerSpec: Output<String>? = null, logConfig: Output<EdgeKubernetesLogConfigArgs>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, newNatGateway: Output<Boolean>? = null, nodeCidrMask: Output<Int>? = null, password: Output<String>? = null, podCidr: Output<String>? = null, proxyMode: Output<String>? = null, rdsInstances: Output<List<String>>? = null, resourceGroupId: Output<String>? = null, retainResources: Output<List<String>>? = null, runtime: Output<EdgeKubernetesRuntimeArgs>? = null, securityGroupId: Output<String>? = null, serviceCidr: Output<String>? = null, skipSetCertificateAuthority: Output<Boolean>? = null, slbInternetEnabled: Output<Boolean>? = null, tags: Output<Map<String, String>>? = null, userData: Output<String>? = null, version: Output<String>? = null, workerDataDisks: Output<List<EdgeKubernetesWorkerDataDiskArgs>>? = null, workerDiskCategory: Output<String>? = null, workerDiskPerformanceLevel: Output<String>? = null, workerDiskSize: Output<Int>? = null, workerDiskSnapshotPolicyId: Output<String>? = null, workerInstanceChargeType: Output<String>? = null, workerInstanceTypes: Output<List<String>>? = null, workerNumber: Output<Int>? = null, workerVswitchIds: Output<List<String>>? = null)

Properties

Link copied to clipboard
val addons: Output<List<EdgeKubernetesAddonArgs>>? = null

The addon you want to install in cluster. See addons below.

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

The ID of availability zone.

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

From version 1.248.0, new DataSource alicloud.cs.getClusterCredential is recommended to manage cluster's kubeconfig, you can also save the certificate_authority.client_cert attribute content of new DataSource alicloud.cs.getClusterCredential to an appropriate path(like ~/.kube/client-cert.pem) for replace it.

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

From version 1.248.0, new DataSource alicloud.cs.getClusterCredential is recommended to manage cluster's kubeconfig, you can also save the certificate_authority.client_key attribute content of new DataSource alicloud.cs.getClusterCredential to an appropriate path(like ~/.kube/client-key.pem) for replace it.

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

From version 1.248.0, new DataSource alicloud.cs.getClusterCredential is recommended to manage cluster's kubeconfig, you can also save the certificate_authority.cluster_cert attribute content of new DataSource alicloud.cs.getClusterCredential to an appropriate path(like ~/.kube/cluster-ca-cert.pem) for replace it. Removed params

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

The cluster specifications of kubernetes cluster,which can be empty. Valid values:

Link copied to clipboard
val deletionProtection: Output<Boolean>? = null

Whether to enable cluster deletion protection.

Link copied to clipboard
val installCloudMonitor: Output<Boolean>? = null

Install cloud monitor agent on ECS. default: true.

Link copied to clipboard
val isEnterpriseSecurityGroup: Output<Boolean>? = null

Enable to create advanced security group. default: false. See Advanced security group.

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

The keypair of ssh login cluster node, you have to create it first. You have to specify one of password key_name kms_encrypted_password fields.

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

The path of kube config, like ~/.kube/config. Please use the attribute output_file of new DataSource alicloud.cs.getClusterCredential to replace it.

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

The cluster api server load balance instance specification. For more information on how to select a LB instance specification, see SLB instance overview. ->NOTE: If you want to use Flannel as CNI network plugin, You need to specific the pod_cidr field and addons with flannel. Worker params

Link copied to clipboard

A list of one element containing information about the associated log store. See log_config below.

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

The kubernetes cluster's name. It is unique in one Alicloud account.

Link copied to clipboard
val namePrefix: Output<String>? = null
Link copied to clipboard
val newNatGateway: Output<Boolean>? = null

Whether to create a new nat gateway while creating kubernetes cluster. Default to true. Then openapi in Alibaba Cloud are not all on intranet, So turn this option on is a good choice.

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

The node cidr block to specific how many pods can run on single node. 24-28 is allowed. 24 means 2^(32-24)-1=255 and the node can run at most 255 pods. default: 24

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

The password of ssh login cluster node. You have to specify one of password, key_name kms_encrypted_password fields.

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

Flannel Specific The CIDR block for the pod network when using Flannel.

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

Proxy mode is option of kube-proxy. options: iptables|ipvs. default: ipvs.

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

RDS instance list, You can choose which RDS instances whitelist to add instances to.

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

The ID of the resource group,by default these cloud resources are automatically assigned to the default resource group.

Link copied to clipboard
val retainResources: Output<List<String>>? = null
Link copied to clipboard
val runtime: Output<EdgeKubernetesRuntimeArgs>? = null

The runtime of containers. If you select another container runtime, see Comparison of Docker, containerd, and Sandboxed-Container. See runtime below.

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

The ID of the security group to which the ECS instances in the cluster belong. If it is not specified, a new Security group will be built.

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

The CIDR block for the service network. It cannot be duplicated with the VPC CIDR and CIDR used by Kubernetes cluster in VPC, cannot be modified after creation.

Link copied to clipboard

Configure whether to save certificate authority data for your cluster to attribute certificate_authority. For cluster security, recommended configuration as true. Will be removed with attribute certificate_authority removed. Network params

Link copied to clipboard
val slbInternetEnabled: Output<Boolean>? = null

Whether to create internet load balancer for API Server. Default to true.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Default nil, A map of tags assigned to the kubernetes cluster and work node.

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

Windows instances support batch and PowerShell scripts. If your script file is larger than 1 KB, we recommend that you upload the script to Object Storage Service (OSS) and pull it through the internal endpoint of your OSS bucket.

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

Desired Kubernetes version. If you do not specify a value, the latest available version at resource creation is used and no upgrades will occur except you set a higher version number. The value must be configured and increased to upgrade the version when desired. Downgrades are not supported by ACK.

Link copied to clipboard

The data disk configurations of worker nodes, such as the disk type and disk size. See worker_data_disks below.

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

The system disk category of worker node. Its valid value are cloud_efficiency, cloud_ssd and cloud_essd and . Default to cloud_efficiency.

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

Worker node system disk performance level, when worker_disk_category values cloud_essd, the optional values are PL0, PL1, PL2 or PL3, but the specific performance level is related to the disk capacity. For more information, see Enhanced SSDs. Default is PL1.

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

The system disk size of worker node. Its valid value range 20~32768 in GB. Default to 40.

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

Worker node system disk auto snapshot policy. Computed params You can set some file paths to save kube_config information, but this way is cumbersome. Since version 1.105.0, we've written it to tf state file. About its use,see export attribute certificate_authority. From version 1.187.0+, new DataSource alicloud.cs.getClusterCredential is recommended to manage cluster's kube_config.

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

Worker payment type, its valid value is PostPaid. Defaults to PostPaid. More charge details in ACK@edge charge.

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

The instance types of worker node, you can set multiple types to avoid NoStock of a certain type.

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

The cloud worker node number of the edge kubernetes cluster. Default to 1. It is limited up to 50 and if you want to enlarge it, please apply white list or contact with us.

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

The vswitches used by workers.

Functions

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