@@ -14,7 +14,7 @@ This guide makes the following assumptions:
14
14
You have generated the necessary
15
15
\reference{generating-keys}{encryption Keys}.
16
16
}{
17
- The web node will be directly exposed to the internet and can therefore
17
+ The Web node will be directly exposed to the internet and can therefore
18
18
accept inbound traffic on port 443.
19
19
}{
20
20
The Web and Worker node are being installed on separate servers and you
@@ -27,8 +27,8 @@ This guide makes the following assumptions:
27
27
install the CLI in \code{/use/local/concourse}, but you can choose a
28
28
different install location.
29
29
30
- Run the following commands to install the Concourse CLI on both your
31
- Web and Worker servers:
30
+ Run the following commands to install the Concourse CLI. \bold{You need to do
31
+ this on both your Web and Worker servers.}
32
32
\codeblock{bash}{{{
33
33
CONCOURSE_VERSION="<select-a-concourse-version>"
34
34
CONCOURSE_TAR="concourse.tgz"
@@ -45,12 +45,12 @@ This guide makes the following assumptions:
45
45
PATH="$PATH:/usr/local/concourse/bin"
46
46
}}}
47
47
48
- You can move on to setting up the Web node .
48
+ You can move on to setting up the Web and Worker servers .
49
49
}
50
50
51
51
\section{
52
52
\title{Web Node}{systemd-web}
53
- First lets create a new user and group for the web node to run as:
53
+ First lets create a new user and group for the Web node to run as:
54
54
55
55
\codeblock{bash}{{{
56
56
addgroup --system "concourse"
@@ -75,10 +75,19 @@ This guide makes the following assumptions:
75
75
}
76
76
77
77
Next create a file named \code{web.env} in \code{/usr/local/concourse/} that
78
- will be used to configure the web node. This is where you can \reference{configuring-auth}{configure
78
+ will be used to configure the Web node. This is where you can \reference{configuring-auth}{configure
79
79
authentication} to Concourse and all other settings found when you run
80
80
\code{concourse web --help}.
81
81
82
+ Change the following values:
83
+ \list{
84
+ \code{CONCOURSE_POSTGRES_*} - Used to tell Concourse how to connect to PostgreSQL
85
+ }{
86
+ \code{CONCOURSE_EXTERNAL_URL} - The URL users will use to access the web
87
+ UI. A Let's Encrypt certificate will also be generated for the hostname in
88
+ this URL.
89
+ }
90
+
82
91
\codeblock{}{{{
83
92
PATH=/usr/local/concourse/bin
84
93
CONCOURSE_EXTERNAL_URL=https://ci.example.com
@@ -96,9 +105,7 @@ This guide makes the following assumptions:
96
105
CONCOURSE_ADD_LOCAL_USER=local:local
97
106
}}}
98
107
99
- Set the file permissions to read-only and restricted to the \code{concourse}
100
- user and group:
101
-
108
+ Set the file permissions to read-only:
102
109
\codeblock{bash}{{{
103
110
chmod 0444 web.env
104
111
}}}
@@ -116,7 +123,7 @@ This guide makes the following assumptions:
116
123
117
124
\codeblock{}{{{
118
125
[Unit]
119
- Description=Concourse web node
126
+ Description=Concourse Web node
120
127
[Service]
121
128
User=concourse
122
129
Group=concourse
@@ -130,7 +137,7 @@ This guide makes the following assumptions:
130
137
WantedBy=default.target
131
138
}}}
132
139
133
- Finally enable and start the web service:
140
+ Finally enable and start the Web service:
134
141
\codeblock{bash}{{{
135
142
systemctl daemon-reload
136
143
systemctl enable concourse-web
@@ -151,5 +158,97 @@ This guide makes the following assumptions:
151
158
152
159
\section{
153
160
\title{Worker Node}{systemd-worker}
161
+ The Worker has to run as root so there is no user to create. We can go
162
+ straight to configuring the Worker.
163
+
164
+ Ensure the following keys (previously generated) are located in
165
+ \code{/usr/local/concourse/keys/}:
166
+ \list{
167
+ \code{tsa_host_key.pub}
168
+ }{
169
+ \code{worker_key}
170
+ }
171
+
172
+ Create the directory \code{/opt/concourse} where the worker will place
173
+ runtime artifacts. Files in this directory are temporary and are managed by
174
+ the worker.
175
+
176
+ Next create a file named \code{worker.env} in \code{/usr/local/concourse/}
177
+ that will be used to configure the Worker. To see all possible configuration
178
+ options run \code{concourse worker --help} and read more about
179
+ \reference{worker-node}{running a worker node}.
180
+
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
+
188
+ \codeblock{}{{{
189
+ PATH=/usr/local/concourse/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
190
+ CONCOURSE_NAME=worker-01
191
+ CONCOURSE_WORK_DIR=/opt/concourse/worker
192
+ CONCOURSE_TSA_HOST="<web-hostname-or-ip>:2222"
193
+ CONCOURSE_TSA_PUBLIC_KEY=/usr/local/concourse/keys/tsa_host_key.pub
194
+ CONCOURSE_TSA_WORKER_PRIVATE_KEY=/usr/local/concourse/keys/worker_key
195
+ CONCOURSE_RUNTIME=containerd
196
+ CONCOURSE_BAGGAGECLAIM_DRIVER=overlay
197
+ }}}
198
+
199
+ \aside{
200
+ If you're having issues with DNS resolution please read
201
+ \reference{worker-troubleshoot-dns}{this section}.
202
+ }
203
+
204
+ The \code{CONCOURSE_NAME} must be unique per worker. Having two workers with
205
+ the same name will result in a lot of weirdness.
206
+
207
+ Set the file permissions to read-only:
208
+ \codeblock{bash}{{{
209
+ chmod 0444 worker.env
210
+ }}}
211
+
212
+ We can now created a new Systemd Unit file at
213
+ \code{/etc/systemd/system/} named \code{concourse-worker.service}. Place
214
+ the following configuration in the unit file:
215
+
216
+ \codeblock{}{{{
217
+ [Unit]
218
+ Description=Concourse Worker
219
+ [Service]
220
+ User=root
221
+ Group=root
222
+ EnvironmentFile=/usr/local/concourse/worker.env
223
+ ExecStart=/usr/local/concourse/bin/concourse worker
224
+ Restart=on-failure
225
+ RestartSec=3
226
+ KillSignal=SIGUSR2
227
+ SendSIGKILL=yes
228
+ TimeoutStopSec=300
229
+ [Install]
230
+ WantedBy=default.target
231
+ }}}
232
+
233
+ Finally enable and start the Worker service:
234
+ \codeblock{bash}{{{
235
+ systemctl daemon-reload
236
+ systemctl enable concourse-worker
237
+ systemctl start concourse-worker
238
+ }}}
239
+
240
+ Check the status of the service:
241
+ \codeblock{bash}{{{
242
+ systemctl status concourse-worker
243
+ }}}
244
+
245
+ If the service isn't staying up, check the logs:
246
+ \codeblock{bash}{{{
247
+ journalctl -u concourse-worker
248
+ }}}
249
+
250
+ Using the \reference{fly} you should be able to see the worker successfully
251
+ connected to the Web node by running \code{fly workers}.
154
252
253
+ Congratulations, you've successfully deployed a Concourse cluster!
155
254
}
0 commit comments