@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
240 lines (239 loc) • 8.84 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* This resource represents a [Managed Kubernetes](https://upcloud.com/products/managed-kubernetes) cluster.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Create a network for the Kubernetes cluster
* const example = new upcloud.Network("example", {
* name: "example-network",
* zone: "de-fra1",
* ipNetwork: {
* address: "172.16.1.0/24",
* dhcp: true,
* family: "IPv4",
* },
* });
* // Create a Kubernetes cluster
* const exampleKubernetesCluster = new upcloud.KubernetesCluster("example", {
* controlPlaneIpFilters: ["0.0.0.0/0"],
* name: "exampleapp",
* network: example.id,
* zone: "de-fra1",
* });
* // Kubernetes cluster with private node groups requires a network that is routed through NAT gateway.
* const example2 = new upcloud.Router("example2", {name: "example2-router"});
* const example2Gateway = new upcloud.Gateway("example2", {
* name: "example2-nat-gateway",
* zone: "de-fra1",
* features: ["nat"],
* router: {
* id: example2.id,
* },
* });
* const example2Network = new upcloud.Network("example2", {
* name: "example2-network",
* zone: "de-fra1",
* ipNetwork: {
* address: "10.10.0.0/24",
* dhcp: true,
* family: "IPv4",
* dhcpDefaultRoute: true,
* },
* router: example2.id,
* });
* const example2KubernetesCluster = new upcloud.KubernetesCluster("example2", {
* name: "example2-cluster",
* network: example2Network.id,
* zone: "de-fra1",
* plan: "production-small",
* privateNodeGroups: true,
* });
* ```
*/
export declare class KubernetesCluster extends pulumi.CustomResource {
/**
* Get an existing KubernetesCluster 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?: KubernetesClusterState, opts?: pulumi.CustomResourceOptions): KubernetesCluster;
/**
* Returns true if the given object is an instance of KubernetesCluster. 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 KubernetesCluster;
/**
* IP addresses or IP ranges in CIDR format which are allowed to access the cluster control plane. To allow access from any
* source, use `["0.0.0.0/0"]`. To deny access from all sources, use `[]`. Values set here do not restrict access to node
* groups or exposed Kubernetes services.
*/
readonly controlPlaneIpFilters: pulumi.Output<string[]>;
/**
* User defined key-value pairs to classify the cluster.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
}>;
/**
* Cluster name. Needs to be unique within the account.
*/
readonly name: pulumi.Output<string>;
/**
* Network ID for the cluster to run in.
*/
readonly network: pulumi.Output<string>;
/**
* Network CIDR for the given network. Computed automatically.
*/
readonly networkCidr: pulumi.Output<string>;
/**
* Names of the node groups configured to cluster
*/
readonly nodeGroups: pulumi.Output<string[]>;
/**
* The pricing plan used for the cluster. You can list available plans with `upctl kubernetes plans`.
*/
readonly plan: pulumi.Output<string>;
/**
* Enable private node groups. Private node groups requires a network that is routed through NAT gateway.
*/
readonly privateNodeGroups: pulumi.Output<boolean>;
/**
* Operational state of the cluster.
*/
readonly state: pulumi.Output<string>;
/**
* Set default storage encryption strategy for all nodes in the cluster.
*/
readonly storageEncryption: pulumi.Output<string | undefined>;
/**
* Kubernetes version ID, e.g. `1.30`. You can list available version IDs with `upctl kubernetes versions`.
*/
readonly version: pulumi.Output<string>;
/**
* Zone in which the Kubernetes cluster will be hosted, e.g. `de-fra1`. You can list available zones with `upctl zone
* list`.
*/
readonly zone: pulumi.Output<string>;
/**
* Create a KubernetesCluster 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: KubernetesClusterArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering KubernetesCluster resources.
*/
export interface KubernetesClusterState {
/**
* IP addresses or IP ranges in CIDR format which are allowed to access the cluster control plane. To allow access from any
* source, use `["0.0.0.0/0"]`. To deny access from all sources, use `[]`. Values set here do not restrict access to node
* groups or exposed Kubernetes services.
*/
controlPlaneIpFilters?: pulumi.Input<pulumi.Input<string>[]>;
/**
* User defined key-value pairs to classify the cluster.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Cluster name. Needs to be unique within the account.
*/
name?: pulumi.Input<string>;
/**
* Network ID for the cluster to run in.
*/
network?: pulumi.Input<string>;
/**
* Network CIDR for the given network. Computed automatically.
*/
networkCidr?: pulumi.Input<string>;
/**
* Names of the node groups configured to cluster
*/
nodeGroups?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The pricing plan used for the cluster. You can list available plans with `upctl kubernetes plans`.
*/
plan?: pulumi.Input<string>;
/**
* Enable private node groups. Private node groups requires a network that is routed through NAT gateway.
*/
privateNodeGroups?: pulumi.Input<boolean>;
/**
* Operational state of the cluster.
*/
state?: pulumi.Input<string>;
/**
* Set default storage encryption strategy for all nodes in the cluster.
*/
storageEncryption?: pulumi.Input<string>;
/**
* Kubernetes version ID, e.g. `1.30`. You can list available version IDs with `upctl kubernetes versions`.
*/
version?: pulumi.Input<string>;
/**
* Zone in which the Kubernetes cluster will be hosted, e.g. `de-fra1`. You can list available zones with `upctl zone
* list`.
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a KubernetesCluster resource.
*/
export interface KubernetesClusterArgs {
/**
* IP addresses or IP ranges in CIDR format which are allowed to access the cluster control plane. To allow access from any
* source, use `["0.0.0.0/0"]`. To deny access from all sources, use `[]`. Values set here do not restrict access to node
* groups or exposed Kubernetes services.
*/
controlPlaneIpFilters: pulumi.Input<pulumi.Input<string>[]>;
/**
* User defined key-value pairs to classify the cluster.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Cluster name. Needs to be unique within the account.
*/
name?: pulumi.Input<string>;
/**
* Network ID for the cluster to run in.
*/
network: pulumi.Input<string>;
/**
* The pricing plan used for the cluster. You can list available plans with `upctl kubernetes plans`.
*/
plan?: pulumi.Input<string>;
/**
* Enable private node groups. Private node groups requires a network that is routed through NAT gateway.
*/
privateNodeGroups?: pulumi.Input<boolean>;
/**
* Set default storage encryption strategy for all nodes in the cluster.
*/
storageEncryption?: pulumi.Input<string>;
/**
* Kubernetes version ID, e.g. `1.30`. You can list available version IDs with `upctl kubernetes versions`.
*/
version?: pulumi.Input<string>;
/**
* Zone in which the Kubernetes cluster will be hosted, e.g. `de-fra1`. You can list available zones with `upctl zone
* list`.
*/
zone: pulumi.Input<string>;
}