Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Sort label keys in longhelp.
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Apr 5, 2016
1 parent 626ade0 commit 6d3a073
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 84 deletions.
168 changes: 84 additions & 84 deletions Longhelp.md
Original file line number Diff line number Diff line change
Expand Up @@ -631,60 +631,35 @@ Ex: `HAPROXY_0_HTTP_BACKEND_REDIR = '/path/to/resource/'`
## Other Labels
These labels may be used to configure other app settings.

## `HAPROXY_{n}_VHOST`
## `HAPROXY_{n}_BALANCE`
*per service port*

Specified as `HAPROXY_{n}_VHOST`.

The Marathon HTTP Virtual Host proxy hostname(s) to gather.
Specified as `HAPROXY_{n}_BALANCE`.

Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com'`
Set the load balancing algorithm to be used in a backend. The default is
roundrobin.

Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com,marathon'`
Ex: `HAPROXY_0_BALANCE = 'leastconn'`


## `HAPROXY_{n}_GROUP`
## `HAPROXY_{n}_BIND_ADDR`
*per service port*

Specified as `HAPROXY_{n}_GROUP` or `HAPROXY_GROUP`.

HAProxy group per service. This helps us have different HAProxy groups
per service port. This overrides `HAPROXY_GROUP` for the particular service.
If you have both external and internal services running on same set of
instances on different ports, you can use this feature to add them to
different haproxy configs.

Ex: `HAPROXY_0_GROUP = 'external'`

Ex: `HAPROXY_1_GROUP = 'internal'`

Now if you run marathon_lb with --group external, it just adds the
service on `HAPROXY_0_PORT` (or first service port incase `HAPROXY_0_HOST`
is not configured) to haproxy config and similarly if you run it with
--group internal, it adds service on `HAPROXY_1_PORT` to haproxy config.
If the configuration is a combination of `HAPROXY_GROUP` and
`HAPROXY_{n}_GROUP`, the more specific definition takes precedence.

Ex: `HAPROXY_0_GROUP = 'external'`
Specified as `HAPROXY_{n}_BIND_ADDR`.

Ex: `HAPROXY_GROUP = 'internal'`
Bind to the specific address for the service.

Considering the above example where the configuration is hybrid,
a service running on `HAPROXY_0_PORT` is associated with just 'external'
HAProxy group and not 'internal' group. And since there is no HAProxy
group mentioned for second service (`HAPROXY_1_GROUP` not defined)
it falls back to default `HAPROXY_GROUP` and gets associated with
'internal' group.
Ex: `HAPROXY_0_BIND_ADDR = '10.0.0.42'`


Load balancers with the group '*' will collect all groups.
## `HAPROXY_{n}_BIND_OPTIONS`
*per service port*

## `HAPROXY_DEPLOYMENT_GROUP`
*per app*
Specified as `HAPROXY_{n}_BIND_OPTIONS`.

Specified as `HAPROXY_DEPLOYMENT_GROUP`.
Set additional bind options

Deployment group to which this app belongs.
Ex: `HAPROXY_0_BIND_OPTIONS = 'ciphers AES128+EECDH:AES128+EDH force-tlsv12 no-sslv3'`


## `HAPROXY_DEPLOYMENT_ALT_PORT`
Expand All @@ -705,6 +680,14 @@ to determine the state of a deploy. You generally do not need to modify
this unless you implement your own deployment orchestrator.


## `HAPROXY_DEPLOYMENT_GROUP`
*per app*

Specified as `HAPROXY_DEPLOYMENT_GROUP`.

Deployment group to which this app belongs.


## `HAPROXY_DEPLOYMENT_STARTED_AT`
*per app*

Expand All @@ -724,103 +707,120 @@ generally do not need to modify this unless you implement your
own deployment orchestrator.


## `HAPROXY_{n}_PATH`
## `HAPROXY_{n}_GROUP`
*per service port*

Specified as `HAPROXY_{n}_PATH`.
Specified as `HAPROXY_{n}_GROUP` or `HAPROXY_GROUP`.

HAProxy group per service. This helps us have different HAProxy groups
per service port. This overrides `HAPROXY_GROUP` for the particular service.
If you have both external and internal services running on same set of
instances on different ports, you can use this feature to add them to
different haproxy configs.

## `HAPROXY_{n}_STICKY`
*per service port*
Ex: `HAPROXY_0_GROUP = 'external'`

Specified as `HAPROXY_{n}_STICKY`.
Ex: `HAPROXY_1_GROUP = 'internal'`

Enable sticky request routing for the service.
Now if you run marathon_lb with --group external, it just adds the
service on `HAPROXY_0_PORT` (or first service port incase `HAPROXY_0_HOST`
is not configured) to haproxy config and similarly if you run it with
--group internal, it adds service on `HAPROXY_1_PORT` to haproxy config.
If the configuration is a combination of `HAPROXY_GROUP` and
`HAPROXY_{n}_GROUP`, the more specific definition takes precedence.

