All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::CS::ClusterHelmApplication

Last Updated:Mar 07, 2024

ALIYUN::CS::ClusterHelmApplication is used to deploy an application by using Helm.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

ChartValues

Map

No

Yes

The custom values of the chart.

None.

ClusterId

String

Yes

No

The cluster ID.

None.

ChartUrl

String

Yes

Yes

The request URL of the chart.

None.

Namespace

String

No

No

The namespace of Helm.

None.

Name

String

Yes

No

The chart name.

None.

Credential

Map

No

No

The information about the access credential.

None.

RolePolicy

String

No

Yes

The policy of the user role.

Before you deploy the application, check the policies that are attached to the role of your account.  

Valid values:

  • EnsureAdminRoleAndBinding (default): automatically creates a role named "ros:application-admin:${user-id}\" that has administrator permissions and attaches the role to your account.  

  • None: does not perform operations.

WaitUntil

List

No

Yes

The system waits until all conditions are met after you start to create or update the application.  

For more information, see WaitUntil properties.

ValidationMode

String

No

No

The validation mode.

Valid values:

  • Basic: basic validation. For example, the system validates whether the cluster exists.

  • Strict: strict validation. In addition to a basic validation, the system validates the validity of WaitUntil.  

Credential syntax

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

Credential properties

Property

Type

Required

Editable

Description

Constraint

Password

String

Yes

No

The password.

None.

UserName

String

Yes

No

The username.

None.

WaitUntil syntax

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

WaitUntil properties

Property

Type

Required

Editable

Description

Constraint

FirstMatch

Boolean

No

Yes

Specifies whether to return only the first matching result in the results that are filtered by using the JSONPath expression.  

Valid values:

  • true

  • false (default)

Timeout

Integer

No

Yes

The timeout period for waiting for the conditions to be met.

Unit: seconds.

JsonPath

String

No

Yes

The JSONPath expression that you want to use to filter results.

None.

Namespace

String

No

Yes

The Kubernetes namespace of the resource.

Default value: DefaultNamespace.  

Stage

String

No

No

The one or more stages at which the system waits.   

Valid values:

  • Create/Update (default): creation and update stages

  • Delete: deletion stage  

Name

String

Yes

Yes

The name of the Kubernetes resource that you want to query.

None.

ValueType

String

No

Yes

The value type.

Default value: String.

Kind

String

Yes

Yes

The type of the Kubernetes resource that you want to query.

None.

Value

String

No

Yes

The value to be compared with the result of the JSONPath expression.  

None.

Operator

String

Yes

Yes

The operator that you want to use in the comparison between the value and the result of the JSONPath expression.  

None.

Return values

Fn::GetAtt

ClusterId: the cluster ID.

Examples

YAML format

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 format

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