-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from bancolombia/feature/externalize-config
Externalized app configuration
- Loading branch information
Showing
34 changed files
with
560 additions
and
309 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
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 |
---|---|---|
|
@@ -29,7 +29,7 @@ mix compile | |
|
||
### Configuration | ||
|
||
Open and edit the config/dev.exs file to configure, you can create and set new environment files. | ||
Open and edit the `config.yaml` file to set up configurations. | ||
| **Parameters** | Description | Default Value | | ||
| -------------------------------- | -------------------------------------- | ------------------ | | ||
| `socket_port` | Port to atend Web Sockets requests | 8082 | | ||
|
@@ -63,7 +63,7 @@ $ MIX_ENV=<CONFIG-FILE-NAME> iex --erl "-name [email protected]" -S mix | |
|
||
ADF Sender incorporate `libcluster` dependency in order to facilitate the automatic configuration of erlang clusters in kubernetes. | ||
|
||
In folder `deploy_samples\k8s` we have included manifests to deploy ADF sender on kubernetes (and also if istio is present). | ||
In folder [deploy_samples\k8s](./deploy_samples/k8s/README.md) we have included manifests to deploy ADF sender on kubernetes (and also if istio is present), using 3 of the strategies supported by `libcluster`. | ||
|
||
## Clients | ||
|
||
|
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,30 @@ | ||
channel_sender_ex: | ||
rest_port: 8081 | ||
socket_port: 8082 | ||
secret_generator: | ||
base: "aV4ZPOf7T7HX6GvbhwyBlDM8B9jfeiwi+9qkBnjXxUZXqAeTrehojWKHkV3U0kGc" | ||
salt: "socket auth" | ||
max_age: 900 | ||
initial_redelivery_time: 900 | ||
socket_idle_timeout: 30000 | ||
channel_shutdown_tolerance: 10000 | ||
min_disconnection_tolerance: 50 | ||
on_connected_channel_reply_timeout: 2000 | ||
accept_channel_reply_timeout: 1000 | ||
no_start: false | ||
topology: | ||
strategy: Elixir.Cluster.Strategy.Kubernetes | ||
config: | ||
mode: :hostname | ||
kubernetes_ip_lookup_mode: :pods | ||
kubernetes_service_name: "adfsender-headless" | ||
kubernetes_node_basename: "channel_sender_ex" | ||
kubernetes_selector: "cluster=beam" | ||
namespace: "sendernm" | ||
polling_interval: 5000 | ||
|
||
logger: | ||
level: debug | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,4 @@ | ||
import Config | ||
|
||
config :channel_sender_ex, | ||
secret_base: | ||
{"aV4ZPOf7T7HX6GvbhwyBlDM8B9jfeiwi+9qkBnjXxUZXqAeTrehojWKHkV3U0kGc", "socket auth"}, | ||
socket_port: 8082, | ||
initial_redelivery_time: 900, | ||
socket_idle_timeout: 30000, | ||
rest_port: 8081, | ||
max_age: 900, | ||
topology: [ | ||
strategy: Cluster.Strategy.Gossip | ||
] | ||
config_file: "./config/config-local.yaml" |
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 |
---|---|---|
@@ -1,13 +1,5 @@ | ||
import Config | ||
|
||
|
||
config :channel_sender_ex, | ||
secret_base: | ||
{"aV4ZPOf7T7HX6GvbhwyBlDM8B9jfeiwi+9qkBnjXxUZXqAeTrehojWKHkV3U0kGc", "socket auth"}, | ||
socket_port: 8092, | ||
initial_redelivery_time: 900, | ||
socket_idle_timeout: 30000, | ||
rest_port: 8091, | ||
max_age: 900, | ||
topology: [ | ||
strategy: Cluster.Strategy.Gossip | ||
] | ||
config_file: "./config/config-local1.yaml" |
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 |
---|---|---|
@@ -1,13 +1,4 @@ | ||
import Config | ||
|
||
config :channel_sender_ex, | ||
secret_base: | ||
{"aV4ZPOf7T7HX6GvbhwyBlDM8B9jfeiwi+9qkBnjXxUZXqAeTrehojWKHkV3U0kGc", "socket auth"}, | ||
socket_port: 8072, | ||
initial_redelivery_time: 900, | ||
socket_idle_timeout: 30000, | ||
rest_port: 8071, | ||
max_age: 900, | ||
topology: [ | ||
strategy: Cluster.Strategy.Gossip | ||
] | ||
config_file: "./config/config-local2.yaml" |
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 |
---|---|---|
@@ -1,10 +1,4 @@ | ||
import Config | ||
|
||
config :channel_sender_ex, | ||
secret_base: | ||
{"aV4ZPOf7T7HX6GvbhwyBlDM8B9jfeiwi+9qkBnjXxUZXqAeTrehojWKHkV3U0kGc", "socket auth"}, | ||
socket_port: 8082, | ||
initial_redelivery_time: 900, | ||
socket_idle_timeout: 30000, | ||
rest_port: 8081, | ||
max_age: 900 | ||
config_file: "/app/config/config.yaml" |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
#!/bin/sh | ||
|
||
trap "echo; exit" INT | ||
|
||
# load any needed env vars | ||
File=/app/config/env.sh | ||
if test -f "$File"; then | ||
. $File | ||
fi | ||
|
||
# run release | ||
/app/bin/channel_sender_ex start |
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
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
Oops, something went wrong.