-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(deployment): consul implementation (#317)
- Loading branch information
1 parent
6b6c583
commit 470c591
Showing
7 changed files
with
141 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
|
||
!!! warning "Centralized Configuration (Consul) is a Preview Feature" | ||
The Consul implementation feature is a Preview Feature and is subject to change. This means it has not been fully validated and cannot be guaranteed to work. There are still potential bugs and tweaks needed for a production-level feature standard. Interested in this feature and helping us test it? Reach out via GitHub. | ||
|
||
Consul is a service networking solution and service mesh providing a wide variety of features to handle key networking or service management use cases. Read more about Consul [in their documentation](https://developer.hashicorp.com/consul). | ||
|
||
Consul Use Cases: | ||
|
||
- mTLS Encryption between Services | ||
- Dynamic Load Balancing | ||
- Observability (Health and Metrics) | ||
- **Centralized Configuration of Services** | ||
|
||
## Consul and Open AMT | ||
|
||
As part of Open AMT, we are currently focused on the last bullet point. We've introduced Hashicorp Consul as an optional deployable service to centralize and ease configuration of the MPS and RPS services. In the future, we may expand and incorporate other capabilities offered by Consul. | ||
|
||
MPS/RPS Startup Flows: | ||
|
||
- If Consul exists on startup and empty, copy local configs into Consul. | ||
- If Consul exists on startup and not empty, copy Consul configs down locally. | ||
- If Consul does not exist on startup, load local configs into MPS/RPS. | ||
|
||
The two configuration files are stored as K/V pairs within Consul under: | ||
|
||
- /MPS/config | ||
- /RPS/config | ||
|
||
### Consul Configuration | ||
|
||
By default, Consul is deployed as part of the local Docker deployment in the `docker-compose.yml` file. This is the default configuration. Currently, we do not provide a Kubernetes deployment example. | ||
|
||
The Consul configurations are stored in a local volume. When cleaning up containers, make sure to delete existing volumes. | ||
|
||
``` yaml | ||
consul: | ||
restart: always | ||
image: hashicorp/consul | ||
networks: | ||
- openamtnetwork | ||
ports: | ||
- 8500:8500 | ||
volumes: | ||
- type: volume | ||
source: consul-config | ||
target: /consul/config | ||
volume: {} | ||
- type: volume | ||
source: consul-data | ||
target: /consul/data | ||
volume: {} | ||
command: "agent -server -ui -node=OACT-1 -bootstrap-expect=1 -client=0.0.0.0" | ||
``` | ||
## Enable Consul | ||
1. Follow the [Get Started Guide Setup page](../GetStarted/setup.md). Return here after the **Set Kong JSON Web Token (JWT)** section. | ||
2. In the `.env`, enable Consul and Save. | ||
|
||
``` yaml | ||
# CONSUL | ||
CONSUL_ENABLED=true #update from false to true | ||
CONSUL_HOST=consul | ||
CONSUL_PORT=8500 | ||
``` | ||
|
||
3. Pull the images. | ||
|
||
=== "Linux" | ||
``` | ||
sudo docker-compose pull | ||
``` | ||
|
||
=== "Windows" | ||
``` | ||
docker-compose pull | ||
``` | ||
|
||
4. Start the containers. | ||
|
||
=== "Linux" | ||
``` | ||
sudo docker-compose up -d | ||
``` | ||
|
||
=== "Windows" | ||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
5. To view the Consul UI, visit `http://localhost:8500`. | ||
|
||
6. Click **Key/Value** from the left-hand menu. | ||
|
||
<figure class="figure-image"> | ||
<img src="..\..\assets\images\Consul_KV_Overview.png" alt="Figure 1: Consul K/V Overview Page"> | ||
<figcaption>Figure 1: Consul K/V Overview Page</figcaption> | ||
</figure> | ||
|
||
7. Choose either the `/MPS` or `/RPS` directory, then `/config`. | ||
|
||
<figure class="figure-image"> | ||
<img src="..\..\assets\images\Consul_KV_MPS.png" alt="Figure 2: Consul K/V MPS Configuration"> | ||
<figcaption>Figure 2: Consul K/V MPS Configuration</figcaption> | ||
</figure> | ||
|
||
8. From here, users can make edits to the config files and save. | ||
|
||
Today, the current preview implementation does not update the MPS or RPS services realtime. They must be restarted manually to apply the new configurations. | ||
|
||
[Follow along with any new updates and features using Consul in our Feature Backlog.](https://github.com/orgs/open-amt-cloud-toolkit/projects/5) | ||
|
||
<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters