Skip to content

Commit ace6590

Browse files
committed
Finish writing up guide for running Concourse with Docker Compose
Signed-off-by: Taylor Silva <dev@taydev.net>
1 parent 737e15d commit ace6590

File tree

2 files changed

+191
-14
lines changed

2 files changed

+191
-14
lines changed

lit/docs/install/docker-compose.lit

+160
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,163 @@
11
\title{\aux{Install Concourse with} Docker Compose}{install-docker-compose}
22

33
\use-plugin{concourse-docs}
4+
5+
This guide will show you how to install Concourse on any Linux system
6+
using \link{Docker Compose}{https://docs.docker.com/compose/}.
7+
8+
This guide makes the following assumptions:
9+
\ordered-list{
10+
The host system has Docker installed already.
11+
}{
12+
You have a PostgreSQL database running somewhere already. You created a
13+
database called \code{concourse} and created a user for Concourse to
14+
authenticate as.
15+
}{
16+
You have generated the necessary
17+
\reference{generating-keys}{encryption Keys}.
18+
}{
19+
The host system the Web node will be running on is exposed to the
20+
internet and can therefore accept inbound traffic on port \code{443}.
21+
}{
22+
The Web and Worker node are being installed on separate servers and you
23+
will figure out networking between the two servers. The Web node needs
24+
to accept ingress traffic on the TSA port (default is port \code{2222})
25+
from the Worker node(s).
26+
}
27+
28+
29+
\section{
30+
\title{Setup Web Node}{docker-web}
31+
32+
You can do the following from any directory on your system. This guide
33+
will assume all work is done in \code{~/concourse}.
34+
35+
Create a directory called \code{keys} (\code{~/concourse/keys}). Place
36+
the following encryption keys inside the new directory:
37+
\list{
38+
\code{session_signing_key}
39+
}{
40+
\code{tsa_host_key}
41+
}{
42+
\code{worker_key.pub}
43+
}
44+
45+
Next, create a \code{docker-compose.yml} file
46+
(\code{~/concourse/docker-compose.yml}) with the following content:
47+
48+
\codeblock{yaml}{{{
49+
services:
50+
web:
51+
image: docker.io/concourse/concourse:latest
52+
command: web
53+
restart: "unless-stopped"
54+
ports:
55+
- "443:8080"
56+
- "2222:2222"
57+
volumes:
58+
- ~/concourse/keys:/concourse-keys:ro
59+
environment:
60+
CONCOURSE_EXTERNAL_URL: https://ci.example.com
61+
CONCOURSE_ENABLE_LETS_ENCRYPT: "true"
62+
CONCOURSE_SESSION_SIGNING_KEY: /concourse-keys/session_signing_key
63+
CONCOURSE_TSA_AUTHORIZED_KEYS: /concourse-keys/worker_key.pub
64+
CONCOURSE_TSA_HOST_KEY: /concourse-keys/tsa_host_key
65+
CONCOURSE_POSTGRES_HOST: <psql hostname>
66+
CONCOURSE_POSTGRES_USER: <psql user>
67+
CONCOURSE_POSTGRES_PASSWORD: <psql password>
68+
CONCOURSE_POSTGRES_DATABASE: concourse
69+
CONCOURSE_ADD_LOCAL_USER: test:test
70+
CONCOURSE_MAIN_TEAM_LOCAL_USER: test
71+
CONCOURSE_CLUSTER_NAME: Concourse
72+
CONCOURSE_ENABLE_ACROSS_STEP: "true"
73+
CONCOURSE_ENABLE_REDACT_SECRETS: "true"
74+
CONCOURSE_ENABLE_PIPELINE_INSTANCES: "true"
75+
CONCOURSE_ENABLE_CACHE_STREAMED_VOLUMES: "true"
76+
logging:
77+
driver: local
78+
options:
79+
max-size: "100m"
80+
}}}
81+
82+
\aside{
83+
The above file configues the web node with
84+
\reference{local-auth}{local user authentication} with the username
85+
and password set to \code{test}. You will probably want to configure
86+
your web node with one of the other
87+
\reference{configuring-auth}{authentication providers} and remove the
88+
\code{*_LOCAL_USER} environment variables.
89+
}
90+
91+
You can start the Web node by running:
92+
93+
\codeblock{bash}{{{
94+
docker compose up -d
95+
}}}
96+
97+
You should then be able to access Concourse from the
98+
\code{CONCOURSE_EXTERNAL_URL} you specified.
99+
100+
If you're using local authentication you can login using the
101+
\reference{fly}.
102+
103+
\codeblock{bash}{{{
104+
fly -t ci -c https://ci.example.com -u test -p test
105+
}}}
106+
}
107+
108+
\section{
109+
\title{Setup Worker Node}{docker-worker}
110+
111+
You can do the following from any directory on your system. This guide
112+
will assume all work is done in \code{~/concourse}.
113+
114+
Create a directory called \code{keys} (\code{~/concourse/keys}). Place
115+
the following encryption keys inside the new directory:
116+
\list{
117+
\code{tsa_host_key.pub}
118+
}{
119+
\code{worker_key}
120+
}
121+
122+
Next, create a \code{docker-compose.yml} file
123+
(\code{~/concourse/docker-compose.yml}) with the following content:
124+
125+
\codeblock{yaml}{{{
126+
services:
127+
worker:
128+
image: docker.io/concourse/concourse:latest
129+
command: worker
130+
privileged: true
131+
restart: "unless-stopped"
132+
stop_signal: SIGUSR2
133+
volumes:
134+
- ~/concourse/keys:/concourse-keys:ro
135+
environment:
136+
CONCOURSE_NAME: worker-01
137+
CONCOURSE_RUNTIME: containerd
138+
CONCOURSE_BAGGAGECLAIM_DRIVER: overlay
139+
CONCOURSE_TSA_PUBLIC_KEY: /concourse-keys/tsa_host_key.pub
140+
CONCOURSE_TSA_WORKER_PRIVATE_KEY: /concourse-keys/worker_key
141+
CONCOURSE_TSA_HOST: <web-hostname-or-ip>:2222
142+
logging:
143+
driver: local
144+
options:
145+
max-size: "100m"
146+
}}}
147+
148+
\aside{
149+
If your pipelines are having issues with DNS resolution please read
150+
\reference{worker-troubleshoot-dns}{this section}.
151+
}
152+
153+
You can start the Worker node by running:
154+
155+
\codeblock{bash}{{{
156+
docker compose up -d
157+
}}}
158+
159+
Using the \reference{fly} you should be able to see the worker successfully
160+
connected to the Web node by running \code{fly workers}.
161+
162+
Congratulations, you've successfully deployed a Concourse cluster!
163+
}

lit/docs/install/systemd.lit

+31-14
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ running \link{Systemd}{https://github.com/systemd/systemd}.
88
This guide makes the following assumptions:
99
\ordered-list{
1010
You have a PostgreSQL database running somewhere already. You created a
11-
database called \code{concourse}. You've created a user for Concourse to
11+
database called \code{concourse} and created a user for Concourse to
1212
authenticate as.
1313
}{
1414
You have generated the necessary
1515
\reference{generating-keys}{encryption Keys}.
1616
}{
1717
The Web node will be directly exposed to the internet and can therefore
18-
accept inbound traffic on port 443.
18+
accept inbound traffic on port \code{443}.
1919
}{
2020
The Web and Worker node are being installed on separate servers and you
21-
will figure out networking between the two servers.
21+
will figure out networking between the two servers. The Web node needs
22+
to accept ingress traffic on the TSA port (default is port \code{2222})
23+
from the Worker node(s).
2224
}
2325

2426
\section{
@@ -49,7 +51,7 @@ This guide makes the following assumptions:
4951
}
5052

5153
\section{
52-
\title{Web Node}{systemd-web}
54+
\title{Setup Web Node}{systemd-web}
5355
First lets create a new user and group for the Web node to run as:
5456

5557
\codeblock{bash}{{{
@@ -102,9 +104,22 @@ This guide makes the following assumptions:
102104
CONCOURSE_TSA_AUTHORIZED_KEYS=/usr/local/concourse/keys/worker_key.pub
103105
CONCOURSE_CLUSTER_NAME=Concourse
104106
CONCOURSE_MAIN_TEAM_LOCAL_USER=local
105-
CONCOURSE_ADD_LOCAL_USER=local:local
107+
CONCOURSE_ADD_LOCAL_USER=test:test
108+
CONCOURSE_ENABLE_ACROSS_STEP=true
109+
CONCOURSE_ENABLE_REDACT_SECRETS=true
110+
CONCOURSE_ENABLE_PIPELINE_INSTANCES=true
111+
CONCOURSE_ENABLE_CACHE_STREAMED_VOLUMES=true
106112
}}}
107113

114+
\aside{
115+
The above file configues the web node with
116+
\reference{local-auth}{local user authentication} with the username
117+
and password set to \code{test}. You will probably want to configure
118+
your web node with one of the other
119+
\reference{configuring-auth}{authentication providers} and remove the
120+
\code{*_LOCAL_USER} environment variables.
121+
}
122+
108123
Set the file permissions to read-only:
109124
\codeblock{bash}{{{
110125
chmod 0444 web.env
@@ -154,10 +169,19 @@ This guide makes the following assumptions:
154169
journalctl -u concourse-web
155170
}}}
156171

172+
You should then be able to access Concourse from the
173+
\code{CONCOURSE_EXTERNAL_URL} you specified.
174+
175+
If you're using local authentication you can login using the
176+
\reference{fly}.
177+
178+
\codeblock{bash}{{{
179+
fly -t ci -c https://ci.example.com -u test -p test
180+
}}}
157181
}
158182

159183
\section{
160-
\title{Worker Node}{systemd-worker}
184+
\title{Setup Worker Node}{systemd-worker}
161185
The Worker has to run as root so there is no user to create. We can go
162186
straight to configuring the Worker.
163187

@@ -178,13 +202,6 @@ This guide makes the following assumptions:
178202
options run \code{concourse worker --help} and read more about
179203
\reference{worker-node}{running a worker node}.
180204

181-
Change the following values:
182-
\list{
183-
\code{CONCOURSE_TSA_HOST} - This should be set to a hostname or IP that the
184-
worker can use to reach the Web node, including the TSA port, which defaults
185-
to port 2222.
186-
}
187-
188205
\codeblock{}{{{
189206
PATH=/usr/local/concourse/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
190207
CONCOURSE_NAME=worker-01
@@ -197,7 +214,7 @@ This guide makes the following assumptions:
197214
}}}
198215

199216
\aside{
200-
If you're having issues with DNS resolution please read
217+
If your pipelines are having issues with DNS resolution please read
201218
\reference{worker-troubleshoot-dns}{this section}.
202219
}
203220

0 commit comments

Comments
 (0)