ALIYUN::EDAS::K8sSlbBinding

更新时间:
复制 MD 格式

The ALIYUN::EDAS::K8sSlbBinding type attaches a Server Load Balancer (SLB) instance to an application in a Container Service for Kubernetes cluster.

Syntax

{
  "Type": "ALIYUN::EDAS::K8sSlbBinding",
  "Properties": {
    "Type": String,
    "AppId": String,
    "ClusterId": String,
    "Scheduler": String,
    "Specification": String,
    "LoadBalancerId": String,
    "ServicePortInfos": List
  }
}

Properties

Property nameTypeRequiredUpdate allowedDescriptionConstraints
TypeStringYesNoThe network type of the SLB instance.Valid values:
  • internet: The public network.
  • intranet: The private network.
AppIdStringYesNoThe application ID.None
ClusterIdStringYesNoThe cluster ID.None
SchedulerStringNoNoThe scheduling algorithm.Valid values:
  • wrr: Backend servers with higher weights receive more requests than backend servers with lower weights.
  • rr (default): Requests are distributed to backend servers in sequence.
SpecificationStringNoNoThe specification of the SLB instance.None
LoadBalancerIdStringNoNoThe SLB instance ID.If you do not set this parameter, EDAS automatically purchases an SLB instance.
ServicePortInfosListYesNoThe port mapping settings. Use this parameter for multiple ports or for protocols other than TCP.For more information, see ServicePortInfos properties.

ServicePortInfos syntax

"ServicePortInfos": [
  {
    "TargetPort": Integer,
    "LoadBalancerProtocol": String,
    "CertId": String,
    "Port": Integer
  }
]

ServicePortInfos properties

Property nameTypeRequiredUpdate allowedDescriptionConstraints
TargetPortIntegerYesNoThe backend port.Valid values: 1 to 65535.
LoadBalancerProtocolStringYesNoThe SLB protocol.Valid values:
  • TCP
  • HTTPS
CertIdStringNoNoThe certificate ID.This parameter is required when LoadBalancerProtocol is set to HTTPS.
PortIntegerYesNoThe frontend port.Valid values: 1 to 65535.

Return values

Fn::GetAtt

  • LoadBalancerName: The name of the SLB instance that is defined in EDAS.
  • Address: The address of the SLB instance.
  • AppId: The application ID.
  • ChangeOrderId: The ID of the change process.
  • LoadBalancerId: The SLB instance ID.

Examples

JSON format

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