selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel
selectel.getMksKubeconfigV1
Explore with Pulumi AI
Provides a kubeconfig file and its fields for a Managed Kubernetes cluster. For more information about Managed Kubernetes, see the official Selectel documentation.
Example Usage
Output kubeconfig
import * as pulumi from "@pulumi/pulumi";
import * as selectel from "@pulumi/selectel";
const kubeconfigMksKubeconfigV1 = selectel.getMksKubeconfigV1({
clusterId: selectel_mks_cluster_v1.cluster_1.id,
projectId: selectel_mks_cluster_v1.cluster_1.project_id,
region: selectel_mks_cluster_v1.cluster_1.region,
});
export const kubeconfig = kubeconfigMksKubeconfigV1.then(kubeconfigMksKubeconfigV1 => kubeconfigMksKubeconfigV1.rawConfig);
import pulumi
import pulumi_selectel as selectel
kubeconfig_mks_kubeconfig_v1 = selectel.get_mks_kubeconfig_v1(cluster_id=selectel_mks_cluster_v1["cluster_1"]["id"],
project_id=selectel_mks_cluster_v1["cluster_1"]["project_id"],
region=selectel_mks_cluster_v1["cluster_1"]["region"])
pulumi.export("kubeconfig", kubeconfig_mks_kubeconfig_v1.raw_config)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
kubeconfigMksKubeconfigV1, err := selectel.GetMksKubeconfigV1(ctx, &selectel.GetMksKubeconfigV1Args{
ClusterId: selectel_mks_cluster_v1.Cluster_1.Id,
ProjectId: selectel_mks_cluster_v1.Cluster_1.Project_id,
Region: selectel_mks_cluster_v1.Cluster_1.Region,
}, nil)
if err != nil {
return err
}
ctx.Export("kubeconfig", kubeconfigMksKubeconfigV1.RawConfig)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Selectel = Pulumi.Selectel;
return await Deployment.RunAsync(() =>
{
var kubeconfigMksKubeconfigV1 = Selectel.GetMksKubeconfigV1.Invoke(new()
{
ClusterId = selectel_mks_cluster_v1.Cluster_1.Id,
ProjectId = selectel_mks_cluster_v1.Cluster_1.Project_id,
Region = selectel_mks_cluster_v1.Cluster_1.Region,
});
return new Dictionary<string, object?>
{
["kubeconfig"] = kubeconfigMksKubeconfigV1.Apply(getMksKubeconfigV1Result => getMksKubeconfigV1Result.RawConfig),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.selectel.SelectelFunctions;
import com.pulumi.selectel.inputs.GetMksKubeconfigV1Args;
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 kubeconfigMksKubeconfigV1 = SelectelFunctions.getMksKubeconfigV1(GetMksKubeconfigV1Args.builder()
.clusterId(selectel_mks_cluster_v1.cluster_1().id())
.projectId(selectel_mks_cluster_v1.cluster_1().project_id())
.region(selectel_mks_cluster_v1.cluster_1().region())
.build());
ctx.export("kubeconfig", kubeconfigMksKubeconfigV1.applyValue(getMksKubeconfigV1Result -> getMksKubeconfigV1Result.rawConfig()));
}
}
variables:
kubeconfigMksKubeconfigV1:
fn::invoke:
function: selectel:getMksKubeconfigV1
arguments:
clusterId: ${selectel_mks_cluster_v1.cluster_1.id}
projectId: ${selectel_mks_cluster_v1.cluster_1.project_id}
region: ${selectel_mks_cluster_v1.cluster_1.region}
outputs:
kubeconfig: ${kubeconfigMksKubeconfigV1.rawConfig}
Using getMksKubeconfigV1
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 getMksKubeconfigV1(args: GetMksKubeconfigV1Args, opts?: InvokeOptions): Promise<GetMksKubeconfigV1Result>
function getMksKubeconfigV1Output(args: GetMksKubeconfigV1OutputArgs, opts?: InvokeOptions): Output<GetMksKubeconfigV1Result>
def get_mks_kubeconfig_v1(cluster_id: Optional[str] = None,
id: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetMksKubeconfigV1Result
def get_mks_kubeconfig_v1_output(cluster_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetMksKubeconfigV1Result]
func GetMksKubeconfigV1(ctx *Context, args *GetMksKubeconfigV1Args, opts ...InvokeOption) (*GetMksKubeconfigV1Result, error)
func GetMksKubeconfigV1Output(ctx *Context, args *GetMksKubeconfigV1OutputArgs, opts ...InvokeOption) GetMksKubeconfigV1ResultOutput
> Note: This function is named GetMksKubeconfigV1
in the Go SDK.
public static class GetMksKubeconfigV1
{
public static Task<GetMksKubeconfigV1Result> InvokeAsync(GetMksKubeconfigV1Args args, InvokeOptions? opts = null)
public static Output<GetMksKubeconfigV1Result> Invoke(GetMksKubeconfigV1InvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetMksKubeconfigV1Result> getMksKubeconfigV1(GetMksKubeconfigV1Args args, InvokeOptions options)
public static Output<GetMksKubeconfigV1Result> getMksKubeconfigV1(GetMksKubeconfigV1Args args, InvokeOptions options)
fn::invoke:
function: selectel:index/getMksKubeconfigV1:getMksKubeconfigV1
arguments:
# arguments dictionary
The following arguments are supported:
- Cluster
Id string - Unique identifier of the cluster.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Region string
- Pool where the cluster is located, for example,
ru-3
. Learn more about available pools in the Availability matrix. - Id string
- Cluster
Id string - Unique identifier of the cluster.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Region string
- Pool where the cluster is located, for example,
ru-3
. Learn more about available pools in the Availability matrix. - Id string
- cluster
Id String - Unique identifier of the cluster.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region String
- Pool where the cluster is located, for example,
ru-3
. Learn more about available pools in the Availability matrix. - id String
- cluster
Id string - Unique identifier of the cluster.
- project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region string
- Pool where the cluster is located, for example,
ru-3
. Learn more about available pools in the Availability matrix. - id string
- cluster_
id str - Unique identifier of the cluster.
- project_
id str - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region str
- Pool where the cluster is located, for example,
ru-3
. Learn more about available pools in the Availability matrix. - id str
- cluster
Id String - Unique identifier of the cluster.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region String
- Pool where the cluster is located, for example,
ru-3
. Learn more about available pools in the Availability matrix. - id String
getMksKubeconfigV1 Result
The following output properties are available:
- Client
Cert string - Client certificate for authorization.
- Client
Key string - Client key for authorization.
- Cluster
Ca stringCert - CA certificate of the cluster.
- Cluster
Id string - Id string
- Project
Id string - Raw
Config string - Raw content of a kubeconfig file.
- Region string
- Server string
- IP address and port for a Kube API server.
- Client
Cert string - Client certificate for authorization.
- Client
Key string - Client key for authorization.
- Cluster
Ca stringCert - CA certificate of the cluster.
- Cluster
Id string - Id string
- Project
Id string - Raw
Config string - Raw content of a kubeconfig file.
- Region string
- Server string
- IP address and port for a Kube API server.
- client
Cert String - Client certificate for authorization.
- client
Key String - Client key for authorization.
- cluster
Ca StringCert - CA certificate of the cluster.
- cluster
Id String - id String
- project
Id String - raw
Config String - Raw content of a kubeconfig file.
- region String
- server String
- IP address and port for a Kube API server.
- client
Cert string - Client certificate for authorization.
- client
Key string - Client key for authorization.
- cluster
Ca stringCert - CA certificate of the cluster.
- cluster
Id string - id string
- project
Id string - raw
Config string - Raw content of a kubeconfig file.
- region string
- server string
- IP address and port for a Kube API server.
- client_
cert str - Client certificate for authorization.
- client_
key str - Client key for authorization.
- cluster_
ca_ strcert - CA certificate of the cluster.
- cluster_
id str - id str
- project_
id str - raw_
config str - Raw content of a kubeconfig file.
- region str
- server str
- IP address and port for a Kube API server.
- client
Cert String - Client certificate for authorization.
- client
Key String - Client key for authorization.
- cluster
Ca StringCert - CA certificate of the cluster.
- cluster
Id String - id String
- project
Id String - raw
Config String - Raw content of a kubeconfig file.
- region String
- server String
- IP address and port for a Kube API server.
Package Details
- Repository
- selectel selectel/terraform-provider-selectel
- License
- Notes
- This Pulumi package is based on the
selectel
Terraform Provider.