All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::CS::ClusterUserKubeconfig

Last Updated:Jul 11, 2023

DATASOURCE::CS::ClusterUserKubeconfig is used to query the kubeconfig configurations of a Container Service for Kubernetes (ACK) cluster by cluster ID.

Syntax

{
  "Type": "DATASOURCE::CS::ClusterUserKubeconfig",
  "Properties": {
    "PrivateIpAddress": Boolean,
    "ClusterId": String,
    "TemporaryDurationMinutes": Integer
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

PrivateIpAddress

Boolean

No

Yes

Specifies whether to only obtain the kubeconfig file that is used to access the cluster over an internal network.

Valid values:

  • true: only obtains the kubeconfig file that is used to access the cluster over an internal network.

  • false (default): only obtains the kubeconfig file that is used to access the cluster over the Internet.

ClusterId

String

Yes

Yes

The cluster ID.

None.

TemporaryDurationMinutes

Integer

No

Yes

The validity period of the temporary kubeconfig file.

Unit: minutes. Valid values: 15 to 4320.

Note

If you leave this property empty, the system automatically specifies a validity period. You can obtain the validity period from the value of Expiration in the response.

Return values

Fn::GetAtt

  • ClusterId: the cluster ID.

  • Config: the access configurations of the cluster.

  • Expiration: the expiration time of the kubeconfig file. The time follows the RFC3339 format. The time is displayed in UTC.  

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClusterId:
    Description: The ID of the ACK cluster.
    Type: String
Resources:
  ClusterUserKubeconfig:
    Properties:
      ClusterId:
        Ref: ClusterId
    Type: DATASOURCE::CS::ClusterUserKubeconfig
Outputs:
  ClusterId:
    Description: The ID of the ACK cluster.
    Value:
      Fn::GetAtt:
      - ClusterUserKubeconfig
      - ClusterId
  Config:
    Description: The content of the kubeconfig file.
    Value:
      Fn::GetAtt:
      - ClusterUserKubeconfig
      - Config
  Expiration:
    Description: The expiration time of the kubeconfig file. The value is the UTC
      time displayed in RFC3339 format.
    Value:
      Fn::GetAtt:
      - ClusterUserKubeconfig
      - Expiration

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterId": {
      "Type": "String",
      "Description": "The ID of the ACK cluster."
    }
  },
  "Resources": {
    "ClusterUserKubeconfig": {
      "Type": "DATASOURCE::CS::ClusterUserKubeconfig",
      "Properties": {
        "ClusterId": {
          "Ref": "ClusterId"
        }
      }
    }
  },
  "Outputs": {
    "ClusterId": {
      "Description": "The ID of the ACK cluster.",
      "Value": {
        "Fn::GetAtt": [
          "ClusterUserKubeconfig",
          "ClusterId"
        ]
      }
    },
    "Config": {
      "Description": "The content of the kubeconfig file.",
      "Value": {
        "Fn::GetAtt": [
          "ClusterUserKubeconfig",
          "Config"
        ]
      }
    },
    "Expiration": {
      "Description": "The expiration time of the kubeconfig file. The value is the UTC time displayed in RFC3339 format.",
      "Value": {
        "Fn::GetAtt": [
          "ClusterUserKubeconfig",
          "Expiration"
        ]
      }
    }
  }
}