Ex: `HAPROXY_0_STICKY = true`

Ex: `HAPROXY_0_GROUP = 'external'`

## `HAPROXY_{n}_REDIRECT_TO_HTTPS`
Ex: `HAPROXY_GROUP = 'internal'`

Considering the above example where the configuration is hybrid,
a service running on `HAPROXY_0_PORT` is associated with just 'external'
HAProxy group and not 'internal' group. And since there is no HAProxy
group mentioned for second service (`HAPROXY_1_GROUP` not defined)
it falls back to default `HAPROXY_GROUP` and gets associated with
'internal' group.

Load balancers with the group '*' will collect all groups.


## `HAPROXY_{n}_MODE`
*per service port*

Specified as `HAPROXY_{n}_REDIRECT_TO_HTTPS`.
Specified as `HAPROXY_{n}_MODE`.

Redirect HTTP traffic to HTTPS. Requires at least a VHost be set.
Set the connection mode to either TCP or HTTP. The default is TCP.

Ex: `HAPROXY_0_REDIRECT_TO_HTTPS = true`
Ex: `HAPROXY_0_MODE = 'http'`


## `HAPROXY_{n}_USE_HSTS`
## `HAPROXY_{n}_PATH`
*per service port*

Specified as `HAPROXY_{n}_USE_HSTS`.

Enable the HSTS response header for HTTP clients which support it.
Specified as `HAPROXY_{n}_PATH`.

Ex: `HAPROXY_0_USE_HSTS = true`

## `HAPROXY_{n}_SSL_CERT`
## `HAPROXY_{n}_PORT`
*per service port*

Specified as `HAPROXY_{n}_SSL_CERT`.
Specified as `HAPROXY_{n}_PORT`.

Enable the given SSL certificate for TLS/SSL traffic.
Bind to the specific port for the service.
This overrides the servicePort which has to be unique.

Ex: `HAPROXY_0_SSL_CERT = '/etc/ssl/certs/marathon.mesosphere.com'`
Ex: `HAPROXY_0_PORT = 80`


## `HAPROXY_{n}_BIND_OPTIONS`
## `HAPROXY_{n}_REDIRECT_TO_HTTPS`
*per service port*

Specified as `HAPROXY_{n}_BIND_OPTIONS`.
Specified as `HAPROXY_{n}_REDIRECT_TO_HTTPS`.

Set additional bind options
Redirect HTTP traffic to HTTPS. Requires at least a VHost be set.

Ex: `HAPROXY_0_BIND_OPTIONS = 'ciphers AES128+EECDH:AES128+EDH force-tlsv12 no-sslv3'`
Ex: `HAPROXY_0_REDIRECT_TO_HTTPS = true`


## `HAPROXY_{n}_BIND_ADDR`
## `HAPROXY_{n}_SSL_CERT`
*per service port*

Specified as `HAPROXY_{n}_BIND_ADDR`.
Specified as `HAPROXY_{n}_SSL_CERT`.

Bind to the specific address for the service.
Enable the given SSL certificate for TLS/SSL traffic.

Ex: `HAPROXY_0_BIND_ADDR = '10.0.0.42'`
Ex: `HAPROXY_0_SSL_CERT = '/etc/ssl/certs/marathon.mesosphere.com'`


## `HAPROXY_{n}_PORT`
## `HAPROXY_{n}_STICKY`
*per service port*

Specified as `HAPROXY_{n}_PORT`.
Specified as `HAPROXY_{n}_STICKY`.

Bind to the specific port for the service.
This overrides the servicePort which has to be unique.
Enable sticky request routing for the service.

Ex: `HAPROXY_0_PORT = 80`
Ex: `HAPROXY_0_STICKY = true`


## `HAPROXY_{n}_MODE`
## `HAPROXY_{n}_USE_HSTS`
*per service port*

Specified as `HAPROXY_{n}_MODE`.
Specified as `HAPROXY_{n}_USE_HSTS`.

Set the connection mode to either TCP or HTTP. The default is TCP.
Enable the HSTS response header for HTTP clients which support it.

Ex: `HAPROXY_0_MODE = 'http'`
Ex: `HAPROXY_0_USE_HSTS = true`


## `HAPROXY_{n}_BALANCE`
## `HAPROXY_{n}_VHOST`
*per service port*

Specified as `HAPROXY_{n}_BALANCE`.
Specified as `HAPROXY_{n}_VHOST`.

Set the load balancing algorithm to be used in a backend. The default is
roundrobin.
The Marathon HTTP Virtual Host proxy hostname(s) to gather.

Ex: `HAPROXY_0_BALANCE = 'leastconn'`
Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com'`

Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com,marathon'`



2 changes: 2 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,8 @@ def __init__(self, name, func, description, perServicePort=True):
func=set_label,
description=''))

labels.sort(key=lambda l: l.name)

label_keys = {}
for label in labels:
if not label.func:
Expand Down

0 comments on commit 6d3a073

Please sign in to comment.