文档

ALIYUN::CS::ClusterHelmApplication

更新时间:

ALIYUN::CS::ClusterHelmApplication类型用于使用Helm进行应用部署。

语法

{
  "Type": "ALIYUN::CS::ClusterHelmApplication",
  "Properties": {
    "ChartValues": Map,
    "ClusterId": String,
    "ChartUrl": String,
    "Namespace": String,
    "Name": String,
    "Credential": Map,
    "RolePolicy": String,
    "WaitUntil": List,
    "ValidationMode": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ChartValues

Map

Chart自定义值。

ClusterId

String

集群ID。

ChartUrl

String

Chart请求地址。

Namespace

String

Helm的命名空间。

Name

String

Chart名称。

Credential

Map

访问凭证信息。

RolePolicy

String

用户的角色关联的策略。

在部署应用程序之前,请检查与当前用户的角色关联的策略。 

取值:

  • EnsureAdminRoleAndBinding(默认值):自动创建一个名为ros:application-admin:${user-id}\的角色,具有管理员权限,并将其绑定到当前用户。 

  • None:不执行任何操作。

WaitUntil

List

开始创建或更新后,等待直到满足所有条件。 

更多信息,请参见WaitUntil属性

ValidationMode

String

验证模式。

取值:

  • Basic:基本验证,例如验证集群是否存在。

  • Strict:除了基本验证外,还验证WaitUntil的合法性。 

Credential语法

"Credential": [
  {
    "Password": String,
    "UserName": String
  }
]

Credential属性

属性名称

类型

必须

允许更新

描述

约束

Password

String

密码。

UserName

String

用户名。

WaitUntil语法

"WaitUntil": [
  {
   "FirstMatch": Boolean,
   "Timeout": Integer,
   "JsonPath": String,
   "Namespace": String,
   "Stage": String,
   "Name": String,
   "ValueType": String,
   "Kind": String,
   "Value": String,
   "Operator": String
  }
]

WaitUntil属性

属性名称

类型

必须

允许更新

描述

约束

FirstMatch

Boolean

只返回JsonPath过滤结果中的第一个匹配结果。 

取值:

  • true

  • false(默认值)

Timeout

Integer

等待满足条件的超时时间。

单位为秒。

JsonPath

String

Json路径表达式来过滤输出。

Namespace

String

资源所在的Kubernetes的命名空间。

默认值为DefaultNamespace。 

Stage

String

在什么阶段等待。  

取值:

  • Create/Update(默认值):创建和更新阶段。

  • Delete:删除阶段。 

Name

String

要查询的Kubernetes资源名称。

ValueType

String

值的类型。

默认值为String。

Kind

String

要查询的Kubernetes资源类型。

Value

String

要与JsonPath表达式的结果进行比较的值。 

Operator

String

将值与JsonPath表达式的结果进行比较的操作符。 

返回值

Fn::GetAtt

  • ClusterId:集群ID。

  • WaitUntilData:WaitUntil中每个JsonPath的值列表。 

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ChartUrl:
    AllowedPattern: ^(http|https)://[\w\W]+$
    Description: The URL of chart. Supports HTTP or HTTPS.
    Type: String
  ClusterId:
    Description: The ID of the kubernetes cluster.
    Type: String
  Name:
    Description: The name for helm release.
    Type: String
Resources:
  ClusterHelmApplication:
    Properties:
      ChartUrl:
        Ref: ChartUrl
      ClusterId:
        Ref: ClusterId
      Name:
        Ref: Name
    Type: ALIYUN::CS::ClusterHelmApplication
Outputs:
  ClusterId:
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
      - ClusterHelmApplication
      - ClusterId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterId": {
      "Type": "String",
      "Description": "The ID of the kubernetes cluster."
    },
    "ChartUrl": {
      "Type": "String",
      "Description": "The URL of chart. Supports HTTP or HTTPS.",
      "AllowedPattern": "^(http|https)://[\\w\\W]+$"
    },
    "Name": {
      "Type": "String",
      "Description": "The name for helm release."
    }
  },
  "Resources": {
    "ClusterHelmApplication": {
      "Type": "ALIYUN::CS::ClusterHelmApplication",
      "Properties": {
        "ClusterId": {
          "Ref": "ClusterId"
        },
        "ChartUrl": {
          "Ref": "ChartUrl"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "ClusterId": {
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "ClusterHelmApplication",
          "ClusterId"
        ]
      }
    }
  }
}
  • 本页导读 (1)
文档反馈