@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
284 lines (283 loc) • 9.55 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* ## Example Usage
*
* Create a new VKE cluster:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const k8 = new vultr.Kubernetes("k8", {
* label: "vke-test",
* nodePools: {
* autoScaler: true,
* label: "vke-nodepool",
* labels: {
* "my-label": "a-label-on-all-nodes",
* "my-second-label": "another-label-on-all-nodes",
* },
* maxNodes: 2,
* minNodes: 1,
* nodeQuantity: 1,
* plan: "vc2-1c-2gb",
* taints: [{
* effect: "NoExecute",
* key: "a-taint",
* value: "is-tainted",
* }],
* },
* region: "ewr",
* version: "v1.28.2+1",
* });
* ```
*
* A default node pool is required when first creating the resource but it can be removed at a later point so long as there is a separate `vultr.KubernetesNodePools` resource attached. For example:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const k8 = new vultr.Kubernetes("k8", {
* region: "ewr",
* label: "vke-test",
* version: "v1.28.2+1",
* });
* // This resource must be created and attached to the cluster
* // before removing the default node from the vultr_kubernetes resource
* const np = new vultr.KubernetesNodePools("np", {
* clusterId: k8.id,
* nodeQuantity: 1,
* plan: "vc2-1c-2gb",
* label: "vke-nodepool",
* autoScaler: true,
* minNodes: 1,
* maxNodes: 2,
* });
* ```
*
* There is still a requirement that there be one node pool attached to the cluster but this should allow more flexibility about which node pool that is.
*
* ## Import
*
* A kubernetes cluster created outside of terraform can be imported into the
*
* terraform state using the UUID. One thing to note is that all kubernetes
*
* resources have a default node pool with a tag of `tf-vke-default`. In order to
*
* avoid errors, ensure that there is a node pool with that tag set.
*
* ```sh
* $ pulumi import vultr:index/kubernetes:Kubernetes my-k8s 7365a98b-5a43-450f-bd27-d768827100e5
* ```
*/
export declare class Kubernetes extends pulumi.CustomResource {
/**
* Get an existing Kubernetes 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?: KubernetesState, opts?: pulumi.CustomResourceOptions): Kubernetes;
/**
* Returns true if the given object is an instance of Kubernetes. 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 Kubernetes;
/**
* The base64 encoded public certificate used by clients to access the cluster.
*/
readonly clientCertificate: pulumi.Output<string>;
/**
* The base64 encoded private key used by clients to access the cluster.
*/
readonly clientKey: pulumi.Output<string>;
/**
* The base64 encoded public certificate for the cluster's certificate authority.
*/
readonly clusterCaCertificate: pulumi.Output<string>;
/**
* IP range that your pods will run on in this cluster.
*/
readonly clusterSubnet: pulumi.Output<string>;
/**
* Date node was created.
*/
readonly dateCreated: pulumi.Output<string>;
/**
* Boolean indicating if the cluster should be created with a managed firewall.
*/
readonly enableFirewall: pulumi.Output<boolean | undefined>;
/**
* Domain for your Kubernetes clusters control plane.
*/
readonly endpoint: pulumi.Output<string>;
/**
* The ID of the firewall group managed by this cluster.
*/
readonly firewallGroupId: pulumi.Output<string>;
/**
* Boolean indicating if the cluster should be created with multiple, highly available controlplanes.
*/
readonly haControlplanes: pulumi.Output<boolean | undefined>;
/**
* IP address of VKE cluster control plane.
*/
readonly ip: pulumi.Output<string>;
/**
* Base64 encoded Kubeconfig for this VKE cluster.
*/
readonly kubeConfig: pulumi.Output<string>;
/**
* The VKE clusters label.
*/
readonly label: pulumi.Output<string>;
/**
* Contains the default node pool that was deployed.
*/
readonly nodePools: pulumi.Output<outputs.KubernetesNodePools | undefined>;
/**
* The region your VKE cluster will be deployed in.
*/
readonly region: pulumi.Output<string>;
/**
* IP range that services will run on this cluster.
*/
readonly serviceSubnet: pulumi.Output<string>;
/**
* Status of node.
*/
readonly status: pulumi.Output<string>;
/**
* The version your VKE cluster you want deployed. [See Available Version](https://www.vultr.com/api/#operation/get-kubernetes-versions)
*/
readonly version: pulumi.Output<string>;
/**
* The ID of the VPC to use when creating the cluster. If not provided a new VPC will be created instead.
*/
readonly vpcId: pulumi.Output<string | undefined>;
/**
* Create a Kubernetes 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: KubernetesArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Kubernetes resources.
*/
export interface KubernetesState {
/**
* The base64 encoded public certificate used by clients to access the cluster.
*/
clientCertificate?: pulumi.Input<string>;
/**
* The base64 encoded private key used by clients to access the cluster.
*/
clientKey?: pulumi.Input<string>;
/**
* The base64 encoded public certificate for the cluster's certificate authority.
*/
clusterCaCertificate?: pulumi.Input<string>;
/**
* IP range that your pods will run on in this cluster.
*/
clusterSubnet?: pulumi.Input<string>;
/**
* Date node was created.
*/
dateCreated?: pulumi.Input<string>;
/**
* Boolean indicating if the cluster should be created with a managed firewall.
*/
enableFirewall?: pulumi.Input<boolean>;
/**
* Domain for your Kubernetes clusters control plane.
*/
endpoint?: pulumi.Input<string>;
/**
* The ID of the firewall group managed by this cluster.
*/
firewallGroupId?: pulumi.Input<string>;
/**
* Boolean indicating if the cluster should be created with multiple, highly available controlplanes.
*/
haControlplanes?: pulumi.Input<boolean>;
/**
* IP address of VKE cluster control plane.
*/
ip?: pulumi.Input<string>;
/**
* Base64 encoded Kubeconfig for this VKE cluster.
*/
kubeConfig?: pulumi.Input<string>;
/**
* The VKE clusters label.
*/
label?: pulumi.Input<string>;
/**
* Contains the default node pool that was deployed.
*/
nodePools?: pulumi.Input<inputs.KubernetesNodePools>;
/**
* The region your VKE cluster will be deployed in.
*/
region?: pulumi.Input<string>;
/**
* IP range that services will run on this cluster.
*/
serviceSubnet?: pulumi.Input<string>;
/**
* Status of node.
*/
status?: pulumi.Input<string>;
/**
* The version your VKE cluster you want deployed. [See Available Version](https://www.vultr.com/api/#operation/get-kubernetes-versions)
*/
version?: pulumi.Input<string>;
/**
* The ID of the VPC to use when creating the cluster. If not provided a new VPC will be created instead.
*/
vpcId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Kubernetes resource.
*/
export interface KubernetesArgs {
/**
* Boolean indicating if the cluster should be created with a managed firewall.
*/
enableFirewall?: pulumi.Input<boolean>;
/**
* Boolean indicating if the cluster should be created with multiple, highly available controlplanes.
*/
haControlplanes?: pulumi.Input<boolean>;
/**
* The VKE clusters label.
*/
label: pulumi.Input<string>;
/**
* Contains the default node pool that was deployed.
*/
nodePools?: pulumi.Input<inputs.KubernetesNodePools>;
/**
* The region your VKE cluster will be deployed in.
*/
region: pulumi.Input<string>;
/**
* The version your VKE cluster you want deployed. [See Available Version](https://www.vultr.com/api/#operation/get-kubernetes-versions)
*/
version: pulumi.Input<string>;
/**
* The ID of the VPC to use when creating the cluster. If not provided a new VPC will be created instead.
*/
vpcId?: pulumi.Input<string>;
}