全部产品
Search
文档中心

资源编排:DATASOURCE::CS::ClusterUserKubeconfig

更新时间:Jun 09, 2023

DATASOURCE::CS::ClusterUserKubeconfig类型用于根据集群ID查询访问该集群的kubeconfig配置。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

PrivateIpAddress

Boolean

是否获取内网连接配置。

取值:

  • true:仅获取内网连接凭据。

  • false(默认值):仅获取公网连接凭据。

ClusterId

String

集群ID。

TemporaryDurationMinutes

Integer

临时kubeconfig有效期。

单位:分钟。取值范围:15~4320。

说明

当不设置该参数时,将由系统自动确定一个更长的有效期,具体过期时间通过返回的expiration字段值确定。

返回值

Fn::GetAtt

  • ClusterId:ACK集群的ID。

  • Config:集群访问配置。

  • Expiration:kubeconfig的过期时间。以RFC3339格式显示的UTC时间。 

示例

YAML格式

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格式

{
  "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"
        ]
      }
    }
  }
}