@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
314 lines (313 loc) • 11.5 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a resource to manage vke node
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
* securityGroupName: "acc-test-security-group",
* vpcId: fooVpc.id,
* });
* const fooImages = volcengine.ecs.getImages({
* nameRegex: "veLinux 1.0 CentOS兼容版 64位",
* });
* const fooCluster = new volcengine.vke.Cluster("fooCluster", {
* description: "created by terraform",
* deleteProtectionEnabled: false,
* clusterConfig: {
* subnetIds: [fooSubnet.id],
* apiServerPublicAccessEnabled: true,
* apiServerPublicAccessConfig: {
* publicAccessNetworkConfig: {
* billingType: "PostPaidByBandwidth",
* bandwidth: 1,
* },
* },
* resourcePublicAccessDefaultEnabled: true,
* },
* podsConfig: {
* podNetworkMode: "VpcCniShared",
* vpcCniConfig: {
* subnetIds: [fooSubnet.id],
* },
* },
* servicesConfig: {
* serviceCidrsv4s: ["172.30.0.0/18"],
* },
* tags: [{
* key: "tf-k1",
* value: "tf-v1",
* }],
* });
* const fooNodePool = new volcengine.vke.NodePool("fooNodePool", {
* clusterId: fooCluster.id,
* autoScaling: {
* enabled: false,
* },
* nodeConfig: {
* instanceTypeIds: ["ecs.g1ie.xlarge"],
* subnetIds: [fooSubnet.id],
* imageId: fooImages.then(fooImages => .filter(image => image.imageName == "veLinux 1.0 CentOS兼容版 64位").map(image => (image.imageId))[0]),
* systemVolume: {
* type: "ESSD_PL0",
* size: 50,
* },
* dataVolumes: [{
* type: "ESSD_PL0",
* size: 50,
* mountPoint: "/tf",
* }],
* initializeScript: "ZWNobyBoZWxsbyB0ZXJyYWZvcm0h",
* security: {
* login: {
* password: "UHdkMTIzNDU2",
* },
* securityStrategies: ["Hids"],
* securityGroupIds: [fooSecurityGroup.id],
* },
* additionalContainerStorageEnabled: true,
* instanceChargeType: "PostPaid",
* namePrefix: "acc-test",
* ecsTags: [{
* key: "ecs_k1",
* value: "ecs_v1",
* }],
* },
* kubernetesConfig: {
* labels: [{
* key: "label1",
* value: "value1",
* }],
* taints: [{
* key: "taint-key/node-type",
* value: "taint-value",
* effect: "NoSchedule",
* }],
* cordon: true,
* },
* tags: [{
* key: "node-pool-k1",
* value: "node-pool-v1",
* }],
* });
* const fooInstance = new volcengine.ecs.Instance("fooInstance", {
* instanceName: "acc-test-ecs",
* hostName: "tf-acc-test",
* imageId: fooImages.then(fooImages => .filter(image => image.imageName == "veLinux 1.0 CentOS兼容版 64位").map(image => (image.imageId))[0]),
* instanceType: "ecs.g1ie.xlarge",
* password: "93f0cb0614Aab12",
* instanceChargeType: "PostPaid",
* systemVolumeType: "ESSD_PL0",
* systemVolumeSize: 50,
* dataVolumes: [{
* volumeType: "ESSD_PL0",
* size: 50,
* deleteWithInstance: true,
* }],
* subnetId: fooSubnet.id,
* securityGroupIds: [fooSecurityGroup.id],
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* const fooNode = new volcengine.vke.Node("fooNode", {
* clusterId: fooCluster.id,
* instanceId: fooInstance.id,
* nodePoolId: fooNodePool.id,
* });
* ```
*
* ## Import
*
* VKE node can be imported using the node id, e.g.
*
* ```sh
* $ pulumi import volcengine:vke/node:Node default nc5t5epmrsf****
* ```
*/
export declare class Node extends pulumi.CustomResource {
/**
* Get an existing Node resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NodeState, opts?: pulumi.CustomResourceOptions): Node;
/**
* Returns true if the given object is an instance of Node. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Node;
/**
* The flag of additional container storage enable, the value is `true` or `false`. This field is valid only when adding an existing instance to the default node pool.
*/
readonly additionalContainerStorageEnabled: pulumi.Output<boolean | undefined>;
/**
* The client token.
*/
readonly clientToken: pulumi.Output<string>;
/**
* The cluster id.
*/
readonly clusterId: pulumi.Output<string>;
/**
* The container storage path. This field is valid only when adding an existing instance to the default node pool.
*/
readonly containerStoragePath: pulumi.Output<string>;
/**
* The ImageId of NodeConfig. This field is valid only when adding an existing instance to the default node pool.
*/
readonly imageId: pulumi.Output<string>;
/**
* The initializeScript of Node. This field is valid only when adding an existing instance to the default node pool.
*/
readonly initializeScript: pulumi.Output<string>;
/**
* The instance id.
*/
readonly instanceId: pulumi.Output<string>;
/**
* The flag of keep instance name, the value is `true` or `false`.
*/
readonly keepInstanceName: pulumi.Output<boolean | undefined>;
/**
* The KubernetesConfig of Node. This field is valid only when adding an existing instance to the default node pool.
*/
readonly kubernetesConfig: pulumi.Output<outputs.vke.NodeKubernetesConfig>;
/**
* The node pool id. This field is used to specify the custom node pool to which you want to add nodes. If not filled in, it means added to the default node pool.
*/
readonly nodePoolId: pulumi.Output<string>;
/**
* The PreScript of Node. This field is valid only when adding an existing instance to the default node pool.
*/
readonly preScript: pulumi.Output<string>;
/**
* Create a Node resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: NodeArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Node resources.
*/
export interface NodeState {
/**
* The flag of additional container storage enable, the value is `true` or `false`. This field is valid only when adding an existing instance to the default node pool.
*/
additionalContainerStorageEnabled?: pulumi.Input<boolean>;
/**
* The client token.
*/
clientToken?: pulumi.Input<string>;
/**
* The cluster id.
*/
clusterId?: pulumi.Input<string>;
/**
* The container storage path. This field is valid only when adding an existing instance to the default node pool.
*/
containerStoragePath?: pulumi.Input<string>;
/**
* The ImageId of NodeConfig. This field is valid only when adding an existing instance to the default node pool.
*/
imageId?: pulumi.Input<string>;
/**
* The initializeScript of Node. This field is valid only when adding an existing instance to the default node pool.
*/
initializeScript?: pulumi.Input<string>;
/**
* The instance id.
*/
instanceId?: pulumi.Input<string>;
/**
* The flag of keep instance name, the value is `true` or `false`.
*/
keepInstanceName?: pulumi.Input<boolean>;
/**
* The KubernetesConfig of Node. This field is valid only when adding an existing instance to the default node pool.
*/
kubernetesConfig?: pulumi.Input<inputs.vke.NodeKubernetesConfig>;
/**
* The node pool id. This field is used to specify the custom node pool to which you want to add nodes. If not filled in, it means added to the default node pool.
*/
nodePoolId?: pulumi.Input<string>;
/**
* The PreScript of Node. This field is valid only when adding an existing instance to the default node pool.
*/
preScript?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Node resource.
*/
export interface NodeArgs {
/**
* The flag of additional container storage enable, the value is `true` or `false`. This field is valid only when adding an existing instance to the default node pool.
*/
additionalContainerStorageEnabled?: pulumi.Input<boolean>;
/**
* The client token.
*/
clientToken?: pulumi.Input<string>;
/**
* The cluster id.
*/
clusterId: pulumi.Input<string>;
/**
* The container storage path. This field is valid only when adding an existing instance to the default node pool.
*/
containerStoragePath?: pulumi.Input<string>;
/**
* The ImageId of NodeConfig. This field is valid only when adding an existing instance to the default node pool.
*/
imageId?: pulumi.Input<string>;
/**
* The initializeScript of Node. This field is valid only when adding an existing instance to the default node pool.
*/
initializeScript?: pulumi.Input<string>;
/**
* The instance id.
*/
instanceId: pulumi.Input<string>;
/**
* The flag of keep instance name, the value is `true` or `false`.
*/
keepInstanceName?: pulumi.Input<boolean>;
/**
* The KubernetesConfig of Node. This field is valid only when adding an existing instance to the default node pool.
*/
kubernetesConfig?: pulumi.Input<inputs.vke.NodeKubernetesConfig>;
/**
* The node pool id. This field is used to specify the custom node pool to which you want to add nodes. If not filled in, it means added to the default node pool.
*/
nodePoolId?: pulumi.Input<string>;
/**
* The PreScript of Node. This field is valid only when adding an existing instance to the default node pool.
*/
preScript?: pulumi.Input<string>;
}