IP Leases within SDL
To illustrate the use of an IP Leases the simple Hello World SDL is used. Please refer to the full SDL used in this document for further clarification on the place of reviewed stanzas.
IP Leases can be included in any SDL via the addition of the endpoints section. The endpoints section must be created at the top level of the SDL.
In this example we name the endpoint
myendpointbut could be any name of your choosing.
The kind is defined as
ipwhich is the only valid option at this time. This adds a requirement that the SDL leases exactly one IPv4 address from a provider.
NOTE - the endpoint name must be unique across your deployments on a single provider. Using the example - if we tried to use
myendpointin another deployment and on the same provider - no IP lease would be created on that second deployment.
In the services stanza we create the association with the endpoint detailed previously.
In this example we have a service running a docker container with port
3000globally exposed. Additionally the
myendpointendpoint is defined via the
NOTE - if an endpoint is declared in an SDL, it must be used at least once. Specifying an endpoint name that is not declared results in an error during deployment.
- port: 3000
- global: true
NOTE - it is no longer necessary to specify the
ip-leaseattribute covered in this section as the bid engine now filters out non-IP lease capable providers when an IP endpoint is required by the deployment. This is now an optional and not required step.
Include the attribute key-value pair of
ip-lease: truein the SDL. This ensures that only provider advertising this attribute will bid on the workload.