1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. KubernetesAddon
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.KubernetesAddon

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provide a resource to configure kubernetes cluster app addons.

    Example Usage

    Install tcr addon

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.KubernetesAddon("example", {
        clusterId: "cls-k2o1ws9g",
        addonName: "tcr",
        rawValues: JSON.stringify({
            global: {
                imagePullSecretsCrs: [{
                    name: "tcr-h3ff76s9",
                    namespaces: "*",
                    serviceAccounts: "*",
                    type: "docker",
                    dockerUsername: "100038911322",
                    dockerPassword: "eyJhbGciOiJSUzI1NiIsImtpZCI6************",
                    dockerServer: "testcd.tencentcloudcr.com",
                }],
            },
        }),
    });
    
    import pulumi
    import json
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.KubernetesAddon("example",
        cluster_id="cls-k2o1ws9g",
        addon_name="tcr",
        raw_values=json.dumps({
            "global": {
                "imagePullSecretsCrs": [{
                    "name": "tcr-h3ff76s9",
                    "namespaces": "*",
                    "serviceAccounts": "*",
                    "type": "docker",
                    "dockerUsername": "100038911322",
                    "dockerPassword": "eyJhbGciOiJSUzI1NiIsImtpZCI6************",
                    "dockerServer": "testcd.tencentcloudcr.com",
                }],
            },
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"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 {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"global": map[string]interface{}{
    				"imagePullSecretsCrs": []map[string]interface{}{
    					map[string]interface{}{
    						"name":            "tcr-h3ff76s9",
    						"namespaces":      "*",
    						"serviceAccounts": "*",
    						"type":            "docker",
    						"dockerUsername":  "100038911322",
    						"dockerPassword":  "eyJhbGciOiJSUzI1NiIsImtpZCI6************",
    						"dockerServer":    "testcd.tencentcloudcr.com",
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = tencentcloud.NewKubernetesAddon(ctx, "example", &tencentcloud.KubernetesAddonArgs{
    			ClusterId: pulumi.String("cls-k2o1ws9g"),
    			AddonName: pulumi.String("tcr"),
    			RawValues: pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.KubernetesAddon("example", new()
        {
            ClusterId = "cls-k2o1ws9g",
            AddonName = "tcr",
            RawValues = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["global"] = new Dictionary<string, object?>
                {
                    ["imagePullSecretsCrs"] = new[]
                    {
                        new Dictionary<string, object?>
                        {
                            ["name"] = "tcr-h3ff76s9",
                            ["namespaces"] = "*",
                            ["serviceAccounts"] = "*",
                            ["type"] = "docker",
                            ["dockerUsername"] = "100038911322",
                            ["dockerPassword"] = "eyJhbGciOiJSUzI1NiIsImtpZCI6************",
                            ["dockerServer"] = "testcd.tencentcloudcr.com",
                        },
                    },
                },
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.KubernetesAddon;
    import com.pulumi.tencentcloud.KubernetesAddonArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 KubernetesAddon("example", KubernetesAddonArgs.builder()
                .clusterId("cls-k2o1ws9g")
                .addonName("tcr")
                .rawValues(serializeJson(
                    jsonObject(
                        jsonProperty("global", jsonObject(
                            jsonProperty("imagePullSecretsCrs", jsonArray(jsonObject(
                                jsonProperty("name", "tcr-h3ff76s9"),
                                jsonProperty("namespaces", "*"),
                                jsonProperty("serviceAccounts", "*"),
                                jsonProperty("type", "docker"),
                                jsonProperty("dockerUsername", "100038911322"),
                                jsonProperty("dockerPassword", "eyJhbGciOiJSUzI1NiIsImtpZCI6************"),
                                jsonProperty("dockerServer", "testcd.tencentcloudcr.com")
                            )))
                        ))
                    )))
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:KubernetesAddon
        properties:
          clusterId: cls-k2o1ws9g
          addonName: tcr
          rawValues:
            fn::toJSON:
              global:
                imagePullSecretsCrs:
                  - name: tcr-h3ff76s9
                    namespaces: '*'
                    serviceAccounts: '*'
                    type: docker
                    dockerUsername: '100038911322'
                    dockerPassword: eyJhbGciOiJSUzI1NiIsImtpZCI6************
                    dockerServer: testcd.tencentcloudcr.com
    

    Create KubernetesAddon Resource

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

    Constructor syntax

    new KubernetesAddon(name: string, args: KubernetesAddonArgs, opts?: CustomResourceOptions);
    @overload
    def KubernetesAddon(resource_name: str,
                        args: KubernetesAddonArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def KubernetesAddon(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        addon_name: Optional[str] = None,
                        cluster_id: Optional[str] = None,
                        addon_version: Optional[str] = None,
                        kubernetes_addon_id: Optional[str] = None,
                        raw_values: Optional[str] = None)
    func NewKubernetesAddon(ctx *Context, name string, args KubernetesAddonArgs, opts ...ResourceOption) (*KubernetesAddon, error)
    public KubernetesAddon(string name, KubernetesAddonArgs args, CustomResourceOptions? opts = null)
    public KubernetesAddon(String name, KubernetesAddonArgs args)
    public KubernetesAddon(String name, KubernetesAddonArgs args, CustomResourceOptions options)
    
    type: tencentcloud:KubernetesAddon
    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 KubernetesAddonArgs
    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 KubernetesAddonArgs
    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 KubernetesAddonArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KubernetesAddonArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KubernetesAddonArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    KubernetesAddon 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 KubernetesAddon resource accepts the following input properties:

    AddonName string
    Name of addon.
    ClusterId string
    ID of cluster.
    AddonVersion string
    Version of addon.
    KubernetesAddonId string
    ID of the resource.
    RawValues string
    Params of addon, base64 encoded json format.
    AddonName string
    Name of addon.
    ClusterId string
    ID of cluster.
    AddonVersion string
    Version of addon.
    KubernetesAddonId string
    ID of the resource.
    RawValues string
    Params of addon, base64 encoded json format.
    addonName String
    Name of addon.
    clusterId String
    ID of cluster.
    addonVersion String
    Version of addon.
    kubernetesAddonId String
    ID of the resource.
    rawValues String
    Params of addon, base64 encoded json format.
    addonName string
    Name of addon.
    clusterId string
    ID of cluster.
    addonVersion string
    Version of addon.
    kubernetesAddonId string
    ID of the resource.
    rawValues string
    Params of addon, base64 encoded json format.
    addon_name str
    Name of addon.
    cluster_id str
    ID of cluster.
    addon_version str
    Version of addon.
    kubernetes_addon_id str
    ID of the resource.
    raw_values str
    Params of addon, base64 encoded json format.
    addonName String
    Name of addon.
    clusterId String
    ID of cluster.
    addonVersion String
    Version of addon.
    kubernetesAddonId String
    ID of the resource.
    rawValues String
    Params of addon, base64 encoded json format.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Phase string
    Status of addon.
    Reason string
    Reason of addon failed.
    Id string
    The provider-assigned unique ID for this managed resource.
    Phase string
    Status of addon.
    Reason string
    Reason of addon failed.
    id String
    The provider-assigned unique ID for this managed resource.
    phase String
    Status of addon.
    reason String
    Reason of addon failed.
    id string
    The provider-assigned unique ID for this managed resource.
    phase string
    Status of addon.
    reason string
    Reason of addon failed.
    id str
    The provider-assigned unique ID for this managed resource.
    phase str
    Status of addon.
    reason str
    Reason of addon failed.
    id String
    The provider-assigned unique ID for this managed resource.
    phase String
    Status of addon.
    reason String
    Reason of addon failed.

    Look up Existing KubernetesAddon Resource

    Get an existing KubernetesAddon 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?: KubernetesAddonState, opts?: CustomResourceOptions): KubernetesAddon
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            addon_name: Optional[str] = None,
            addon_version: Optional[str] = None,
            cluster_id: Optional[str] = None,
            kubernetes_addon_id: Optional[str] = None,
            phase: Optional[str] = None,
            raw_values: Optional[str] = None,
            reason: Optional[str] = None) -> KubernetesAddon
    func GetKubernetesAddon(ctx *Context, name string, id IDInput, state *KubernetesAddonState, opts ...ResourceOption) (*KubernetesAddon, error)
    public static KubernetesAddon Get(string name, Input<string> id, KubernetesAddonState? state, CustomResourceOptions? opts = null)
    public static KubernetesAddon get(String name, Output<String> id, KubernetesAddonState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:KubernetesAddon    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:
    AddonName string
    Name of addon.
    AddonVersion string
    Version of addon.
    ClusterId string
    ID of cluster.
    KubernetesAddonId string
    ID of the resource.
    Phase string
    Status of addon.
    RawValues string
    Params of addon, base64 encoded json format.
    Reason string
    Reason of addon failed.
    AddonName string
    Name of addon.
    AddonVersion string
    Version of addon.
    ClusterId string
    ID of cluster.
    KubernetesAddonId string
    ID of the resource.
    Phase string
    Status of addon.
    RawValues string
    Params of addon, base64 encoded json format.
    Reason string
    Reason of addon failed.
    addonName String
    Name of addon.
    addonVersion String
    Version of addon.
    clusterId String
    ID of cluster.
    kubernetesAddonId String
    ID of the resource.
    phase String
    Status of addon.
    rawValues String
    Params of addon, base64 encoded json format.
    reason String
    Reason of addon failed.
    addonName string
    Name of addon.
    addonVersion string
    Version of addon.
    clusterId string
    ID of cluster.
    kubernetesAddonId string
    ID of the resource.
    phase string
    Status of addon.
    rawValues string
    Params of addon, base64 encoded json format.
    reason string
    Reason of addon failed.
    addon_name str
    Name of addon.
    addon_version str
    Version of addon.
    cluster_id str
    ID of cluster.
    kubernetes_addon_id str
    ID of the resource.
    phase str
    Status of addon.
    raw_values str
    Params of addon, base64 encoded json format.
    reason str
    Reason of addon failed.
    addonName String
    Name of addon.
    addonVersion String
    Version of addon.
    clusterId String
    ID of cluster.
    kubernetesAddonId String
    ID of the resource.
    phase String
    Status of addon.
    rawValues String
    Params of addon, base64 encoded json format.
    reason String
    Reason of addon failed.

    Import

    kubernetes cluster app addons can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/kubernetesAddon:KubernetesAddon example cls-k2o1ws9g#tcr
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack