You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/admin/provisioners.md
+21-23Lines changed: 21 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,34 @@
1
1
# External provisioners
2
2
3
-
By default, the Coder server runs [built-in provisioner daemons](../cli/coder_server.md#provisioner-daemons), which execute `terraform` during workspace and template builds. You can learn more about `provisionerd` in our [architecture documentation](../about/architecture.md#provisionerd).
3
+
By default, the Coder server runs [built-in provisioner daemons](../cli/coder_server.md#provisioner-daemons), which execute `terraform` during workspace and template builds. However, there are sometimes benefits to running external provisioner daemons:
4
4
5
-
> While external provisioners are stable, the feature is in an [alpha state](../contributing/feature-stages.md#alpha-features) and the behavior is subject to change in future releases. Use [GitHub issues](https://github.com/coder/coder)to leave feedback.
5
+
-**Secure build environments:** Run build jobs in isolated containers, preventing malicious templates from gaining shell access to the Coder host.
6
6
7
-
## Benefits of external provisioners
7
+
-**Isolate APIs:** Deploy provisioners in isolated environments (on-prem, AWS, Azure) instead of exposing APIs (Docker, Kubernetes, VMware) to the Coder server. See [Provider Authentication](../templates/authentication.md) for more details.
8
8
9
-
There are benefits in running external provisioner servers.
9
+
-**Isolate secrets**: Keep Coder unaware of cloud secrets, manage/rotate secrets on provisoner servers.
10
10
11
-
### Security
11
+
-**Reduce server load**: External provisioners reduce load and build queue times from the Coder server. See [Scaling Coder](./scale.md#concurrent-workspace-builds) for more details.
12
12
13
-
As you add more (template) admins in Coder, there is an increased risk of malicious code being added into templates. Isolated provisioners can prevent template admins from running code directly against the Coder server, database, or host machine.
13
+
> External provisioners are in an [alpha state](../contributing/feature-stages.md#alpha-features) and the behavior is subject to change. Use [GitHub issues](https://github.com/coder/coder) to leave feedback.
14
14
15
-
Additionally, you can configure provisioner environments to access cloud secrets that you would like to conceal from the Coder server.
15
+
## Running external provisioners
16
16
17
-
### Extensibility
17
+
Each provisioner can run a single [concurrent workspace build](./scale.md#concurrent-workspace-builds). For example, running 30 provisioner containers will allow 30 users to start workspaces at the same time.
18
18
19
-
Instead of exposing an entire API and secrets (e.g. Kubernetes, Docker, VMware) to the Coder server, you can run provisioners in each environment. See [Provider authentication](../templates/authentication.md) for more details.
19
+
### Requirements
20
20
21
-
### Scalability
21
+
- The [Coder CLI](../cli.md) must installed on and authenticated as a user with the Owner or Template Admin role.
22
+
- Your environment must be [authenticated](../templates/authentication.md) against the cloud environments templates need to provision against.
22
23
23
-
External provisioners can reduce load and build queue times from the Coder server. See [Scaling Coder](./scale.md#concurrent-workspace-builds) for more details.
24
-
25
-
## Run an external provisioner
26
-
27
-
Once authenticated as a user with the Template Admin or Owner role, the [Coder CLI](../cli.md) can launch external provisioners. There are 3 types of provisioners:
24
+
### Types of provisioners
28
25
29
26
-**Generic provisioners** can pick up any build job from templates without provisioner tags.
30
27
31
28
```sh
32
29
coder provisionerd start
33
30
```
34
31
35
-
> Ensure all provisioners (including [built-in provisioners](#disable-built-in-provisioners)) have similar configuration/cloud access. Otherwise, users may run into intermittent build errors depending on which provisioner picks up a job.
36
-
37
32
-**Tagged provisioners** can be used to pick up build jobs from templates (and corresponding workspaces) with matching tags.
38
33
39
34
```sh
@@ -66,9 +61,16 @@ Once authenticated as a user with the Template Admin or Owner role, the [Coder C
66
61
--provisioner-tag scope=user
67
62
```
68
63
69
-
## Running external provisioners via Docker
64
+
### Example: Running an external provisioner on a VM
65
+
66
+
```sh
67
+
curl -L https://coder.com/install.sh | sh
68
+
export CODER_URL=https://coder.example.com
69
+
export CODER_SESSION_TOKEN=your_token
70
+
coder provisionerd start
71
+
```
70
72
71
-
The following command can run a Coder provisioner isolated in a Docker container.
73
+
### Example: Running an external provisioner via Docker
72
74
73
75
```sh
74
76
docker run --rm -it \
@@ -79,10 +81,6 @@ docker run --rm -it \
79
81
provisionerd start
80
82
```
81
83
82
-
Be sure to replace `https://coder.example.com` with your [access URL](./configure.md#access-url) and `your_token` with an [API token](../api.md).
83
-
84
-
To include [provider secrets](../templates/authentication.md), modify the `docker run` command to mount environment variables or external volumes. Alternatively, you can create a custom provisioner image.
85
-
86
84
## Disable built-in provisioners
87
85
88
86
As mentioned above, the Coder server will run built-in provisioners by default. This can be disabled with a server-wide [flag or environment variable](../cli/coder_server.md#provisioner-daemons).
0 commit comments