Skip to content

Commit fdac784

Browse files
committed
Make node more extendable
1 parent 82fb4bb commit fdac784

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,24 @@ make tctl get users
259259

260260
### Adding another Teleport service
261261

262+
The quickest way to add another Teleport node is to extend `node` from `base/docker-compose.yml`. You just need to
263+
create a new folder for the node (e.g. `node2`) with a `teleport.yaml` file inside - you can copy the existing one
264+
from `node/teleport.yml` and adjust `teleport.nodename`.
265+
266+
Then, in `docker-compose.yml`, add something like
267+
268+
```yaml
269+
node2:
270+
container_name: node2 # for the sake of not having it named `development-node2-1`
271+
hostname: node2 # set the hostname to node2 also
272+
extends:
273+
file: base/docker-compose.yml
274+
service: node
275+
volumes:
276+
- ./data/node2:/var/lib/teleport
277+
- ./node/teleport.yaml:/etc/teleport.yaml
278+
```
279+
262280
In the `docker-compose.yml`, you'll see there are two types of Teleport services running, and they're defined a little
263281
differently.
264282

base/docker-compose.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ services:
2323
WEBPACK_CACHE_DIRECTORY: /webpack/cache
2424

2525
node:
26-
container_name: node
27-
hostname: node
2826
build:
2927
dockerfile: development/build/Dockerfile
3028
context: ../..
@@ -33,9 +31,6 @@ services:
3331
TOOL_FOLDER: ${TOOL_FOLDER}
3432
networks:
3533
- teleport
36-
volumes:
37-
- ../data/node:/var/lib/teleport
38-
- ../node/teleport.yaml:/etc/teleport.yaml
3934

4035
go.teleport:
4136
container_name: go.teleport

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ services:
1010
service: go.teleport
1111

1212
node:
13+
container_name: node
14+
hostname: node
1315
extends:
1416
file: base/docker-compose.yml
1517
service: node
18+
volumes:
19+
- ./data/node:/var/lib/teleport
20+
- ./node/teleport.yaml:/etc/teleport.yaml
1621

1722
networks:
1823
teleport:

0 commit comments

Comments
 (0)