Commit Graph
17 Commits
Author SHA1 Message Date
Hugo 244237cd2f feat(controller): Add health endpoint (#1882)
* feat(controller): New health service and server

This change also implements a new listener purpose, `ops`.

`ops` (short for operations) is a new listener purpose that is
responsible for serving Boundary's operations endpoints, like health
and possibly metrics.

At Startup: `ops` listeners get configured as late as possible to catch
any errors with the startup process;

At Shutdown: If the health endpoint has been set-up, we introduce a
configurable delay in the process. This is to enable the health endpoint
to report unhealthy for that amount of time. `ops` listeners are also
the last listeners to be shutdown.
2022-03-28 17:16:39 +01:00
Hugo 5bdc371fa1 Merge pull request #1908 from hashicorp/hugoamvieira-controller-stop-listeners
refactor(controller): Decouple listeners/servers shutdown from Worker
2022-03-25 17:37:07 +00:00
Hugo Vieira eebdfb88dc refact(controller): Decouple listeners/servers shutdown from Worker
In general, these changes were introduced in the same vein of the
changes to controller `startListeners`.

Specifically, these changes also decouple the Controller and the Worker
shutdown processes. Currently, a call to `stopListeners` on an instance
that is running as both a Controller and a Worker would stop the
listeners for both.

Lastly, we also add unit/integration tests to the shutdown code.
2022-03-25 15:04:23 +00:00
Hugo d438a6d2dd Merge pull request #1907 from hashicorp/hugoamvieira-controller-start-listeners
refactor(controller): `startListeners` improvements
2022-03-22 16:43:29 +00:00
Hugo Vieira b5ef468d33 refact(controller): Ensure deterministic listeners start order
Previously, we initialized the listeners on the order they were provided
to us on the config file. In the future, we'll want to add new listener
purposes that depend on existing ones, so the init order needs to be
deterministic.

With this change, we'll initialize components in this order:
1. gRPC Server for Controller API.
2. All `api` HTTP Servers & gRPC Gateway Muxes.
3. `cluster` gRPC Server.

This commit introduces some renames for the sake of clarity as well as
improved test coverage:

- Removes `gatewayMux` reference from Controller object. This object was
misleading and is now uneeded.
- Removed uneeded `context.Context` arguments.
- Separates gRPC Server and gRPC Gateway concerns, both in functionality
and in naming. These two were conflated before.
- Added unit tests on `startListeners`.
2022-03-17 19:12:27 +00:00
Hugo Vieira 8d48a8515c refact(controller): Validate listener configuration in New
With this change, the Controller is now aware of its own listeners in a
more codified and structured way.

The reasoning behind these changes are as follows:

1. Currently, we're iterating over these listeners in multiple spots
along this initialization flow to check each listeners' purpose. By
doing this once when we create a Controller and essentially storing the
result, we can clean up the downstream code to use those results.

2. Initial effort to centralize Controller validation. At the moment, we
are doing a lot of validation all over the `cmd` and `config` packages.
From a conceptual perspective, Controller-related validation should
be performed in the function that is responsible for constructing the
Controller object itself. This enables any developer to look in a
single place for all the constraints that we place on creating a
Controller.
2022-03-17 17:53:04 +00:00
Hugo 6c9bfc5bbc Merge pull request #1783 from hashicorp/hugoamvieira-envfile-workerdesc
feat(config): Env/file support for Worker description
2021-12-13 15:07:45 +00:00
Hugo Vieira 5f36057f65 feat(config): Env/file support for Worker description 2021-12-10 18:21:52 +00:00
Hugo d1cadd2b3b Merge pull request #1765 from hashicorp/hugoamvieira-env-file-workercontrollers
feat(config): Add env and file support to Worker Controllers
2021-12-09 16:50:02 +00:00
Hugo Vieira 8462a65637 feat(config): Add env/file support to Worker.Controllers field
This feature allows the user to set the `controllers` field to a string
that points to either an environment variable or file.
We then dynamically pull out the value and parse it into the config.
2021-12-08 17:10:41 +00:00
Hugo Vieira a097b6db8f fix(server): Duplicated Worker nil check inside Worker nil check stmt 2021-12-08 17:09:16 +00:00
Hugo faabfc0002 Merge pull request #1758 from hashicorp/hugoamvieira-env-file-workertags
feat(config): Add env and file support to Worker Tags
2021-12-08 10:40:05 +00:00
Hugo Vieira 1576af70cc feat(config): Add env and file support to Worker Tags
This feature allows the user to set the `tags` field to a string
that points to either an environment variable or file.
We then dynamically pull out the value and parse it into the config.

This can also be done at the keys level, where you set your keys
directly in Boundary's config file, but point the values to env/file.
2021-12-07 19:21:04 +00:00
Hugo 29bdc22b41 Merge pull request #1731 from hashicorp/hugoamvieira-gosockaddr-template-support
feature(config): Add go-sockaddr templating support to Controller and Worker Addresses
2021-11-30 17:57:55 +00:00
Hugo Vieira f1063a62a0 feature(config): add sockaddr template support 2021-11-30 14:07:12 +00:00
Hugo Vieira 21a771b581 test(servers base): add tests ahead of functionality change
Adds tests to `SetupControllerPublicClusterAddress` and
`SetupWorkerPublicAddress` ahead of changes in these functions to
ensure functionality is preserved.
2021-11-29 18:19:10 +00:00
Hugo 8d3f666bba docs: include boundary-ui dependencies for make dev (#1657) 2021-11-03 13:55:58 +00:00