1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. K8sCluster
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.K8sCluster

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    Manages a Managed Kubernetes Cluster on IonosCloud.

    Example Usage

    Public cluster

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = new ionoscloud.K8sCluster("example", {
        apiSubnetAllowLists: ["1.2.3.4/32"],
        k8sVersion: "1.31.2",
        maintenanceWindow: {
            dayOfTheWeek: "Sunday",
            time: "09:00:00Z",
        },
        s3Buckets: [{
            name: "globally_unique_bucket_name",
        }],
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.K8sCluster("example",
        api_subnet_allow_lists=["1.2.3.4/32"],
        k8s_version="1.31.2",
        maintenance_window={
            "day_of_the_week": "Sunday",
            "time": "09:00:00Z",
        },
        s3_buckets=[{
            "name": "globally_unique_bucket_name",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.NewK8sCluster(ctx, "example", &ionoscloud.K8sClusterArgs{
    			ApiSubnetAllowLists: pulumi.StringArray{
    				pulumi.String("1.2.3.4/32"),
    			},
    			K8sVersion: pulumi.String("1.31.2"),
    			MaintenanceWindow: &ionoscloud.K8sClusterMaintenanceWindowArgs{
    				DayOfTheWeek: pulumi.String("Sunday"),
    				Time:         pulumi.String("09:00:00Z"),
    			},
    			S3Buckets: ionoscloud.K8sClusterS3BucketArray{
    				&ionoscloud.K8sClusterS3BucketArgs{
    					Name: pulumi.String("globally_unique_bucket_name"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Ionoscloud.K8sCluster("example", new()
        {
            ApiSubnetAllowLists = new[]
            {
                "1.2.3.4/32",
            },
            K8sVersion = "1.31.2",
            MaintenanceWindow = new Ionoscloud.Inputs.K8sClusterMaintenanceWindowArgs
            {
                DayOfTheWeek = "Sunday",
                Time = "09:00:00Z",
            },
            S3Buckets = new[]
            {
                new Ionoscloud.Inputs.K8sClusterS3BucketArgs
                {
                    Name = "globally_unique_bucket_name",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.K8sCluster;
    import com.pulumi.ionoscloud.K8sClusterArgs;
    import com.pulumi.ionoscloud.inputs.K8sClusterMaintenanceWindowArgs;
    import com.pulumi.ionoscloud.inputs.K8sClusterS3BucketArgs;
    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) {
            var example = new K8sCluster("example", K8sClusterArgs.builder()
                .apiSubnetAllowLists("1.2.3.4/32")
                .k8sVersion("1.31.2")
                .maintenanceWindow(K8sClusterMaintenanceWindowArgs.builder()
                    .dayOfTheWeek("Sunday")
                    .time("09:00:00Z")
                    .build())
                .s3Buckets(K8sClusterS3BucketArgs.builder()
                    .name("globally_unique_bucket_name")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:K8sCluster
        properties:
          apiSubnetAllowLists:
            - 1.2.3.4/32
          k8sVersion: 1.31.2
          maintenanceWindow:
            dayOfTheWeek: Sunday
            time: 09:00:00Z
          s3Buckets:
            - name: globally_unique_bucket_name
    

    Private Cluster

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const testdatacenter = new ionoscloud.Datacenter("testdatacenter", {
        location: "de/fra",
        description: "Test datacenter",
    });
    const k8sip = new ionoscloud.Ipblock("k8sip", {
        location: "de/fra",
        size: 1,
    });
    const example = new ionoscloud.K8sCluster("example", {
        k8sVersion: "1.31.2",
        maintenanceWindow: {
            dayOfTheWeek: "Sunday",
            time: "09:00:00Z",
        },
        apiSubnetAllowLists: ["1.2.3.4/32"],
        s3Buckets: [{
            name: "globally_unique_bucket_name",
        }],
        location: "de/fra",
        natGatewayIp: k8sip.ips[0],
        nodeSubnet: "192.168.0.0/16",
        "public": false,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    testdatacenter = ionoscloud.Datacenter("testdatacenter",
        location="de/fra",
        description="Test datacenter")
    k8sip = ionoscloud.Ipblock("k8sip",
        location="de/fra",
        size=1)
    example = ionoscloud.K8sCluster("example",
        k8s_version="1.31.2",
        maintenance_window={
            "day_of_the_week": "Sunday",
            "time": "09:00:00Z",
        },
        api_subnet_allow_lists=["1.2.3.4/32"],
        s3_buckets=[{
            "name": "globally_unique_bucket_name",
        }],
        location="de/fra",
        nat_gateway_ip=k8sip.ips[0],
        node_subnet="192.168.0.0/16",
        public=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.NewDatacenter(ctx, "testdatacenter", &ionoscloud.DatacenterArgs{
    			Location:    pulumi.String("de/fra"),
    			Description: pulumi.String("Test datacenter"),
    		})
    		if err != nil {
    			return err
    		}
    		k8sip, err := ionoscloud.NewIpblock(ctx, "k8sip", &ionoscloud.IpblockArgs{
    			Location: pulumi.String("de/fra"),
    			Size:     pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ionoscloud.NewK8sCluster(ctx, "example", &ionoscloud.K8sClusterArgs{
    			K8sVersion: pulumi.String("1.31.2"),
    			MaintenanceWindow: &ionoscloud.K8sClusterMaintenanceWindowArgs{
    				DayOfTheWeek: pulumi.String("Sunday"),
    				Time:         pulumi.String("09:00:00Z"),
    			},
    			ApiSubnetAllowLists: pulumi.StringArray{
    				pulumi.String("1.2.3.4/32"),
    			},
    			S3Buckets: ionoscloud.K8sClusterS3BucketArray{
    				&ionoscloud.K8sClusterS3BucketArgs{
    					Name: pulumi.String("globally_unique_bucket_name"),
    				},
    			},
    			Location: pulumi.String("de/fra"),
    			NatGatewayIp: k8sip.Ips.ApplyT(func(ips []string) (string, error) {
    				return ips[0], nil
    			}).(pulumi.StringOutput),
    			NodeSubnet: pulumi.String("192.168.0.0/16"),
    			Public:     pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var testdatacenter = new Ionoscloud.Datacenter("testdatacenter", new()
        {
            Location = "de/fra",
            Description = "Test datacenter",
        });
    
        var k8sip = new Ionoscloud.Ipblock("k8sip", new()
        {
            Location = "de/fra",
            Size = 1,
        });
    
        var example = new Ionoscloud.K8sCluster("example", new()
        {
            K8sVersion = "1.31.2",
            MaintenanceWindow = new Ionoscloud.Inputs.K8sClusterMaintenanceWindowArgs
            {
                DayOfTheWeek = "Sunday",
                Time = "09:00:00Z",
            },
            ApiSubnetAllowLists = new[]
            {
                "1.2.3.4/32",
            },
            S3Buckets = new[]
            {
                new Ionoscloud.Inputs.K8sClusterS3BucketArgs
                {
                    Name = "globally_unique_bucket_name",
                },
            },
            Location = "de/fra",
            NatGatewayIp = k8sip.Ips.Apply(ips => ips[0]),
            NodeSubnet = "192.168.0.0/16",
            Public = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.Datacenter;
    import com.pulumi.ionoscloud.DatacenterArgs;
    import com.pulumi.ionoscloud.Ipblock;
    import com.pulumi.ionoscloud.IpblockArgs;
    import com.pulumi.ionoscloud.K8sCluster;
    import com.pulumi.ionoscloud.K8sClusterArgs;
    import com.pulumi.ionoscloud.inputs.K8sClusterMaintenanceWindowArgs;
    import com.pulumi.ionoscloud.inputs.K8sClusterS3BucketArgs;
    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) {
            var testdatacenter = new Datacenter("testdatacenter", DatacenterArgs.builder()
                .location("de/fra")
                .description("Test datacenter")
                .build());
    
            var k8sip = new Ipblock("k8sip", IpblockArgs.builder()
                .location("de/fra")
                .size(1)
                .build());
    
            var example = new K8sCluster("example", K8sClusterArgs.builder()
                .k8sVersion("1.31.2")
                .maintenanceWindow(K8sClusterMaintenanceWindowArgs.builder()
                    .dayOfTheWeek("Sunday")
                    .time("09:00:00Z")
                    .build())
                .apiSubnetAllowLists("1.2.3.4/32")
                .s3Buckets(K8sClusterS3BucketArgs.builder()
                    .name("globally_unique_bucket_name")
                    .build())
                .location("de/fra")
                .natGatewayIp(k8sip.ips().applyValue(ips -> ips[0]))
                .nodeSubnet("192.168.0.0/16")
                .public_(false)
                .build());
    
        }
    }
    
    resources:
      testdatacenter:
        type: ionoscloud:Datacenter
        properties:
          location: de/fra
          description: Test datacenter
      k8sip:
        type: ionoscloud:Ipblock
        properties:
          location: de/fra
          size: 1
      example:
        type: ionoscloud:K8sCluster
        properties:
          k8sVersion: 1.31.2
          maintenanceWindow:
            dayOfTheWeek: Sunday
            time: 09:00:00Z
          apiSubnetAllowLists:
            - 1.2.3.4/32
          s3Buckets:
            - name: globally_unique_bucket_name
          location: de/fra
          natGatewayIp: ${k8sip.ips[0]}
          nodeSubnet: 192.168.0.0/16
          public: false
    

    Create K8sCluster Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new K8sCluster(name: string, args?: K8sClusterArgs, opts?: CustomResourceOptions);
    @overload
    def K8sCluster(resource_name: str,
                   args: Optional[K8sClusterArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def K8sCluster(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   allow_replace: Optional[bool] = None,
                   api_subnet_allow_lists: Optional[Sequence[str]] = None,
                   k8s_cluster_id: Optional[str] = None,
                   k8s_version: Optional[str] = None,
                   location: Optional[str] = None,
                   maintenance_window: Optional[K8sClusterMaintenanceWindowArgs] = None,
                   name: Optional[str] = None,
                   nat_gateway_ip: Optional[str] = None,
                   node_subnet: Optional[str] = None,
                   public: Optional[bool] = None,
                   s3_buckets: Optional[Sequence[K8sClusterS3BucketArgs]] = None,
                   timeouts: Optional[K8sClusterTimeoutsArgs] = None)
    func NewK8sCluster(ctx *Context, name string, args *K8sClusterArgs, opts ...ResourceOption) (*K8sCluster, error)
    public K8sCluster(string name, K8sClusterArgs? args = null, CustomResourceOptions? opts = null)
    public K8sCluster(String name, K8sClusterArgs args)
    public K8sCluster(String name, K8sClusterArgs args, CustomResourceOptions options)
    
    type: ionoscloud:K8sCluster
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args K8sClusterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args K8sClusterArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args K8sClusterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args K8sClusterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args K8sClusterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var k8sClusterResource = new Ionoscloud.K8sCluster("k8sClusterResource", new()
    {
        AllowReplace = false,
        ApiSubnetAllowLists = new[]
        {
            "string",
        },
        K8sClusterId = "string",
        K8sVersion = "string",
        Location = "string",
        MaintenanceWindow = new Ionoscloud.Inputs.K8sClusterMaintenanceWindowArgs
        {
            DayOfTheWeek = "string",
            Time = "string",
        },
        Name = "string",
        NatGatewayIp = "string",
        NodeSubnet = "string",
        Public = false,
        S3Buckets = new[]
        {
            new Ionoscloud.Inputs.K8sClusterS3BucketArgs
            {
                Name = "string",
            },
        },
        Timeouts = new Ionoscloud.Inputs.K8sClusterTimeoutsArgs
        {
            Create = "string",
            Default = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ionoscloud.NewK8sCluster(ctx, "k8sClusterResource", &ionoscloud.K8sClusterArgs{
    	AllowReplace: pulumi.Bool(false),
    	ApiSubnetAllowLists: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	K8sClusterId: pulumi.String("string"),
    	K8sVersion:   pulumi.String("string"),
    	Location:     pulumi.String("string"),
    	MaintenanceWindow: &ionoscloud.K8sClusterMaintenanceWindowArgs{
    		DayOfTheWeek: pulumi.String("string"),
    		Time:         pulumi.String("string"),
    	},
    	Name:         pulumi.String("string"),
    	NatGatewayIp: pulumi.String("string"),
    	NodeSubnet:   pulumi.String("string"),
    	Public:       pulumi.Bool(false),
    	S3Buckets: ionoscloud.K8sClusterS3BucketArray{
    		&ionoscloud.K8sClusterS3BucketArgs{
    			Name: pulumi.String("string"),
    		},
    	},
    	Timeouts: &ionoscloud.K8sClusterTimeoutsArgs{
    		Create:  pulumi.String("string"),
    		Default: pulumi.String("string"),
    		Delete:  pulumi.String("string"),
    		Update:  pulumi.String("string"),
    	},
    })
    
    var k8sClusterResource = new K8sCluster("k8sClusterResource", K8sClusterArgs.builder()
        .allowReplace(false)
        .apiSubnetAllowLists("string")
        .k8sClusterId("string")
        .k8sVersion("string")
        .location("string")
        .maintenanceWindow(K8sClusterMaintenanceWindowArgs.builder()
            .dayOfTheWeek("string")
            .time("string")
            .build())
        .name("string")
        .natGatewayIp("string")
        .nodeSubnet("string")
        .public_(false)
        .s3Buckets(K8sClusterS3BucketArgs.builder()
            .name("string")
            .build())
        .timeouts(K8sClusterTimeoutsArgs.builder()
            .create("string")
            .default_("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    k8s_cluster_resource = ionoscloud.K8sCluster("k8sClusterResource",
        allow_replace=False,
        api_subnet_allow_lists=["string"],
        k8s_cluster_id="string",
        k8s_version="string",
        location="string",
        maintenance_window={
            "day_of_the_week": "string",
            "time": "string",
        },
        name="string",
        nat_gateway_ip="string",
        node_subnet="string",
        public=False,
        s3_buckets=[{
            "name": "string",
        }],
        timeouts={
            "create": "string",
            "default": "string",
            "delete": "string",
            "update": "string",
        })
    
    const k8sClusterResource = new ionoscloud.K8sCluster("k8sClusterResource", {
        allowReplace: false,
        apiSubnetAllowLists: ["string"],
        k8sClusterId: "string",
        k8sVersion: "string",
        location: "string",
        maintenanceWindow: {
            dayOfTheWeek: "string",
            time: "string",
        },
        name: "string",
        natGatewayIp: "string",
        nodeSubnet: "string",
        "public": false,
        s3Buckets: [{
            name: "string",
        }],
        timeouts: {
            create: "string",
            "default": "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: ionoscloud:K8sCluster
    properties:
        allowReplace: false
        apiSubnetAllowLists:
            - string
        k8sClusterId: string
        k8sVersion: string
        location: string
        maintenanceWindow:
            dayOfTheWeek: string
            time: string
        name: string
        natGatewayIp: string
        nodeSubnet: string
        public: false
        s3Buckets:
            - name: string
        timeouts:
            create: string
            default: string
            delete: string
            update: string
    

    K8sCluster Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The K8sCluster resource accepts the following input properties:

    AllowReplace bool

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    ApiSubnetAllowLists List<string>
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    K8sClusterId string
    K8sVersion string
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    Location string
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    MaintenanceWindow K8sClusterMaintenanceWindow
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    Name string
    [string] The name of the Kubernetes Cluster.
    NatGatewayIp string
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    NodeSubnet string
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    Public bool
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    S3Buckets List<K8sClusterS3Bucket>
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    Timeouts K8sClusterTimeouts
    AllowReplace bool

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    ApiSubnetAllowLists []string
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    K8sClusterId string
    K8sVersion string
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    Location string
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    MaintenanceWindow K8sClusterMaintenanceWindowArgs
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    Name string
    [string] The name of the Kubernetes Cluster.
    NatGatewayIp string
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    NodeSubnet string
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    Public bool
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    S3Buckets []K8sClusterS3BucketArgs
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    Timeouts K8sClusterTimeoutsArgs
    allowReplace Boolean

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    apiSubnetAllowLists List<String>
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8sClusterId String
    k8sVersion String
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location String
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenanceWindow K8sClusterMaintenanceWindow
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name String
    [string] The name of the Kubernetes Cluster.
    natGatewayIp String
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    nodeSubnet String
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public_ Boolean
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3Buckets List<K8sClusterS3Bucket>
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts K8sClusterTimeouts
    allowReplace boolean

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    apiSubnetAllowLists string[]
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8sClusterId string
    k8sVersion string
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location string
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenanceWindow K8sClusterMaintenanceWindow
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name string
    [string] The name of the Kubernetes Cluster.
    natGatewayIp string
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    nodeSubnet string
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public boolean
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3Buckets K8sClusterS3Bucket[]
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts K8sClusterTimeouts
    allow_replace bool

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    api_subnet_allow_lists Sequence[str]
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8s_cluster_id str
    k8s_version str
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location str
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenance_window K8sClusterMaintenanceWindowArgs
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name str
    [string] The name of the Kubernetes Cluster.
    nat_gateway_ip str
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    node_subnet str
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public bool
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3_buckets Sequence[K8sClusterS3BucketArgs]
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts K8sClusterTimeoutsArgs
    allowReplace Boolean

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    apiSubnetAllowLists List<String>
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8sClusterId String
    k8sVersion String
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location String
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenanceWindow Property Map
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name String
    [string] The name of the Kubernetes Cluster.
    natGatewayIp String
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    nodeSubnet String
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public Boolean
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3Buckets List<Property Map>
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the K8sCluster resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    ViableNodePoolVersions List<string>
    [list] List of versions that may be used for node pools under this cluster
    Id string
    The provider-assigned unique ID for this managed resource.
    ViableNodePoolVersions []string
    [list] List of versions that may be used for node pools under this cluster
    id String
    The provider-assigned unique ID for this managed resource.
    viableNodePoolVersions List<String>
    [list] List of versions that may be used for node pools under this cluster
    id string
    The provider-assigned unique ID for this managed resource.
    viableNodePoolVersions string[]
    [list] List of versions that may be used for node pools under this cluster
    id str
    The provider-assigned unique ID for this managed resource.
    viable_node_pool_versions Sequence[str]
    [list] List of versions that may be used for node pools under this cluster
    id String
    The provider-assigned unique ID for this managed resource.
    viableNodePoolVersions List<String>
    [list] List of versions that may be used for node pools under this cluster

    Look up Existing K8sCluster Resource

    Get an existing K8sCluster resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: K8sClusterState, opts?: CustomResourceOptions): K8sCluster
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allow_replace: Optional[bool] = None,
            api_subnet_allow_lists: Optional[Sequence[str]] = None,
            k8s_cluster_id: Optional[str] = None,
            k8s_version: Optional[str] = None,
            location: Optional[str] = None,
            maintenance_window: Optional[K8sClusterMaintenanceWindowArgs] = None,
            name: Optional[str] = None,
            nat_gateway_ip: Optional[str] = None,
            node_subnet: Optional[str] = None,
            public: Optional[bool] = None,
            s3_buckets: Optional[Sequence[K8sClusterS3BucketArgs]] = None,
            timeouts: Optional[K8sClusterTimeoutsArgs] = None,
            viable_node_pool_versions: Optional[Sequence[str]] = None) -> K8sCluster
    func GetK8sCluster(ctx *Context, name string, id IDInput, state *K8sClusterState, opts ...ResourceOption) (*K8sCluster, error)
    public static K8sCluster Get(string name, Input<string> id, K8sClusterState? state, CustomResourceOptions? opts = null)
    public static K8sCluster get(String name, Output<String> id, K8sClusterState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:K8sCluster    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AllowReplace bool

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    ApiSubnetAllowLists List<string>
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    K8sClusterId string
    K8sVersion string
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    Location string
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    MaintenanceWindow K8sClusterMaintenanceWindow
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    Name string
    [string] The name of the Kubernetes Cluster.
    NatGatewayIp string
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    NodeSubnet string
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    Public bool
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    S3Buckets List<K8sClusterS3Bucket>
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    Timeouts K8sClusterTimeouts
    ViableNodePoolVersions List<string>
    [list] List of versions that may be used for node pools under this cluster
    AllowReplace bool

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    ApiSubnetAllowLists []string
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    K8sClusterId string
    K8sVersion string
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    Location string
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    MaintenanceWindow K8sClusterMaintenanceWindowArgs
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    Name string
    [string] The name of the Kubernetes Cluster.
    NatGatewayIp string
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    NodeSubnet string
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    Public bool
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    S3Buckets []K8sClusterS3BucketArgs
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    Timeouts K8sClusterTimeoutsArgs
    ViableNodePoolVersions []string
    [list] List of versions that may be used for node pools under this cluster
    allowReplace Boolean

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    apiSubnetAllowLists List<String>
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8sClusterId String
    k8sVersion String
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location String
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenanceWindow K8sClusterMaintenanceWindow
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name String
    [string] The name of the Kubernetes Cluster.
    natGatewayIp String
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    nodeSubnet String
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public_ Boolean
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3Buckets List<K8sClusterS3Bucket>
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts K8sClusterTimeouts
    viableNodePoolVersions List<String>
    [list] List of versions that may be used for node pools under this cluster
    allowReplace boolean

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    apiSubnetAllowLists string[]
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8sClusterId string
    k8sVersion string
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location string
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenanceWindow K8sClusterMaintenanceWindow
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name string
    [string] The name of the Kubernetes Cluster.
    natGatewayIp string
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    nodeSubnet string
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public boolean
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3Buckets K8sClusterS3Bucket[]
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts K8sClusterTimeouts
    viableNodePoolVersions string[]
    [list] List of versions that may be used for node pools under this cluster
    allow_replace bool

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    api_subnet_allow_lists Sequence[str]
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8s_cluster_id str
    k8s_version str
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location str
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenance_window K8sClusterMaintenanceWindowArgs
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name str
    [string] The name of the Kubernetes Cluster.
    nat_gateway_ip str
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    node_subnet str
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public bool
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3_buckets Sequence[K8sClusterS3BucketArgs]
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts K8sClusterTimeoutsArgs
    viable_node_pool_versions Sequence[str]
    [list] List of versions that may be used for node pools under this cluster
    allowReplace Boolean

    [bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the cluster.

    ⚠️ Warning: allow_replace - lets you update immutable fields, but it first destroys and then re-creates the cluster in order to do it. Set the field to true only if you know what you are doing.

    apiSubnetAllowLists List<String>
    [list] Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
    k8sClusterId String
    k8sVersion String
    [string] The desired Kubernetes Version. For supported values, please check the API documentation. Downgrades are not supported. The provider will ignore downgrades of patch level.
    location String
    [string] This attribute is mandatory if the cluster is private. The location must be enabled for your contract, or you must have a data center at that location. This property is not adjustable.
    maintenanceWindow Property Map
    A maintenance window comprise of a day of the week and a time for maintenance to be allowed
    name String
    [string] The name of the Kubernetes Cluster.
    natGatewayIp String
    [string] The NAT gateway IP of the cluster if the cluster is private. This attribute is immutable. Must be a reserved IP in the same location as the cluster's location. This attribute is mandatory if the cluster is private.
    nodeSubnet String
    [string] The node subnet of the cluster, if the cluster is private. This attribute is optional and immutable. Must be a valid CIDR notation for an IPv4 network prefix of 16 bits length.
    public Boolean
    [boolean] Indicates if the cluster is public or private. This attribute is immutable.
    s3Buckets List<Property Map>
    [list] List of IONOS Object Storage buckets configured for K8s usage. For now it contains only an IONOS Object Storage bucket used to store K8s API audit logs.
    timeouts Property Map
    viableNodePoolVersions List<String>
    [list] List of versions that may be used for node pools under this cluster

    Supporting Types

    K8sClusterMaintenanceWindow, K8sClusterMaintenanceWindowArgs

    DayOfTheWeek string
    [string] Day of the week when maintenance is allowed
    Time string
    [string] A clock time in the day when maintenance is allowed
    DayOfTheWeek string
    [string] Day of the week when maintenance is allowed
    Time string
    [string] A clock time in the day when maintenance is allowed
    dayOfTheWeek String
    [string] Day of the week when maintenance is allowed
    time String
    [string] A clock time in the day when maintenance is allowed
    dayOfTheWeek string
    [string] Day of the week when maintenance is allowed
    time string
    [string] A clock time in the day when maintenance is allowed
    day_of_the_week str
    [string] Day of the week when maintenance is allowed
    time str
    [string] A clock time in the day when maintenance is allowed
    dayOfTheWeek String
    [string] Day of the week when maintenance is allowed
    time String
    [string] A clock time in the day when maintenance is allowed

    K8sClusterS3Bucket, K8sClusterS3BucketArgs

    Name string
    [string] The name of the Kubernetes Cluster.
    Name string
    [string] The name of the Kubernetes Cluster.
    name String
    [string] The name of the Kubernetes Cluster.
    name string
    [string] The name of the Kubernetes Cluster.
    name str
    [string] The name of the Kubernetes Cluster.
    name String
    [string] The name of the Kubernetes Cluster.

    K8sClusterTimeouts, K8sClusterTimeoutsArgs

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Import

    A Kubernetes Cluster resource can be imported using its resource id, e.g.

    $ pulumi import ionoscloud:index/k8sCluster:K8sCluster demo k8s_cluster uuid
    

    This can be helpful when you want to import kubernetes clusters which you have already created manually or using other means, outside of terraform.

    ⚠️ **_Warning: **During a maintenance window, k8s can update your k8s_version if the old one reaches end of life. This upgrade will not be shown in the plan, as we prevent

    terraform from doing a downgrade, as downgrading k8s_version is not supported._**

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud