1. Packages
  2. Gcore Provider
  3. API Docs
  4. getK8sv2
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

gcore.getK8sv2

Explore with Pulumi AI

gcore logo
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

    Represent k8s cluster with one default pool.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const pr = gcore.getProject({
        name: "test",
    });
    const rg = gcore.getRegion({
        name: "ED-10 Preprod",
    });
    const k8sv2 = Promise.all([rg, pr]).then(([rg, pr]) => gcore.getK8sv2({
        name: "cluster1",
        regionId: rg.id,
        projectId: pr.id,
    }));
    export const view = k8sv2;
    
    import pulumi
    import pulumi_gcore as gcore
    
    pr = gcore.get_project(name="test")
    rg = gcore.get_region(name="ED-10 Preprod")
    k8sv2 = gcore.get_k8sv2(name="cluster1",
        region_id=rg.id,
        project_id=pr.id)
    pulumi.export("view", k8sv2)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		pr, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
    			Name: "test",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		rg, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
    			Name: "ED-10 Preprod",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		k8sv2, err := gcore.LookupK8sv2(ctx, &gcore.LookupK8sv2Args{
    			Name:      "cluster1",
    			RegionId:  pulumi.Float64Ref(rg.Id),
    			ProjectId: pulumi.Float64Ref(pr.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("view", k8sv2)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var pr = Gcore.GetProject.Invoke(new()
        {
            Name = "test",
        });
    
        var rg = Gcore.GetRegion.Invoke(new()
        {
            Name = "ED-10 Preprod",
        });
    
        var k8sv2 = Gcore.GetK8sv2.Invoke(new()
        {
            Name = "cluster1",
            RegionId = rg.Apply(getRegionResult => getRegionResult.Id),
            ProjectId = pr.Apply(getProjectResult => getProjectResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["view"] = k8sv2,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetProjectArgs;
    import com.pulumi.gcore.inputs.GetRegionArgs;
    import com.pulumi.gcore.inputs.GetK8sv2Args;
    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) {
            final var pr = GcoreFunctions.getProject(GetProjectArgs.builder()
                .name("test")
                .build());
    
            final var rg = GcoreFunctions.getRegion(GetRegionArgs.builder()
                .name("ED-10 Preprod")
                .build());
    
            final var k8sv2 = GcoreFunctions.getK8sv2(GetK8sv2Args.builder()
                .name("cluster1")
                .regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
                .projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
                .build());
    
            ctx.export("view", k8sv2.applyValue(getK8sv2Result -> getK8sv2Result));
        }
    }
    
    variables:
      pr:
        fn::invoke:
          function: gcore:getProject
          arguments:
            name: test
      rg:
        fn::invoke:
          function: gcore:getRegion
          arguments:
            name: ED-10 Preprod
      k8sv2:
        fn::invoke:
          function: gcore:getK8sv2
          arguments:
            name: cluster1
            regionId: ${rg.id}
            projectId: ${pr.id}
    outputs:
      view: ${k8sv2}
    

    Using getK8sv2

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getK8sv2(args: GetK8sv2Args, opts?: InvokeOptions): Promise<GetK8sv2Result>
    function getK8sv2Output(args: GetK8sv2OutputArgs, opts?: InvokeOptions): Output<GetK8sv2Result>
    def get_k8sv2(id: Optional[str] = None,
                  name: Optional[str] = None,
                  project_id: Optional[float] = None,
                  project_name: Optional[str] = None,
                  region_id: Optional[float] = None,
                  region_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetK8sv2Result
    def get_k8sv2_output(id: Optional[pulumi.Input[str]] = None,
                  name: Optional[pulumi.Input[str]] = None,
                  project_id: Optional[pulumi.Input[float]] = None,
                  project_name: Optional[pulumi.Input[str]] = None,
                  region_id: Optional[pulumi.Input[float]] = None,
                  region_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetK8sv2Result]
    func LookupK8sv2(ctx *Context, args *LookupK8sv2Args, opts ...InvokeOption) (*LookupK8sv2Result, error)
    func LookupK8sv2Output(ctx *Context, args *LookupK8sv2OutputArgs, opts ...InvokeOption) LookupK8sv2ResultOutput

    > Note: This function is named LookupK8sv2 in the Go SDK.

    public static class GetK8sv2 
    {
        public static Task<GetK8sv2Result> InvokeAsync(GetK8sv2Args args, InvokeOptions? opts = null)
        public static Output<GetK8sv2Result> Invoke(GetK8sv2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetK8sv2Result> getK8sv2(GetK8sv2Args args, InvokeOptions options)
    public static Output<GetK8sv2Result> getK8sv2(GetK8sv2Args args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getK8sv2:getK8sv2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Id string
    The ID of this resource.
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    Name string
    Id string
    The ID of this resource.
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    name String
    id String
    The ID of this resource.
    projectId Double
    projectName String
    regionId Double
    regionName String
    name string
    id string
    The ID of this resource.
    projectId number
    projectName string
    regionId number
    regionName string
    name str
    id str
    The ID of this resource.
    project_id float
    project_name str
    region_id float
    region_name str
    name String
    id String
    The ID of this resource.
    projectId Number
    projectName String
    regionId Number
    regionName String

    getK8sv2 Result

    The following output properties are available:

    Authentications List<GetK8sv2Authentication>
    Cluster authentication configuration.
    AutoscalerConfig Dictionary<string, string>
    Cluster autoscaler configuration params. Keys and values are expected to follow the cluster-autoscaler option format.
    Cnis List<GetK8sv2Cni>
    Cluster CNI configuration.
    CreatedAt string
    CreatorTaskId string
    FixedNetwork string
    FixedSubnet string
    FlavorId string
    Id string
    The ID of this resource.
    IsIpv6 bool
    Enable public IPv6 address.
    IsPublic bool
    Keypair string
    Name string
    NodeCount double
    PodsIpPool string
    Pods IPv4 IP pool in CIDR notation.
    PodsIpv6Pool string
    Pods IPv6 IP pool in CIDR notation.
    Pools List<GetK8sv2Pool>
    ServicesIpPool string
    Services IPv4 IP pool in CIDR notation.
    ServicesIpv6Pool string
    Services IPv6 IP pool in CIDR notation.
    Status string
    TaskId string
    Version string
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    Authentications []GetK8sv2Authentication
    Cluster authentication configuration.
    AutoscalerConfig map[string]string
    Cluster autoscaler configuration params. Keys and values are expected to follow the cluster-autoscaler option format.
    Cnis []GetK8sv2Cni
    Cluster CNI configuration.
    CreatedAt string
    CreatorTaskId string
    FixedNetwork string
    FixedSubnet string
    FlavorId string
    Id string
    The ID of this resource.
    IsIpv6 bool
    Enable public IPv6 address.
    IsPublic bool
    Keypair string
    Name string
    NodeCount float64
    PodsIpPool string
    Pods IPv4 IP pool in CIDR notation.
    PodsIpv6Pool string
    Pods IPv6 IP pool in CIDR notation.
    Pools []GetK8sv2Pool
    ServicesIpPool string
    Services IPv4 IP pool in CIDR notation.
    ServicesIpv6Pool string
    Services IPv6 IP pool in CIDR notation.
    Status string
    TaskId string
    Version string
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    authentications List<GetK8sv2Authentication>
    Cluster authentication configuration.
    autoscalerConfig Map<String,String>
    Cluster autoscaler configuration params. Keys and values are expected to follow the cluster-autoscaler option format.
    cnis List<GetK8sv2Cni>
    Cluster CNI configuration.
    createdAt String
    creatorTaskId String
    fixedNetwork String
    fixedSubnet String
    flavorId String
    id String
    The ID of this resource.
    isIpv6 Boolean
    Enable public IPv6 address.
    isPublic Boolean
    keypair String
    name String
    nodeCount Double
    podsIpPool String
    Pods IPv4 IP pool in CIDR notation.
    podsIpv6Pool String
    Pods IPv6 IP pool in CIDR notation.
    pools List<GetK8sv2Pool>
    servicesIpPool String
    Services IPv4 IP pool in CIDR notation.
    servicesIpv6Pool String
    Services IPv6 IP pool in CIDR notation.
    status String
    taskId String
    version String
    projectId Double
    projectName String
    regionId Double
    regionName String
    authentications GetK8sv2Authentication[]
    Cluster authentication configuration.
    autoscalerConfig {[key: string]: string}
    Cluster autoscaler configuration params. Keys and values are expected to follow the cluster-autoscaler option format.
    cnis GetK8sv2Cni[]
    Cluster CNI configuration.
    createdAt string
    creatorTaskId string
    fixedNetwork string
    fixedSubnet string
    flavorId string
    id string
    The ID of this resource.
    isIpv6 boolean
    Enable public IPv6 address.
    isPublic boolean
    keypair string
    name string
    nodeCount number
    podsIpPool string
    Pods IPv4 IP pool in CIDR notation.
    podsIpv6Pool string
    Pods IPv6 IP pool in CIDR notation.
    pools GetK8sv2Pool[]
    servicesIpPool string
    Services IPv4 IP pool in CIDR notation.
    servicesIpv6Pool string
    Services IPv6 IP pool in CIDR notation.
    status string
    taskId string
    version string
    projectId number
    projectName string
    regionId number
    regionName string
    authentications Sequence[GetK8sv2Authentication]
    Cluster authentication configuration.
    autoscaler_config Mapping[str, str]
    Cluster autoscaler configuration params. Keys and values are expected to follow the cluster-autoscaler option format.
    cnis Sequence[GetK8sv2Cni]
    Cluster CNI configuration.
    created_at str
    creator_task_id str
    fixed_network str
    fixed_subnet str
    flavor_id str
    id str
    The ID of this resource.
    is_ipv6 bool
    Enable public IPv6 address.
    is_public bool
    keypair str
    name str
    node_count float
    pods_ip_pool str
    Pods IPv4 IP pool in CIDR notation.
    pods_ipv6_pool str
    Pods IPv6 IP pool in CIDR notation.
    pools Sequence[GetK8sv2Pool]
    services_ip_pool str
    Services IPv4 IP pool in CIDR notation.
    services_ipv6_pool str
    Services IPv6 IP pool in CIDR notation.
    status str
    task_id str
    version str
    project_id float
    project_name str
    region_id float
    region_name str
    authentications List<Property Map>
    Cluster authentication configuration.
    autoscalerConfig Map<String>
    Cluster autoscaler configuration params. Keys and values are expected to follow the cluster-autoscaler option format.
    cnis List<Property Map>
    Cluster CNI configuration.
    createdAt String
    creatorTaskId String
    fixedNetwork String
    fixedSubnet String
    flavorId String
    id String
    The ID of this resource.
    isIpv6 Boolean
    Enable public IPv6 address.
    isPublic Boolean
    keypair String
    name String
    nodeCount Number
    podsIpPool String
    Pods IPv4 IP pool in CIDR notation.
    podsIpv6Pool String
    Pods IPv6 IP pool in CIDR notation.
    pools List<Property Map>
    servicesIpPool String
    Services IPv4 IP pool in CIDR notation.
    servicesIpv6Pool String
    Services IPv6 IP pool in CIDR notation.
    status String
    taskId String
    version String
    projectId Number
    projectName String
    regionId Number
    regionName String

    Supporting Types

    GetK8sv2Authentication

    GetK8sv2AuthenticationOidc

    ClientId string
    GroupsClaim string
    GroupsPrefix string
    IssuerUrl string
    RequiredClaims Dictionary<string, string>
    SigningAlgs List<string>
    UsernameClaim string
    UsernamePrefix string
    ClientId string
    GroupsClaim string
    GroupsPrefix string
    IssuerUrl string
    RequiredClaims map[string]string
    SigningAlgs []string
    UsernameClaim string
    UsernamePrefix string
    clientId String
    groupsClaim String
    groupsPrefix String
    issuerUrl String
    requiredClaims Map<String,String>
    signingAlgs List<String>
    usernameClaim String
    usernamePrefix String
    clientId string
    groupsClaim string
    groupsPrefix string
    issuerUrl string
    requiredClaims {[key: string]: string}
    signingAlgs string[]
    usernameClaim string
    usernamePrefix string
    clientId String
    groupsClaim String
    groupsPrefix String
    issuerUrl String
    requiredClaims Map<String>
    signingAlgs List<String>
    usernameClaim String
    usernamePrefix String

    GetK8sv2Cni

    GetK8sv2CniCilium

    Encryption bool
    HubbleRelay bool
    HubbleUi bool
    LbAcceleration bool
    LbMode string
    MaskSize float64
    MaskSizeV6 float64
    RoutingMode string
    Tunnel string
    encryption Boolean
    hubbleRelay Boolean
    hubbleUi Boolean
    lbAcceleration Boolean
    lbMode String
    maskSize Double
    maskSizeV6 Double
    routingMode String
    tunnel String
    encryption boolean
    hubbleRelay boolean
    hubbleUi boolean
    lbAcceleration boolean
    lbMode string
    maskSize number
    maskSizeV6 number
    routingMode string
    tunnel string
    encryption Boolean
    hubbleRelay Boolean
    hubbleUi Boolean
    lbAcceleration Boolean
    lbMode String
    maskSize Number
    maskSizeV6 Number
    routingMode String
    tunnel String

    GetK8sv2Pool

    AutoHealingEnabled bool
    BootVolumeSize double
    BootVolumeType string
    CreatedAt string
    CrioConfig Dictionary<string, string>
    FlavorId string
    IsPublicIpv4 bool
    KubeletConfig Dictionary<string, string>
    Labels Dictionary<string, string>
    MaxNodeCount double
    MinNodeCount double
    Name string
    NodeCount double
    ServergroupId string
    ServergroupName string
    ServergroupPolicy string
    Status string
    Taints Dictionary<string, string>
    AutoHealingEnabled bool
    BootVolumeSize float64
    BootVolumeType string
    CreatedAt string
    CrioConfig map[string]string
    FlavorId string
    IsPublicIpv4 bool
    KubeletConfig map[string]string
    Labels map[string]string
    MaxNodeCount float64
    MinNodeCount float64
    Name string
    NodeCount float64
    ServergroupId string
    ServergroupName string
    ServergroupPolicy string
    Status string
    Taints map[string]string
    autoHealingEnabled Boolean
    bootVolumeSize Double
    bootVolumeType String
    createdAt String
    crioConfig Map<String,String>
    flavorId String
    isPublicIpv4 Boolean
    kubeletConfig Map<String,String>
    labels Map<String,String>
    maxNodeCount Double
    minNodeCount Double
    name String
    nodeCount Double
    servergroupId String
    servergroupName String
    servergroupPolicy String
    status String
    taints Map<String,String>
    autoHealingEnabled boolean
    bootVolumeSize number
    bootVolumeType string
    createdAt string
    crioConfig {[key: string]: string}
    flavorId string
    isPublicIpv4 boolean
    kubeletConfig {[key: string]: string}
    labels {[key: string]: string}
    maxNodeCount number
    minNodeCount number
    name string
    nodeCount number
    servergroupId string
    servergroupName string
    servergroupPolicy string
    status string
    taints {[key: string]: string}
    autoHealingEnabled Boolean
    bootVolumeSize Number
    bootVolumeType String
    createdAt String
    crioConfig Map<String>
    flavorId String
    isPublicIpv4 Boolean
    kubeletConfig Map<String>
    labels Map<String>
    maxNodeCount Number
    minNodeCount Number
    name String
    nodeCount Number
    servergroupId String
    servergroupName String
    servergroupPolicy String
    status String
    taints Map<String>

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core