tencentcloud.KubernetesAddonAttachment
Explore with Pulumi AI
Provide a resource to configure kubernetes cluster app addons.
NOTE: Avoid to using legacy “1.0.0” version, leave the versions empty so we can fetch the latest while creating.
Example Usage
Install cbs addon by passing values
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const addonCbs = new tencentcloud.KubernetesAddonAttachment("addonCbs", {
clusterId: "cls-xxxxxxxx",
values: ["rootdir=/var/lib/kubelet"],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
addon_cbs = tencentcloud.KubernetesAddonAttachment("addonCbs",
cluster_id="cls-xxxxxxxx",
values=["rootdir=/var/lib/kubelet"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewKubernetesAddonAttachment(ctx, "addonCbs", &tencentcloud.KubernetesAddonAttachmentArgs{
ClusterId: pulumi.String("cls-xxxxxxxx"),
Values: pulumi.StringArray{
pulumi.String("rootdir=/var/lib/kubelet"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var addonCbs = new Tencentcloud.KubernetesAddonAttachment("addonCbs", new()
{
ClusterId = "cls-xxxxxxxx",
Values = new[]
{
"rootdir=/var/lib/kubelet",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.KubernetesAddonAttachment;
import com.pulumi.tencentcloud.KubernetesAddonAttachmentArgs;
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 addonCbs = new KubernetesAddonAttachment("addonCbs", KubernetesAddonAttachmentArgs.builder()
.clusterId("cls-xxxxxxxx")
.values("rootdir=/var/lib/kubelet")
.build());
}
}
resources:
addonCbs:
type: tencentcloud:KubernetesAddonAttachment
properties:
clusterId: cls-xxxxxxxx
# version = "1.0.5"
values:
- rootdir=/var/lib/kubelet
Install tcr addon by passing values
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const mytcr = new tencentcloud.TcrInstance("mytcr", {
instanceType: "basic",
deleteBucket: true,
tags: {
test: "test",
},
});
const tcrId = mytcr.tcrInstanceId;
const tcrName = mytcr.name;
const myNs = new tencentcloud.TcrNamespace("myNs", {
instanceId: tcrId,
isPublic: true,
isAutoScan: true,
isPreventVul: true,
severity: "medium",
cveWhitelistItems: [{
cveId: "cve-xxxxx",
}],
});
const nsName = myNs.name;
const myToken = new tencentcloud.TcrToken("myToken", {
instanceId: tcrId,
description: "tcr token",
});
const userName = myToken.userName;
const token = myToken.token;
const myIns = tencentcloud.getTcrInstancesOutput({
instanceId: tcrId,
});
const endPoint = myIns.apply(myIns => myIns.instanceLists?.[0]?.internalEndPoint);
const addonTcr = new tencentcloud.KubernetesAddonAttachment("addonTcr", {
clusterId: "cls-xxxxxxxx",
version: "1.0.0",
values: [
pulumi.interpolate`global.imagePullSecretsCrs[0].name=${tcrId}-vpc`,
pulumi.interpolate`global.imagePullSecretsCrs[0].namespaces=${nsName}`,
"global.imagePullSecretsCrs[0].serviceAccounts=*",
"global.imagePullSecretsCrs[0].type=docker",
pulumi.interpolate`global.imagePullSecretsCrs[0].dockerUsername=${userName}`,
pulumi.interpolate`global.imagePullSecretsCrs[0].dockerPassword=${token}`,
pulumi.interpolate`global.imagePullSecretsCrs[0].dockerServer=${tcrName}-vpc.tencentcloudcr.com`,
pulumi.interpolate`global.imagePullSecretsCrs[1].name=${tcrId}-public`,
pulumi.interpolate`global.imagePullSecretsCrs[1].namespaces=${nsName}`,
"global.imagePullSecretsCrs[1].serviceAccounts=*",
"global.imagePullSecretsCrs[1].type=docker",
pulumi.interpolate`global.imagePullSecretsCrs[1].dockerUsername=${userName}`,
pulumi.interpolate`global.imagePullSecretsCrs[1].dockerPassword=${token}`,
pulumi.interpolate`global.imagePullSecretsCrs[1].dockerServer=${tcrName}.tencentcloudcr.com`,
"global.cluster.region=gz",
"global.cluster.longregion=ap-guangzhou",
pulumi.interpolate`global.hosts[0].domain=${tcrName}-vpc.tencentcloudcr.com`,
endPoint.apply(endPoint => `global.hosts[0].ip=${endPoint}`),
"global.hosts[0].disabled=false",
pulumi.interpolate`global.hosts[1].domain=${tcrName}.tencentcloudcr.com`,
endPoint.apply(endPoint => `global.hosts[1].ip=${endPoint}`),
"global.hosts[1].disabled=false",
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
mytcr = tencentcloud.TcrInstance("mytcr",
instance_type="basic",
delete_bucket=True,
tags={
"test": "test",
})
tcr_id = mytcr.tcr_instance_id
tcr_name = mytcr.name
my_ns = tencentcloud.TcrNamespace("myNs",
instance_id=tcr_id,
is_public=True,
is_auto_scan=True,
is_prevent_vul=True,
severity="medium",
cve_whitelist_items=[{
"cve_id": "cve-xxxxx",
}])
ns_name = my_ns.name
my_token = tencentcloud.TcrToken("myToken",
instance_id=tcr_id,
description="tcr token")
user_name = my_token.user_name
token = my_token.token
my_ins = tencentcloud.get_tcr_instances_output(instance_id=tcr_id)
end_point = my_ins.instance_lists[0].internal_end_point
addon_tcr = tencentcloud.KubernetesAddonAttachment("addonTcr",
cluster_id="cls-xxxxxxxx",
version="1.0.0",
values=[
tcr_id.apply(lambda tcr_id: f"global.imagePullSecretsCrs[0].name={tcr_id}-vpc"),
ns_name.apply(lambda ns_name: f"global.imagePullSecretsCrs[0].namespaces={ns_name}"),
"global.imagePullSecretsCrs[0].serviceAccounts=*",
"global.imagePullSecretsCrs[0].type=docker",
user_name.apply(lambda user_name: f"global.imagePullSecretsCrs[0].dockerUsername={user_name}"),
token.apply(lambda token: f"global.imagePullSecretsCrs[0].dockerPassword={token}"),
tcr_name.apply(lambda tcr_name: f"global.imagePullSecretsCrs[0].dockerServer={tcr_name}-vpc.tencentcloudcr.com"),
tcr_id.apply(lambda tcr_id: f"global.imagePullSecretsCrs[1].name={tcr_id}-public"),
ns_name.apply(lambda ns_name: f"global.imagePullSecretsCrs[1].namespaces={ns_name}"),
"global.imagePullSecretsCrs[1].serviceAccounts=*",
"global.imagePullSecretsCrs[1].type=docker",
user_name.apply(lambda user_name: f"global.imagePullSecretsCrs[1].dockerUsername={user_name}"),
token.apply(lambda token: f"global.imagePullSecretsCrs[1].dockerPassword={token}"),
tcr_name.apply(lambda tcr_name: f"global.imagePullSecretsCrs[1].dockerServer={tcr_name}.tencentcloudcr.com"),
"global.cluster.region=gz",
"global.cluster.longregion=ap-guangzhou",
tcr_name.apply(lambda tcr_name: f"global.hosts[0].domain={tcr_name}-vpc.tencentcloudcr.com"),
end_point.apply(lambda end_point: f"global.hosts[0].ip={end_point}"),
"global.hosts[0].disabled=false",
tcr_name.apply(lambda tcr_name: f"global.hosts[1].domain={tcr_name}.tencentcloudcr.com"),
end_point.apply(lambda end_point: f"global.hosts[1].ip={end_point}"),
"global.hosts[1].disabled=false",
])
package main
import (
"fmt"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
mytcr, err := tencentcloud.NewTcrInstance(ctx, "mytcr", &tencentcloud.TcrInstanceArgs{
InstanceType: pulumi.String("basic"),
DeleteBucket: pulumi.Bool(true),
Tags: pulumi.StringMap{
"test": pulumi.String("test"),
},
})
if err != nil {
return err
}
tcrId := mytcr.TcrInstanceId
tcrName := mytcr.Name
myNs, err := tencentcloud.NewTcrNamespace(ctx, "myNs", &tencentcloud.TcrNamespaceArgs{
InstanceId: pulumi.String(tcrId),
IsPublic: pulumi.Bool(true),
IsAutoScan: pulumi.Bool(true),
IsPreventVul: pulumi.Bool(true),
Severity: pulumi.String("medium"),
CveWhitelistItems: tencentcloud.TcrNamespaceCveWhitelistItemArray{
&tencentcloud.TcrNamespaceCveWhitelistItemArgs{
CveId: pulumi.String("cve-xxxxx"),
},
},
})
if err != nil {
return err
}
nsName := myNs.Name
myToken, err := tencentcloud.NewTcrToken(ctx, "myToken", &tencentcloud.TcrTokenArgs{
InstanceId: pulumi.String(tcrId),
Description: pulumi.String("tcr token"),
})
if err != nil {
return err
}
userName := myToken.UserName
token := myToken.Token
myIns := tencentcloud.GetTcrInstancesOutput(ctx, tencentcloud.GetTcrInstancesOutputArgs{
InstanceId: pulumi.String(tcrId),
}, nil)
endPoint := myIns.ApplyT(func(myIns tencentcloud.GetTcrInstancesResult) (*string, error) {
return &myIns.InstanceLists[0].InternalEndPoint, nil
}).(pulumi.StringPtrOutput)
_, err = tencentcloud.NewKubernetesAddonAttachment(ctx, "addonTcr", &tencentcloud.KubernetesAddonAttachmentArgs{
ClusterId: pulumi.String("cls-xxxxxxxx"),
Version: pulumi.String("1.0.0"),
Values: pulumi.StringArray{
tcrId.ApplyT(func(tcrId string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[0].name=%v-vpc", tcrId), nil
}).(pulumi.StringOutput),
nsName.ApplyT(func(nsName string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[0].namespaces=%v", nsName), nil
}).(pulumi.StringOutput),
pulumi.String("global.imagePullSecretsCrs[0].serviceAccounts=*"),
pulumi.String("global.imagePullSecretsCrs[0].type=docker"),
userName.ApplyT(func(userName string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[0].dockerUsername=%v", userName), nil
}).(pulumi.StringOutput),
token.ApplyT(func(token string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[0].dockerPassword=%v", token), nil
}).(pulumi.StringOutput),
tcrName.ApplyT(func(tcrName string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[0].dockerServer=%v-vpc.tencentcloudcr.com", tcrName), nil
}).(pulumi.StringOutput),
tcrId.ApplyT(func(tcrId string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[1].name=%v-public", tcrId), nil
}).(pulumi.StringOutput),
nsName.ApplyT(func(nsName string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[1].namespaces=%v", nsName), nil
}).(pulumi.StringOutput),
pulumi.String("global.imagePullSecretsCrs[1].serviceAccounts=*"),
pulumi.String("global.imagePullSecretsCrs[1].type=docker"),
userName.ApplyT(func(userName string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[1].dockerUsername=%v", userName), nil
}).(pulumi.StringOutput),
token.ApplyT(func(token string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[1].dockerPassword=%v", token), nil
}).(pulumi.StringOutput),
tcrName.ApplyT(func(tcrName string) (string, error) {
return fmt.Sprintf("global.imagePullSecretsCrs[1].dockerServer=%v.tencentcloudcr.com", tcrName), nil
}).(pulumi.StringOutput),
pulumi.String("global.cluster.region=gz"),
pulumi.String("global.cluster.longregion=ap-guangzhou"),
tcrName.ApplyT(func(tcrName string) (string, error) {
return fmt.Sprintf("global.hosts[0].domain=%v-vpc.tencentcloudcr.com", tcrName), nil
}).(pulumi.StringOutput),
endPoint.ApplyT(func(endPoint *string) (string, error) {
return fmt.Sprintf("global.hosts[0].ip=%v", endPoint), nil
}).(pulumi.StringOutput),
pulumi.String("global.hosts[0].disabled=false"),
tcrName.ApplyT(func(tcrName string) (string, error) {
return fmt.Sprintf("global.hosts[1].domain=%v.tencentcloudcr.com", tcrName), nil
}).(pulumi.StringOutput),
endPoint.ApplyT(func(endPoint *string) (string, error) {
return fmt.Sprintf("global.hosts[1].ip=%v", endPoint), nil
}).(pulumi.StringOutput),
pulumi.String("global.hosts[1].disabled=false"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var mytcr = new Tencentcloud.TcrInstance("mytcr", new()
{
InstanceType = "basic",
DeleteBucket = true,
Tags =
{
{ "test", "test" },
},
});
var tcrId = mytcr.TcrInstanceId;
var tcrName = mytcr.Name;
var myNs = new Tencentcloud.TcrNamespace("myNs", new()
{
InstanceId = tcrId,
IsPublic = true,
IsAutoScan = true,
IsPreventVul = true,
Severity = "medium",
CveWhitelistItems = new[]
{
new Tencentcloud.Inputs.TcrNamespaceCveWhitelistItemArgs
{
CveId = "cve-xxxxx",
},
},
});
var nsName = myNs.Name;
var myToken = new Tencentcloud.TcrToken("myToken", new()
{
InstanceId = tcrId,
Description = "tcr token",
});
var userName = myToken.UserName;
var token = myToken.Token;
var myIns = Tencentcloud.GetTcrInstances.Invoke(new()
{
InstanceId = tcrId,
});
var endPoint = myIns.Apply(getTcrInstancesResult => getTcrInstancesResult.InstanceLists[0]?.InternalEndPoint);
var addonTcr = new Tencentcloud.KubernetesAddonAttachment("addonTcr", new()
{
ClusterId = "cls-xxxxxxxx",
Version = "1.0.0",
Values = new[]
{
tcrId.Apply(tcrId => $"global.imagePullSecretsCrs[0].name={tcrId}-vpc"),
nsName.Apply(nsName => $"global.imagePullSecretsCrs[0].namespaces={nsName}"),
"global.imagePullSecretsCrs[0].serviceAccounts=*",
"global.imagePullSecretsCrs[0].type=docker",
userName.Apply(userName => $"global.imagePullSecretsCrs[0].dockerUsername={userName}"),
token.Apply(token => $"global.imagePullSecretsCrs[0].dockerPassword={token}"),
tcrName.Apply(tcrName => $"global.imagePullSecretsCrs[0].dockerServer={tcrName}-vpc.tencentcloudcr.com"),
tcrId.Apply(tcrId => $"global.imagePullSecretsCrs[1].name={tcrId}-public"),
nsName.Apply(nsName => $"global.imagePullSecretsCrs[1].namespaces={nsName}"),
"global.imagePullSecretsCrs[1].serviceAccounts=*",
"global.imagePullSecretsCrs[1].type=docker",
userName.Apply(userName => $"global.imagePullSecretsCrs[1].dockerUsername={userName}"),
token.Apply(token => $"global.imagePullSecretsCrs[1].dockerPassword={token}"),
tcrName.Apply(tcrName => $"global.imagePullSecretsCrs[1].dockerServer={tcrName}.tencentcloudcr.com"),
"global.cluster.region=gz",
"global.cluster.longregion=ap-guangzhou",
tcrName.Apply(tcrName => $"global.hosts[0].domain={tcrName}-vpc.tencentcloudcr.com"),
endPoint.Apply(endPoint => $"global.hosts[0].ip={endPoint}"),
"global.hosts[0].disabled=false",
tcrName.Apply(tcrName => $"global.hosts[1].domain={tcrName}.tencentcloudcr.com"),
endPoint.Apply(endPoint => $"global.hosts[1].ip={endPoint}"),
"global.hosts[1].disabled=false",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TcrInstance;
import com.pulumi.tencentcloud.TcrInstanceArgs;
import com.pulumi.tencentcloud.TcrNamespace;
import com.pulumi.tencentcloud.TcrNamespaceArgs;
import com.pulumi.tencentcloud.inputs.TcrNamespaceCveWhitelistItemArgs;
import com.pulumi.tencentcloud.TcrToken;
import com.pulumi.tencentcloud.TcrTokenArgs;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetTcrInstancesArgs;
import com.pulumi.tencentcloud.KubernetesAddonAttachment;
import com.pulumi.tencentcloud.KubernetesAddonAttachmentArgs;
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 mytcr = new TcrInstance("mytcr", TcrInstanceArgs.builder()
.instanceType("basic")
.deleteBucket(true)
.tags(Map.of("test", "test"))
.build());
final var tcrId = mytcr.tcrInstanceId();
final var tcrName = mytcr.name();
var myNs = new TcrNamespace("myNs", TcrNamespaceArgs.builder()
.instanceId(tcrId)
.isPublic(true)
.isAutoScan(true)
.isPreventVul(true)
.severity("medium")
.cveWhitelistItems(TcrNamespaceCveWhitelistItemArgs.builder()
.cveId("cve-xxxxx")
.build())
.build());
final var nsName = myNs.name();
var myToken = new TcrToken("myToken", TcrTokenArgs.builder()
.instanceId(tcrId)
.description("tcr token")
.build());
final var userName = myToken.userName();
final var token = myToken.token();
final var myIns = TencentcloudFunctions.getTcrInstances(GetTcrInstancesArgs.builder()
.instanceId(tcrId)
.build());
final var endPoint = myIns.applyValue(getTcrInstancesResult -> getTcrInstancesResult).applyValue(myIns -> myIns.applyValue(getTcrInstancesResult -> getTcrInstancesResult.instanceLists()[0].internalEndPoint()));
var addonTcr = new KubernetesAddonAttachment("addonTcr", KubernetesAddonAttachmentArgs.builder()
.clusterId("cls-xxxxxxxx")
.version("1.0.0")
.values(
tcrId.applyValue(tcrId -> String.format("global.imagePullSecretsCrs[0].name=%s-vpc", tcrId)),
nsName.applyValue(nsName -> String.format("global.imagePullSecretsCrs[0].namespaces=%s", nsName)),
"global.imagePullSecretsCrs[0].serviceAccounts=*",
"global.imagePullSecretsCrs[0].type=docker",
userName.applyValue(userName -> String.format("global.imagePullSecretsCrs[0].dockerUsername=%s", userName)),
token.applyValue(token -> String.format("global.imagePullSecretsCrs[0].dockerPassword=%s", token)),
tcrName.applyValue(tcrName -> String.format("global.imagePullSecretsCrs[0].dockerServer=%s-vpc.tencentcloudcr.com", tcrName)),
tcrId.applyValue(tcrId -> String.format("global.imagePullSecretsCrs[1].name=%s-public", tcrId)),
nsName.applyValue(nsName -> String.format("global.imagePullSecretsCrs[1].namespaces=%s", nsName)),
"global.imagePullSecretsCrs[1].serviceAccounts=*",
"global.imagePullSecretsCrs[1].type=docker",
userName.applyValue(userName -> String.format("global.imagePullSecretsCrs[1].dockerUsername=%s", userName)),
token.applyValue(token -> String.format("global.imagePullSecretsCrs[1].dockerPassword=%s", token)),
tcrName.applyValue(tcrName -> String.format("global.imagePullSecretsCrs[1].dockerServer=%s.tencentcloudcr.com", tcrName)),
"global.cluster.region=gz",
"global.cluster.longregion=ap-guangzhou",
tcrName.applyValue(tcrName -> String.format("global.hosts[0].domain=%s-vpc.tencentcloudcr.com", tcrName)),
endPoint.applyValue(endPoint -> String.format("global.hosts[0].ip=%s", endPoint)),
"global.hosts[0].disabled=false",
tcrName.applyValue(tcrName -> String.format("global.hosts[1].domain=%s.tencentcloudcr.com", tcrName)),
endPoint.applyValue(endPoint -> String.format("global.hosts[1].ip=%s", endPoint)),
"global.hosts[1].disabled=false")
.build());
}
}
resources:
addonTcr:
type: tencentcloud:KubernetesAddonAttachment
properties:
clusterId: cls-xxxxxxxx
version: 1.0.0
values:
- global.imagePullSecretsCrs[0].name=${tcrId}-vpc
- global.imagePullSecretsCrs[0].namespaces=${nsName}
- global.imagePullSecretsCrs[0].serviceAccounts=*
- global.imagePullSecretsCrs[0].type=docker
- global.imagePullSecretsCrs[0].dockerUsername=${userName}
- global.imagePullSecretsCrs[0].dockerPassword=${token}
- global.imagePullSecretsCrs[0].dockerServer=${tcrName}-vpc.tencentcloudcr.com
- global.imagePullSecretsCrs[1].name=${tcrId}-public
- global.imagePullSecretsCrs[1].namespaces=${nsName}
- global.imagePullSecretsCrs[1].serviceAccounts=*
- global.imagePullSecretsCrs[1].type=docker
- global.imagePullSecretsCrs[1].dockerUsername=${userName}
- global.imagePullSecretsCrs[1].dockerPassword=${token}
- global.imagePullSecretsCrs[1].dockerServer=${tcrName}.tencentcloudcr.com
- global.cluster.region=gz
- global.cluster.longregion=ap-guangzhou
- global.hosts[0].domain=${tcrName}-vpc.tencentcloudcr.com
- global.hosts[0].ip=${endPoint}
- global.hosts[0].disabled=false
- global.hosts[1].domain=${tcrName}.tencentcloudcr.com
- global.hosts[1].ip=${endPoint}
- global.hosts[1].disabled=false
myToken:
type: tencentcloud:TcrToken
properties:
instanceId: ${tcrId}
description: tcr token
mytcr:
type: tencentcloud:TcrInstance
properties:
instanceType: basic
deleteBucket: true
tags:
test: test
myNs:
type: tencentcloud:TcrNamespace
properties:
instanceId: ${tcrId}
isPublic: true
isAutoScan: true
isPreventVul: true
severity: medium
cveWhitelistItems:
- cveId: cve-xxxxx
variables:
tcrId: ${mytcr.tcrInstanceId}
tcrName: ${mytcr.name}
nsName: ${myNs.name}
userName: ${myToken.userName}
token: ${myToken.token}
endPoint: ${myIns.instanceLists[0].internalEndPoint}
myIns:
fn::invoke:
function: tencentcloud:getTcrInstances
arguments:
instanceId: ${tcrId}
Install new addon by passing spec json to req_body directly
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const addonCbs = new tencentcloud.KubernetesAddonAttachment("addonCbs", {
clusterId: "cls-xxxxxxxx",
requestBody: ` {
"spec":{
"chart":{
"chartName":"cbs",
"chartVersion":"1.0.5"
},
"values":{
"rawValuesType":"yaml",
"values":[
"rootdir=/var/lib/kubelet"
]
}
}
}
`,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
addon_cbs = tencentcloud.KubernetesAddonAttachment("addonCbs",
cluster_id="cls-xxxxxxxx",
request_body=""" {
"spec":{
"chart":{
"chartName":"cbs",
"chartVersion":"1.0.5"
},
"values":{
"rawValuesType":"yaml",
"values":[
"rootdir=/var/lib/kubelet"
]
}
}
}
""")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewKubernetesAddonAttachment(ctx, "addonCbs", &tencentcloud.KubernetesAddonAttachmentArgs{
ClusterId: pulumi.String("cls-xxxxxxxx"),
RequestBody: pulumi.String(` {
"spec":{
"chart":{
"chartName":"cbs",
"chartVersion":"1.0.5"
},
"values":{
"rawValuesType":"yaml",
"values":[
"rootdir=/var/lib/kubelet"
]
}
}
}
`),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var addonCbs = new Tencentcloud.KubernetesAddonAttachment("addonCbs", new()
{
ClusterId = "cls-xxxxxxxx",
RequestBody = @" {
""spec"":{
""chart"":{
""chartName"":""cbs"",
""chartVersion"":""1.0.5""
},
""values"":{
""rawValuesType"":""yaml"",
""values"":[
""rootdir=/var/lib/kubelet""
]
}
}
}
",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.KubernetesAddonAttachment;
import com.pulumi.tencentcloud.KubernetesAddonAttachmentArgs;
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 addonCbs = new KubernetesAddonAttachment("addonCbs", KubernetesAddonAttachmentArgs.builder()
.clusterId("cls-xxxxxxxx")
.requestBody("""
{
"spec":{
"chart":{
"chartName":"cbs",
"chartVersion":"1.0.5"
},
"values":{
"rawValuesType":"yaml",
"values":[
"rootdir=/var/lib/kubelet"
]
}
}
}
""")
.build());
}
}
resources:
addonCbs:
type: tencentcloud:KubernetesAddonAttachment
properties:
clusterId: cls-xxxxxxxx
requestBody: |2+
{
"spec":{
"chart":{
"chartName":"cbs",
"chartVersion":"1.0.5"
},
"values":{
"rawValuesType":"yaml",
"values":[
"rootdir=/var/lib/kubelet"
]
}
}
}
Create KubernetesAddonAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KubernetesAddonAttachment(name: string, args: KubernetesAddonAttachmentArgs, opts?: CustomResourceOptions);
@overload
def KubernetesAddonAttachment(resource_name: str,
args: KubernetesAddonAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def KubernetesAddonAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
kubernetes_addon_attachment_id: Optional[str] = None,
name: Optional[str] = None,
raw_values: Optional[str] = None,
raw_values_type: Optional[str] = None,
request_body: Optional[str] = None,
values: Optional[Sequence[str]] = None,
version: Optional[str] = None)
func NewKubernetesAddonAttachment(ctx *Context, name string, args KubernetesAddonAttachmentArgs, opts ...ResourceOption) (*KubernetesAddonAttachment, error)
public KubernetesAddonAttachment(string name, KubernetesAddonAttachmentArgs args, CustomResourceOptions? opts = null)
public KubernetesAddonAttachment(String name, KubernetesAddonAttachmentArgs args)
public KubernetesAddonAttachment(String name, KubernetesAddonAttachmentArgs args, CustomResourceOptions options)
type: tencentcloud:KubernetesAddonAttachment
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 KubernetesAddonAttachmentArgs
- 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 KubernetesAddonAttachmentArgs
- 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 KubernetesAddonAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KubernetesAddonAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KubernetesAddonAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
KubernetesAddonAttachment 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 KubernetesAddonAttachment resource accepts the following input properties:
- Cluster
Id string - ID of cluster.
- Kubernetes
Addon stringAttachment Id - ID of the resource.
- Name string
- Name of addon.
- Raw
Values string - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - Raw
Values stringType - The type of raw Values. Required with
raw_values
. - Request
Body string - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - Values List<string>
- Values the addon passthroughs. Conflict with
request_body
. - Version string
- Addon version, default latest version. Conflict with
request_body
.
- Cluster
Id string - ID of cluster.
- Kubernetes
Addon stringAttachment Id - ID of the resource.
- Name string
- Name of addon.
- Raw
Values string - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - Raw
Values stringType - The type of raw Values. Required with
raw_values
. - Request
Body string - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - Values []string
- Values the addon passthroughs. Conflict with
request_body
. - Version string
- Addon version, default latest version. Conflict with
request_body
.
- cluster
Id String - ID of cluster.
- kubernetes
Addon StringAttachment Id - ID of the resource.
- name String
- Name of addon.
- raw
Values String - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw
Values StringType - The type of raw Values. Required with
raw_values
. - request
Body String - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - values List<String>
- Values the addon passthroughs. Conflict with
request_body
. - version String
- Addon version, default latest version. Conflict with
request_body
.
- cluster
Id string - ID of cluster.
- kubernetes
Addon stringAttachment Id - ID of the resource.
- name string
- Name of addon.
- raw
Values string - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw
Values stringType - The type of raw Values. Required with
raw_values
. - request
Body string - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - values string[]
- Values the addon passthroughs. Conflict with
request_body
. - version string
- Addon version, default latest version. Conflict with
request_body
.
- cluster_
id str - ID of cluster.
- kubernetes_
addon_ strattachment_ id - ID of the resource.
- name str
- Name of addon.
- raw_
values str - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw_
values_ strtype - The type of raw Values. Required with
raw_values
. - request_
body str - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - values Sequence[str]
- Values the addon passthroughs. Conflict with
request_body
. - version str
- Addon version, default latest version. Conflict with
request_body
.
- cluster
Id String - ID of cluster.
- kubernetes
Addon StringAttachment Id - ID of the resource.
- name String
- Name of addon.
- raw
Values String - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw
Values StringType - The type of raw Values. Required with
raw_values
. - request
Body String - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - values List<String>
- Values the addon passthroughs. Conflict with
request_body
. - version String
- Addon version, default latest version. Conflict with
request_body
.
Outputs
All input properties are implicitly available as output properties. Additionally, the KubernetesAddonAttachment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Response
Body string - Addon response body.
- Status Dictionary<string, string>
- Addon current status.
- Id string
- The provider-assigned unique ID for this managed resource.
- Response
Body string - Addon response body.
- Status map[string]string
- Addon current status.
- id String
- The provider-assigned unique ID for this managed resource.
- response
Body String - Addon response body.
- status Map<String,String>
- Addon current status.
- id string
- The provider-assigned unique ID for this managed resource.
- response
Body string - Addon response body.
- status {[key: string]: string}
- Addon current status.
- id str
- The provider-assigned unique ID for this managed resource.
- response_
body str - Addon response body.
- status Mapping[str, str]
- Addon current status.
- id String
- The provider-assigned unique ID for this managed resource.
- response
Body String - Addon response body.
- status Map<String>
- Addon current status.
Look up Existing KubernetesAddonAttachment Resource
Get an existing KubernetesAddonAttachment 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?: KubernetesAddonAttachmentState, opts?: CustomResourceOptions): KubernetesAddonAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
kubernetes_addon_attachment_id: Optional[str] = None,
name: Optional[str] = None,
raw_values: Optional[str] = None,
raw_values_type: Optional[str] = None,
request_body: Optional[str] = None,
response_body: Optional[str] = None,
status: Optional[Mapping[str, str]] = None,
values: Optional[Sequence[str]] = None,
version: Optional[str] = None) -> KubernetesAddonAttachment
func GetKubernetesAddonAttachment(ctx *Context, name string, id IDInput, state *KubernetesAddonAttachmentState, opts ...ResourceOption) (*KubernetesAddonAttachment, error)
public static KubernetesAddonAttachment Get(string name, Input<string> id, KubernetesAddonAttachmentState? state, CustomResourceOptions? opts = null)
public static KubernetesAddonAttachment get(String name, Output<String> id, KubernetesAddonAttachmentState state, CustomResourceOptions options)
resources: _: type: tencentcloud:KubernetesAddonAttachment 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.
- Cluster
Id string - ID of cluster.
- Kubernetes
Addon stringAttachment Id - ID of the resource.
- Name string
- Name of addon.
- Raw
Values string - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - Raw
Values stringType - The type of raw Values. Required with
raw_values
. - Request
Body string - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - Response
Body string - Addon response body.
- Status Dictionary<string, string>
- Addon current status.
- Values List<string>
- Values the addon passthroughs. Conflict with
request_body
. - Version string
- Addon version, default latest version. Conflict with
request_body
.
- Cluster
Id string - ID of cluster.
- Kubernetes
Addon stringAttachment Id - ID of the resource.
- Name string
- Name of addon.
- Raw
Values string - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - Raw
Values stringType - The type of raw Values. Required with
raw_values
. - Request
Body string - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - Response
Body string - Addon response body.
- Status map[string]string
- Addon current status.
- Values []string
- Values the addon passthroughs. Conflict with
request_body
. - Version string
- Addon version, default latest version. Conflict with
request_body
.
- cluster
Id String - ID of cluster.
- kubernetes
Addon StringAttachment Id - ID of the resource.
- name String
- Name of addon.
- raw
Values String - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw
Values StringType - The type of raw Values. Required with
raw_values
. - request
Body String - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - response
Body String - Addon response body.
- status Map<String,String>
- Addon current status.
- values List<String>
- Values the addon passthroughs. Conflict with
request_body
. - version String
- Addon version, default latest version. Conflict with
request_body
.
- cluster
Id string - ID of cluster.
- kubernetes
Addon stringAttachment Id - ID of the resource.
- name string
- Name of addon.
- raw
Values string - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw
Values stringType - The type of raw Values. Required with
raw_values
. - request
Body string - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - response
Body string - Addon response body.
- status {[key: string]: string}
- Addon current status.
- values string[]
- Values the addon passthroughs. Conflict with
request_body
. - version string
- Addon version, default latest version. Conflict with
request_body
.
- cluster_
id str - ID of cluster.
- kubernetes_
addon_ strattachment_ id - ID of the resource.
- name str
- Name of addon.
- raw_
values str - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw_
values_ strtype - The type of raw Values. Required with
raw_values
. - request_
body str - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - response_
body str - Addon response body.
- status Mapping[str, str]
- Addon current status.
- values Sequence[str]
- Values the addon passthroughs. Conflict with
request_body
. - version str
- Addon version, default latest version. Conflict with
request_body
.
- cluster
Id String - ID of cluster.
- kubernetes
Addon StringAttachment Id - ID of the resource.
- name String
- Name of addon.
- raw
Values String - Raw Values. Conflict with
request_body
. Required withraw_values_type
. - raw
Values StringType - The type of raw Values. Required with
raw_values
. - request
Body String - Serialized json string as request body of addon spec. If set, will ignore
version
andvalues
. - response
Body String - Addon response body.
- status Map<String>
- Addon current status.
- values List<String>
- Values the addon passthroughs. Conflict with
request_body
. - version String
- Addon version, default latest version. Conflict with
request_body
.
Import
Addon can be imported by using cluster_id#addon_name
$ pulumi import tencentcloud:index/kubernetesAddonAttachment:KubernetesAddonAttachment addon_cos cls-xxxxxxxx#cos
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.