Skip to content

Commit 6022e6c

Browse files
author
Arne-Christian Blystad
committed
docs(controller): add unit hostname documentation
The documentation explains how to configure the new unitHostname etcd option for controlling what hostname is exposed to the Docker containers
1 parent 4b791d2 commit 6022e6c

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

docs/customizing_deis/controller_settings.rst

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ Settings set by controller
1919
--------------------------
2020
The following etcd keys are set by the controller component, typically in its /bin/boot script.
2121

22-
=========================== =================================================================================
22+
============================= =================================================================================
2323
setting description
24-
=========================== =================================================================================
24+
============================= =================================================================================
2525
/deis/controller/host IP address of the host running controller
2626
/deis/controller/port port used by the controller service (default: 8000)
2727
/deis/controller/protocol protocol for controller (default: http)
2828
/deis/controller/secretKey used for secrets (default: randomly generated)
2929
/deis/controller/builderKey used by builder to authenticate with the controller (default: randomly generated)
30+
/deis/controller/unitHostname See `Unit hostname`_. (default: "default")
3031
/deis/builder/users/* stores user SSH keys (used by builder)
3132
/deis/domains/* domain configuration for applications (used by router)
32-
=========================== =================================================================================
33+
============================= =================================================================================
3334

3435
Settings used by controller
3536
---------------------------
@@ -73,3 +74,35 @@ Be sure that your custom image functions in the same way as the `stock controlle
7374
Deis. Specifically, ensure that it sets and reads appropriate etcd keys.
7475

7576
.. _`stock controller image`: https://github.com/deis/deis/tree/master/controller
77+
78+
Unit hostname
79+
-------------
80+
Per default, Docker automatically generates a hostname for your application unit, such as:
81+
``5c149b397cd6``. Auto generated hostnames is not always preferred. For instance,
82+
New Relic would classify each Docker container as an unique server since they use hostname
83+
for grouping applications running on the same server together.
84+
85+
Deis supports configuring hostname assignment through the ``unitHostname`` setting.
86+
You can change the assignment solution using the following command:
87+
88+
.. code-block:: console
89+
90+
$ deisctl config controller set unitHostname=application
91+
92+
The valid ``unitHostname`` values are:
93+
94+
default
95+
Docker will generate the hostname. Example: ``5c149b397cd6``
96+
97+
application
98+
The hostname is assigned based on the unit name. Example: ``dancing-cat.v2.web.1``
99+
100+
server
101+
The hostname is assigned based on the CoreOS hostname. Example:
102+
``ip-10-21-2-168.eu-west-1.compute.internal``
103+
104+
.. note::
105+
106+
Changes to ``/deis/controller/unitHostname`` requires either pushing a new build to
107+
every application or scaling them down and up.
108+
The change is only detected when a container unit is deployed.

0 commit comments

Comments
 (0)