ALIYUN::EDAS::K8sSlbBinding类型用于将SLB实例绑定到容器服务Kubernetes集群中的应用。
语法
{
  "Type": "ALIYUN::EDAS::K8sSlbBinding",
  "Properties": {
    "Type": String,
    "AppId": String,
    "ClusterId": String,
    "Scheduler": String,
    "Specification": String,
    "LoadBalancerId": String,
    "ServicePortInfos": List
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|---|---|---|---|---|
| Type | String | 是 | 否 | SLB实例网络类型。 | 取值: 
 | 
| AppId | String | 是 | 否 | 应用ID。 | 无 | 
| ClusterId | String | 是 | 否 | 集群ID。 | 无 | 
| Scheduler | String | 否 | 否 | 调度算法。 | 取值: 
 | 
| Specification | String | 否 | 否 | SLB实例的规格。 | 无 | 
| LoadBalancerId | String | 否 | 否 | SLB实例ID。 | 如果不设置该参数,EDAS将自动购买SLB实例。 | 
| ServicePortInfos | List | 是 | 否 | 多个端口需求以及非TCP协议需填写的字段。 | 更多信息,请参见ServicePortInfos属性。 | 
ServicePortInfos语法
"ServicePortInfos": [
  {
    "TargetPort": Integer,
    "LoadBalancerProtocol": String,
    "CertId": String,
    "Port": Integer
  }
]ServicePortInfos属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|---|---|---|---|---|
| TargetPort | Integer | 是 | 否 | 后端端口。 | 取值范围:1~65,535。 | 
| LoadBalancerProtocol | String | 是 | 否 | SLB协议。 | 取值: 
 | 
| CertId | String | 否 | 否 | 证书ID。 | 当LoadBalancerProtocol取值为HTTPS时,必须指定该参数。 | 
| Port | Integer | 是 | 否 | 前端端口。 | 取值范围:1~65,535。 | 
返回值
Fn::GetAtt
- LoadBalancerName:在EDAS中定义的SLB实例名称。
- Address:SLB实例地址。
- AppId:应用ID。
- ChangeOrderId:变更流程ID。
- LoadBalancerId:SLB实例ID。
示例
JSON格式
                  
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Type": {
      "Type": "String",
      "Description": "The type of the SLB instance. Valid values: internet and intranet.",
      "AllowedValues": [
        "internet",
        "intranet"
      ],
      "Default": "internet"
    },
    "AppId": {
      "Type": "String",
      "Description": "The ID of the application.",
      "Default": "5a166fbd-****-****-a286-781659d9f54c"
    },
    "ClusterId": {
      "Type": "String",
      "Description": "The ID of the cluster.",
      "Default": "712082c3-f554-****-****-a947b5cde6ee"
    },
    "ServicePortInfos": {
      "Type": "Json",
      "Description": "The information about the ports.",
      "MinLength": 1,
      "Default": [
        {
          "TargetPort": 8080,
          "LoadBalancerProtocol": "TCP",
          "Port": 80
        }
      ]
    }
  },
  "Resources": {
    "K8sSlbBinding": {
      "Type": "ALIYUN::EDAS::K8sSlbBinding",
      "Properties": {
        "Type": {
          "Ref": "Type"
        },
        "AppId": {
          "Ref": "AppId"
        },
        "ClusterId": {
          "Ref": "ClusterId"
        },
        "ServicePortInfos": {
          "Ref": "ServicePortInfos"
        }
      }
    }
  },
  "Outputs": {
    "LoadBalancerName": {
      "Description": "The name of load balancer instance defined in EDAS.",
      "Value": {
        "Fn::GetAtt": [
          "K8sSlbBinding",
          "LoadBalancerName"
        ]
      }
    },
    "Address": {
      "Description": "The address of load balancer instance.",
      "Value": {
        "Fn::GetAtt": [
          "K8sSlbBinding",
          "Address"
        ]
      }
    },
    "AppId": {
      "Description": "The ID of the application.",
      "Value": {
        "Fn::GetAtt": [
          "K8sSlbBinding",
          "AppId"
        ]
      }
    },
    "ChangeOrderId": {
      "Description": "The ID of the change process.",
      "Value": {
        "Fn::GetAtt": [
          "K8sSlbBinding",
          "ChangeOrderId"
        ]
      }
    },
    "LoadBalancerId": {
      "Description": "The ID of load balancer instance.",
      "Value": {
        "Fn::GetAtt": [
          "K8sSlbBinding",
          "LoadBalancerId"
        ]
      }
    }
  }
}