# Load-balancing policy spec using Neutron LBaaS service
type: senlin.policy.loadbalance
version: 1.1
description: A policy for load-balancing the nodes in a cluster.
properties:
  pool:
    # Protocol used for load balancing
    protocol: HTTP

    # Port on which servers are running on the members
    protocol_port: 80

    # Name or ID of subnet for the port on which members can be
    # connected.
    subnet: private-subnet

    # Valid values include: ROUND_ROBIN, LEAST_CONNECTIONS, SOURCE_IP
    lb_method: ROUND_ROBIN

    session_persistence:
      # type of session persistence, valid values include:
      # SOURCE_IP, HTTP_COOKIE, APP_COOKIE
      type: SOURCE_IP
      # Name of cookie if type set to APP_COOKIE
      cookie_name: whatever

    # ID of pool for the cluster on which nodes can be connected.
    # id: <ID>

  vip:
    # Name or ID of Subnet on which VIP address will be allocated
    subnet: public-subnet

    # IP address of the VIP
    # address: <ADDRESS>

    # Max #connections per second allowed for this VIP
    connection_limit: 500

    # Protocol used for VIP
    protocol: HTTP

    # TCP port to listen on
    protocol_port: 80

  health_monitor:
    # The type of probe sent by the load balancer to verify the member state,
    # can be PING, TCP, HTTP, or HTTPS.
    type: 'PING'

    # The amount of time, in milliseconds, between sending probes to members.
    delay: 10000

    # The maximum time in milliseconds that a monitor waits to connect before
    # it times out. This value must be less than the delay value.
    timeout: 5000

    # The number of allowed connection failures before changing the status
    # of the member to INACTIVE. A valid value is from 1 to 10.
    max_retries: 4

    # The HTTP method that the monitor uses for requests.
    http_method: 'GET'

    # The HTTP path of the request sent by the monitor to test the health of
    # a member. A string value that must begin with the forward slash '/'.
    url_path: '/index.html'

    # Expected HTTP codes for a passing HTTP(S) monitor.
    expected_codes: '200, 202'

    # ID of the health manager for the loadbalancer.
    # id: <ID>

  # Time in second to wait for loadbalancer to become ready before and after
  # senlin requests lbaas V2 service for lb operations.
  lb_status_timeout: 300

  # Name or ID of loadbalancer for the cluster on which nodes can be connected.
  # loadbalancer: <ID>
