全部產品
Search
文件中心

:DATASOURCE::CS::ClusterUserKubeconfig

更新時間:Sep 30, 2024

DATASOURCE::CS::ClusterUserKubeconfig類型用於根據叢集ID查詢訪問該叢集的Kubeconfig配置。

文法

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

屬性

屬性名稱

類型

必須

允許更新

描述

約束

PrivateIpAddress

Boolean

是否擷取內網串連配置。

取值:

  • true:僅擷取內網串連憑據。

  • false(預設值):僅擷取公網串連憑據。

ClusterId

String

叢集ID。

TemporaryDurationMinutes

Integer

臨時kubeconfig有效期間。

單位:分鐘。取值範圍:15~4320。

說明

當不設定該參數時,將由系統自動確定一個更長的有效期間,具體到期時間通過返回的expiration欄位值確定。

RefreshOptions

String

當資源棧更新時,資料來源資源的重新整理策略。

取值:

  • Never(預設值):更新堆棧時,從不重新整理資料來源資源。

  • Always:更新堆棧時,始終重新整理資料來源資源。

傳回值

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