[WIP] DUP: use Erlang clustering and allow autoscaling #1037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Create an Erlang cluster of DUPs which are able to autoscale and share load.
Add the
DATA_UPDATER_PLANT_CLUSTERING_STRATEGY
env to allow choosing which Erlang cluster topology to use.At the moment, two options are available:
none
(default): every instance is a single-node clusterkubernetes
: multi-nodes cluster using k8s API. Thekubernetes
strategy requires a service account with permissions to list endpoints.The DUP release name now includes the k8s pod IP, which can be supplied via the
MY_POD_IP
env var.When
none
strategy is usedNothing changes w.r.t previous releases. The service will still run as not clustered.
When
kubernetes
strategy is usedA cluster of DUPs will be created - under the hood, we have libcluster's
Cluster.Strategy.Kubernetes
with:ip
option. By default, it will comprise instances in theastarte
namespace having labelapp=astarte-data_updater_plant
.These two values can be customized by setting the related env vars:
DATA_UPDATER_PLANT_CLUSTERING_KUBERNETES_NAMESPACE
DATA_UPDATER_PLANT_CLUSTERING_KUBERNETES_SELECTOR
Important
In order to form clusters, kubernetes discovery is used. Therefore, the ServiceAccount of DUP pods should have permissions to
get
andlist
resources of typeendpoints
in the""
API group.What this PR does / why we need it:
Autoscale DUP, wohoo
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g. usage docs, diagrams, etc.: