Files
threshold/website/content/docs/configuration/worker.mdx
T

109 lines
3.1 KiB
Plaintext
Raw Normal View History

2020-09-23 12:15:21 -07:00
---
layout: docs
page_title: Worker - Configuration
description: |-
2020-10-13 15:21:09 -04:00
The worker stanza configures worker-specific parameters.
2020-09-23 12:15:21 -07:00
---
# `worker` Stanza
The `worker` stanza configures Boundary worker-specific parameters.
```hcl
worker {
name = "example-worker"
description = "An example worker"
public_addr = "5.1.23.198"
}
```
- `name` - Specifies a unique name of this worker within the Boundary
cluster. This value can be a direct name string, can refer to a file on disk
(file://) from which an name will be read; or an env var (env://) from which
the name will be read.
2020-09-23 12:15:21 -07:00
- `description` - Specifies a friendly description of this worker.
2020-10-13 15:21:09 -04:00
- `public_addr` - Specifies the public host or IP address (and optionally port)
2021-02-23 19:06:39 -05:00
at which the worker can be reached _by clients for proxying_. This defaults to
the address of the listener marked for `proxy` purpose. This is especially
useful for cloud environments that do not bind a publicly accessible IP to a NIC
on the host directly, such as an Amazon EIP.
2020-10-13 15:21:09 -04:00
- `controllers` - A list of hosts/IP addresses and optionally ports for reaching
2021-02-23 19:06:39 -05:00
controllers. The port will default to :9201 if not specified.
- `tags` - A map of key-value pairs where values are an array of strings. Most
commonly used for [filtering](/docs/concepts/filtering) targets a worker can
proxy via [worker tags](/docs/concepts/filtering/worker-tags). On `SIGHUP`, the
tags set here will be re-parsed and new values used..
2021-02-01 19:03:46 -05:00
## KMS Configuration
Workers require a KMS block designated for `worker-auth`. This is the KMS configuration for
2020-10-13 15:21:09 -04:00
authentication between the workers and controllers and must be present. Example (not safe for production!):
2021-02-23 19:06:39 -05:00
```hcl
kms "aead" {
purpose = "worker-auth"
aead_type = "aes-gcm"
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
key_id = "global_worker-auth"
}
```
2021-02-23 19:06:39 -05:00
This configuration must be the same for the worker-auth configuration for the controller if you're
running the controller and worker as separate servers.
And optionally, a KMS stanza for configuration encryption purpose:
```hcl
2021-02-23 19:06:39 -05:00
# Configuration encryption block: decrypts sensitive values in the
# configuration file. See `boundary config [encrypt|decrypt] -h`.
kms "aead" {
purpose = "config"`
aead_type = "aes-gcm"
key = "7xtkEoS5EXPbgynwd+dDLHopaCqK8cq0Rpep4eooaTs="
}
```
Boundary supports many kinds of KMS integrations. For a complete guide to all available
2021-02-23 19:06:39 -05:00
KMS types, see our [KMS documentation](/docs/configuration/kms).
# Complete Configuration Example
```hcl
listener "tcp" {
purpose = "proxy"
tls_disable = true
2021-01-08 13:30:53 -08:00
address = "127.0.0.1"
}
worker {
2020-10-13 15:21:09 -04:00
# Name attr must be unique across workers
name = "demo-worker-1"
description = "A default worker created demonstration"
# Workers must be able to reach controllers on :9201
2020-10-13 15:21:09 -04:00
controllers = [
"10.0.0.1",
"10.0.0.2",
"10.0.0.3",
]
2020-10-13 15:21:09 -04:00
public_addr = "myhost.mycompany.com"
2021-02-23 19:06:39 -05:00
2021-02-01 19:03:46 -05:00
tags {
type = ["prod", "webservers"]
region = ["us-east-1"]
2021-02-23 19:06:39 -05:00
}
}
# must be same key as used on controller config
kms "aead" {
purpose = "worker-auth"
aead_type = "aes-gcm"
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
key_id = "global_worker-auth"
}
```