-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Amazon ECS clustering for Docker #361
base: master
Are you sure you want to change the base?
Conversation
66e01f0
to
56279ae
Compare
38eb1b0
to
ce8bef5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really must have tests for anything like this. We can't merge more and more functionality without being able to do automated regression testing.
Can you please add tests that use org.apache.brooklyn.test.framework
(so that it can be run in a QA Framework). Without that, we should not consider merging this.
id: docker-cluster | ||
name: "docker-cluster" | ||
|
||
- id: docker-cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker-cluster
seems a strange name for this, to add to the catalog. We'll have lost the context that it is for EC2 container service. We should probably have "ecs" in the catalog item id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
services: | ||
- type: ecs-cluster | ||
|
||
- id: ecs-cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's scary that we're repeating all of these brooklyn.parameters in different entities in this same file.
What is the purpose of having ecs-cluster
and docker-cluster
as separate items?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the pattern used for all other Clocker templates. The way to avoid the duplication of parameters is to have some way of defining them as displayable, since this is just to have a subset that show up in the add application wizard...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grkvlt We can already define parameters as displayable by using the pinned
flag. pinned: true
which is the default means show the item in UI. Set it to false
to hide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neykov this is almost what we want; but was really looking for a way of indicating that a particular parameter defined in some child entity is to be displayed in the UI when a catalog entry that references that child is created? i.e. the Swarm TCP port is a property defined on the swarm-manager
entity, but we want to propagate that up to the top level as an application configuration option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean now. Agree it would be nice to be able to express this case in a more concise way.
$brooklyn:config("docker.max.size") | ||
autoscaler.resizeUpStabilizationDelay: 30s | ||
autoscaler.resizeDownIterationMax: 0 # Disable scaling down | ||
autoscaler.resizeDownStabilizationDelay: forever |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this cause us to track an infinite history of cluster load, so that we try to calculate what load has been happening "forever"? (I haven't dug into the Brooklyn AutoScalerPolicy
to check; if you're going to rely on this, then perhaps we should have a test in Brooklyn? Or maybe we should just add an explicit autoscaler.resizeDownEnabled: false
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, not sure. We should definitely check, as this is part of the Swarm and Kubernetes autoscalers too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aledsage I had a closer look at this, and you're right. Since resizeDownIterationMax
is zero, the delta for scale-down will always be zero, so the desired size is always equal to current size and scheduleResize(int)
is never called to add a new smaller size. However this doesn't matter, as there is only one SizeHistory
object, containing a TimeWindowedList
sized to the Duration.of("forever")
maximum.
long maxResizeStabilizationDelay = Math.max(getResizeUpStabilizationDelay().toMilliseconds(), getResizeDownStabilizationDelay().toMilliseconds());
recentDesiredResizes = new SizeHistory(maxResizeStabilizationDelay);
So, this should probably be changed to zero (i.e. removed, since that is the default value) as well, then the TimeWindowedList
will be created using the desired resizeUpStabilizationDelay
value. And, as noted above, this ought to be done for the Swam and Kubernetes auto-scalers as well.
sudo mkdir -p /var/log/ecs | ||
sudo mkdir -p /var/lib/ecs/data | ||
sudo sysctl -w net.ipv4.conf.all.route_localnet=1 | ||
sudo iptables -t nat -A PREROUTING -p tcp -d 169.254.170.2 --dport 80 -j DNAT --to-destination 127.0.0.1:51679 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this assume CentOS 6? I'd have thought we'd want firewalld
for CentOS 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the ECS instructions for installing the agent
ce8bef5
to
15cdae8
Compare
@aledsage what tests would you suggest? The ECS agent will fail on startup if an ECS cluster is not available with the provided name. |
041e2f8
to
53b8cf6
Compare
280813d
to
8ddca62
Compare
5e6da95
to
c365480
Compare
c365480
to
4fb6c7b
Compare
@aledsage I added tests that both check service up and also verify that custom sensors have correct values, this should be good to merge? |
4fb6c7b
to
3cb2a04
Compare
3cb2a04
to
0a6dbd9
Compare
Creates a cluster of Docker Engines for use with Amazon ECS, running the ECS agent to register with the container service. Scaling and service replacement is managed by Brooklyn.