Class KubernetesCluster
Provides a DigitalOcean Kubernetes cluster resource. This can be used to create, delete, and modify clusters. For more information see the official documentation.
Example Usage
Basic Example
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foo = new DigitalOcean.KubernetesCluster("foo", new DigitalOcean.KubernetesClusterArgs
{
NodePool = new DigitalOcean.Inputs.KubernetesClusterNodePoolArgs
{
Name = "worker-pool",
NodeCount = 3,
Size = "s-2vcpu-2gb",
},
Region = "nyc1",
Version = "1.15.5-do.1",
});
}
}
Autoscaling Example
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foo = new DigitalOcean.KubernetesCluster("foo", new DigitalOcean.KubernetesClusterArgs
{
NodePool = new DigitalOcean.Inputs.KubernetesClusterNodePoolArgs
{
AutoScale = true,
MaxNodes = 5,
MinNodes = 1,
Name = "autoscale-worker-pool",
Size = "s-2vcpu-2gb",
},
Region = "nyc1",
Version = "1.15.5-do.1",
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class KubernetesCluster : CustomResource
Constructors
View SourceKubernetesCluster(String, KubernetesClusterArgs, CustomResourceOptions)
Create a KubernetesCluster resource with the given unique name, arguments, and options.
Declaration
public KubernetesCluster(string name, KubernetesClusterArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| KubernetesClusterArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceClusterSubnet
The range of IP addresses in the overlay network of the Kubernetes cluster.
Declaration
public Output<string> ClusterSubnet { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreatedAt
The date and time when the Kubernetes cluster was created.
Declaration
public Output<string> CreatedAt { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Endpoint
The base URL of the API server on the Kubernetes master node.
Declaration
public Output<string> Endpoint { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Ipv4Address
The public IPv4 address of the Kubernetes master node.
Declaration
public Output<string> Ipv4Address { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KubeConfigs
Declaration
public Output<ImmutableArray<KubernetesClusterKubeConfig>> KubeConfigs { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<KubernetesClusterKubeConfig>> |
Name
A name for the Kubernetes cluster.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NodePool
A block representing the cluster's default node pool. Additional node pools may be added to the cluster using the digitalocean..KubernetesNodePool resource. The following arguments may be specified:
name- (Required) A name for the node pool.size- (Required) The slug identifier for the type of Droplet to be used as workers in the node pool.node_count- (Optional) The number of Droplet instances in the node pool. If auto-scaling is enabled, this should only be set if the desired result is to explicitly reset the number of nodes to this value. If auto-scaling is enabled, and the node count is outside of the given min/max range, it will use the min nodes value.auto_scale- (Optional) Enable auto-scaling of the number of nodes in the node pool within the given min/max range.min_nodes- (Optional) If auto-scaling is enabled, this represents the minimum number of nodes that the node pool can be scaled down to.max_nodes- (Optional) If auto-scaling is enabled, this represents the maximum number of nodes that the node pool can be scaled up to.tags- (Optional) A list of tag names to be applied to the Kubernetes cluster.labels- (Optional) A map of key/value pairs to apply to nodes in the pool. The labels are exposed in the Kubernetes API as labels in the metadata of the corresponding Node resources.
Declaration
public Output<KubernetesClusterNodePool> NodePool { get; }
Property Value
| Type | Description |
|---|---|
| Output<KubernetesClusterNodePool> |
Region
The slug identifier for the region where the Kubernetes cluster will be created.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ServiceSubnet
The range of assignable IP addresses for services running in the Kubernetes cluster.
Declaration
public Output<string> ServiceSubnet { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Status
A string indicating the current status of the cluster. Potential values include running, provisioning, and errored.
Declaration
public Output<string> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
A list of tag names to be applied to the Kubernetes cluster.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
UpdatedAt
The date and time when the Kubernetes cluster was last updated.
kube_config.0- A representation of the Kubernetes cluster's kubeconfig with the following attributes:
raw_config- The full contents of the Kubernetes cluster's kubeconfig file.host- The URL of the API server on the Kubernetes master node.cluster_ca_certificate- The base64 encoded public certificate for the cluster's certificate authority.token- The DigitalOcean API access token used by clients to access the cluster.client_key- The base64 encoded private key used by clients to access the cluster. Only available if token authentication is not supported on your cluster.client_certificate- The base64 encoded public certificate used by clients to access the cluster. Only available if token authentication is not supported on your cluster.expires_at- The date and time when the credentials will expire and need to be regenerated.
Declaration
public Output<string> UpdatedAt { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Version
The slug identifier for the version of Kubernetes used for the cluster. Use doctl to find the available versions doctl kubernetes options versions. (Note: A cluster may only be upgraded to newer versions in-place. If the version is decreased, a new resource will be created.)
Declaration
public Output<string> Version { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpcUuid
The ID of the VPC where the Kubernetes cluster will be located.
Declaration
public Output<string> VpcUuid { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, KubernetesClusterState, CustomResourceOptions)
Get an existing KubernetesCluster resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static KubernetesCluster Get(string name, Input<string> id, KubernetesClusterState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| KubernetesClusterState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| KubernetesCluster |