Skip to content

Commit

Permalink
feat(ecs): Configuration for platform version & placement constraints (
Browse files Browse the repository at this point in the history
…spinnaker#6906)

* feat(ecs): Configuration for platform version & placement constraints

* Change to simpler select element
  • Loading branch information
clareliguori authored and anotherchrisberry committed Apr 30, 2019
1 parent d6d882c commit 654fd3a
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/scripts/modules/ecs/src/ecs.help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ const helpContents: { [key: string]: string } = {
'ecs.dockerimage': 'Docker image for your container, such as nginx:latest',
'ecs.dockerimagecredentials':
'<p>The AWS Secrets Manager secret that contains private registry credentials.</p><p>Define credentials only for private registries other than Amazon ECR.</p>',
'ecs.placementConstraints':
'<p>Rules for task placement. See <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html" target="_blank">AWS documentation</a> for more details. </p>',
'ecs.placementConstraintType':
'<p>To ensure that each task in a particular group is running on a different container instance, use distinctInstance. To restrict the selection to a group of valid candidates, use memberOf. </p>',
'ecs.placementConstraintExpression':
'<p>A cluster query language expression to apply to memberOf constraints. See <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html" target="_blank">AWS documentation</a> for more details.</p>',
'ecs.placementStrategy':
'<p>The strategy the container scheduler will be using. See <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html" target="_blank">AWS documentation</a> for more details. </p><p>You should at least balance across availability zones</p><p>Custom placement strategies have not been implemented yet.</p>',
'ecs.platformVersion':
'<p>Defaults to the latest platform version.</p>',
'ecs.capacity.copySourceScalingPoliciesAndActions':
'<p>Copy Application Autoscaling policies and their associated alarms from the previous ECS service.</p>',
'ecs.launchtype': '<p>Launch service tasks on your own EC2 instances or on Fargate.</p>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ module.exports = angular
subnetType: '',
securityGroups: [],
healthCheckGracePeriodSeconds: '',
placementConstraints: [],
placementStrategyName: '',
placementStrategySequence: [],
ecsClusterName: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,22 @@

<div class="form-group">
<div class="col-md-5 sm-label-right">
<b>Placement strategy</b> <help-field key="ecs.placementStrategy"></help-field>
Fargate platform version
<help-field key="ecs.platformVersion"></help-field>
</div>
<div class="col-md-3">
<input
type="text"
class="form-control input-sm"
name="platformVersion"
ng-model="$ctrl.command.platformVersion"
/>
</div>
</div>

<div class="form-group">
<div class="col-md-5 sm-label-right">
<b>Placement Strategy</b> <help-field key="ecs.placementStrategy"></help-field>
</div>
<div class="col-md-7">
<ui-select ng-model="$ctrl.command.placementStrategyName" class="form-control input-sm">
Expand All @@ -78,6 +93,56 @@
</div>
</div>

<div class="form-group">
<div class="sm-label-left">
<b>Placement Constraints</b>
<help-field key="ecs.placementConstraints"></help-field>
</div>
<form name="ecsPlacementConstraints">
<table class="table table-condensed packed tags">
<thead>
<tr>
<th style="width: 25%">Type <help-field key="ecs.placementConstraintType"></help-field></th>
<th style="width: 68%">Expression <help-field key="ecs.placementConstraintExpression"></help-field></th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="constraint in $ctrl.command.placementConstraints">
<td>
<select
class="form-control input-sm"
ng-model="constraint.type"
ng-options="type for type in ['distinctInstance', 'memberOf']"
/>
</td>
<td>
<input type="text" class="form-control input-sm no-spel" ng-model="constraint.expression"/>
</td>
<td>
<div class="form-control-static">
<a class="btn-link sm-label" ng-click="$ctrl.command.placementConstraints.splice($index, 1)">
<span class="glyphicon glyphicon-trash"></span>
<span class="sr-only">Remove</span>
</a>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">
<button class="btn btn-block btn-sm add-new" ng-click="$ctrl.command.placementConstraints.push({})">
<span class="glyphicon glyphicon-plus-sign"></span>
Add New Placement Constraint
</button>
</td>
</tr>
</tfoot>
</table>
</form>
</div>

<div class="form-group">
<div class="sm-label-left">
<b>Docker labels (optional)</b>
Expand Down

0 comments on commit 654fd3a

Please sign in to comment.