hako 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff65e26d2cf4eae4e30db26a06c20b805691df1ef69b6b3f13978d556621c39b
4
- data.tar.gz: f7e69c8ba3e9de134ed0392a051d58d88ee70d6876751dfb2c7e8077672587e9
3
+ metadata.gz: d76103b970308d4f028189a3ec7bade0959330f3f8540ecd5a8df40a2263c753
4
+ data.tar.gz: 1dee2f57732bc15d5125e8baf5edb88202db0cbfa3308051bec4acdb29a10966
5
5
  SHA512:
6
- metadata.gz: f3db0f686407d5c0c5a7905b6773b642eaa60ba7ad5eef714b8047750ae31c588adc7ddd000ed80ea5c707cbd8e2380fc9ebcaedd825a341a1eb2836c1ad65e2
7
- data.tar.gz: 93159fa006ba102e18b3053b9f26efa372fd04052afc2a06cf935bede3cc13c6cae569d3b197740b9c71db4d4890970a8ff88dbc2cacfc62d84f2bea2cd921eb
6
+ metadata.gz: 876336df0208426be1f00e8f6a0097eddaf59508c8149c24533de70d3a22444393b5f9d42b5fc9537c3a0f41b96d2ed6e4101722a06a69f0f75a334e281fd0b9
7
+ data.tar.gz: fd9debc540cebf63304917b64c87a51a7579216998ecd5ff2098353a48edf1f9459c82f1c6df8aba69757f656b452fe648a97631c6c77aa3f057a56856acf403
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 2.3.0 (2018-08-30)
2
+ ## New features
3
+ - Support `health_check` parameter
4
+ - Support `shared_memory_size` parameter
5
+ - Support `tmpfs` parameter
6
+ - Support `docker_volume_configuration` parameter
7
+ - Support target tracking scaling policy
8
+
9
+ ## Changes
10
+ - Run containers referenced by `volumes_from` on hako oneshot
11
+ - Rename `additional_containers` parameter to `sidecars`
12
+ - `additional_containers` is still supported for compatibility
13
+
14
+ ## Bug fixes
15
+ - Show `--volumes-from` in dry-run output
16
+ - Fix `--init` not being shown in dry-run output
17
+
1
18
  # 2.2.0 (2018-06-29)
2
19
  ## New features
3
20
  - Add support for `scheduling_strategy` on service
@@ -1,20 +1,20 @@
1
1
  {
2
- scheduler: {
3
- type: 'ecs',
4
- region: 'ap-northeast-1',
5
- cluster: 'eagletmt',
6
- desired_count: 2,
7
- role: 'ecsServiceRole',
8
- autoscaling_group_for_oneshot: 'hako-batch-cluster',
9
- },
10
- app: {
11
- image: 'ryotarai/hello-sinatra',
12
- memory: 128,
13
- cpu: 256,
14
- env: {
15
- PORT: '3000',
16
- MESSAGE: 'hello',
17
- },
18
- command: ['echo', 'heavy offline job'],
2
+ scheduler: {
3
+ type: 'ecs',
4
+ region: 'ap-northeast-1',
5
+ cluster: 'eagletmt',
6
+ desired_count: 2,
7
+ role: 'ecsServiceRole',
8
+ autoscaling_group_for_oneshot: 'hako-batch-cluster',
9
+ },
10
+ app: {
11
+ image: 'ryotarai/hello-sinatra',
12
+ memory: 128,
13
+ cpu: 256,
14
+ env: {
15
+ PORT: '3000',
16
+ MESSAGE: 'hello',
19
17
  },
18
+ command: ['echo', 'heavy offline job'],
19
+ },
20
20
  }
@@ -2,77 +2,86 @@ local fileProvider = std.native('provide.file');
2
2
  local provide(name) = fileProvider(std.toString({ path: 'hello.env' }), name);
3
3
 
4
4
  {
5
- scheduler: {
6
- type: 'ecs',
7
- region: 'ap-northeast-1',
8
- cluster: 'eagletmt',
9
- desired_count: 2,
10
- role: 'ecsServiceRole',
11
- elb: {
12
- listeners: [
13
- {
14
- load_balancer_port: 80,
15
- protocol: 'HTTP',
16
- },
17
- ],
18
- subnets: [
19
- 'subnet-XXXXXXXX',
20
- 'subnet-YYYYYYYY',
21
- ],
22
- security_groups: [
23
- 'sg-ZZZZZZZZ',
24
- ],
25
- },
26
- autoscaling: {
27
- role_arn: 'arn:aws:iam::012345678901:role/ecsAutoscaleRole',
28
- min_capacity: 1,
29
- max_capacity: 4,
30
- policies: [
31
- // Add one task when ecs-scaling-out-hello-autoscaling-service is in alarm state
32
- {
33
- alarms: ['ecs-scaling-out-hello-autoscaling-service'],
34
- cooldown: 300,
35
- adjustment_type: 'ChangeInCapacity',
36
- scaling_adjustment: 1,
37
- metric_interval_lower_bound: 0,
38
- metric_aggregation_type: 'Average',
39
- },
40
- // Remove one task when ecs-scaling-in-hello-autoscaling-service is in alarm state
41
- {
42
- alarms: ['ecs-scaling-in-hello-autoscaling-service'],
43
- cooldown: 300,
44
- adjustment_type: 'ChangeInCapacity',
45
- scaling_adjustment: -1,
46
- metric_interval_upper_bound: 0,
47
- metric_aggregation_type: 'Average',
48
- },
49
- ],
5
+ scheduler: {
6
+ type: 'ecs',
7
+ region: 'ap-northeast-1',
8
+ cluster: 'eagletmt',
9
+ desired_count: 2,
10
+ role: 'ecsServiceRole',
11
+ elb: {
12
+ listeners: [
13
+ {
14
+ load_balancer_port: 80,
15
+ protocol: 'HTTP',
50
16
  },
17
+ ],
18
+ subnets: [
19
+ 'subnet-XXXXXXXX',
20
+ 'subnet-YYYYYYYY',
21
+ ],
22
+ security_groups: [
23
+ 'sg-ZZZZZZZZ',
24
+ ],
51
25
  },
52
- app: {
53
- image: 'ryotarai/hello-sinatra',
54
- memory: 128,
55
- cpu: 256,
56
- env: {
57
- PORT: '3000',
58
- MESSAGE: std.format('%s-san', provide('username')),
26
+ autoscaling: {
27
+ role_arn: 'arn:aws:iam::012345678901:role/ecsAutoscaleRole',
28
+ min_capacity: 1,
29
+ max_capacity: 4,
30
+ policies: [
31
+ // Add one task when ecs-scaling-out-hello-autoscaling-service is in alarm state
32
+ {
33
+ alarms: ['ecs-scaling-out-hello-autoscaling-service'],
34
+ cooldown: 300,
35
+ adjustment_type: 'ChangeInCapacity',
36
+ scaling_adjustment: 1,
37
+ metric_interval_lower_bound: 0,
38
+ metric_aggregation_type: 'Average',
59
39
  },
60
- },
61
- additional_containers: {
62
- front: {
63
- image_tag: 'hako-nginx',
64
- memory: 32,
65
- cpu: 32,
40
+ // Remove one task when ecs-scaling-in-hello-autoscaling-service is in alarm state
41
+ {
42
+ alarms: ['ecs-scaling-in-hello-autoscaling-service'],
43
+ cooldown: 300,
44
+ adjustment_type: 'ChangeInCapacity',
45
+ scaling_adjustment: -1,
46
+ metric_interval_upper_bound: 0,
47
+ metric_aggregation_type: 'Average',
48
+ },
49
+ // Adjust the numer of tasks to keep the metric close to the target value
50
+ {
51
+ policy_type: 'TargetTrackingScaling',
52
+ name: 'ecs-target-tracking-scaling-hello-autoscaling-service',
53
+ target_value: 50,
54
+ predefined_metric_type: 'ECSServiceAverageCPUUtilization',
55
+ scale_out_cooldown: 300,
56
+ scale_in_cooldown: 300,
66
57
  },
58
+ ],
67
59
  },
68
- scripts: [
69
- (import 'front.libsonnet') + {
70
- backend_port: 3000,
71
- locations: {
72
- '/': {
73
- allow_only_from: ['10.0.0.0/24'],
74
- },
75
- },
60
+ },
61
+ app: {
62
+ image: 'ryotarai/hello-sinatra',
63
+ memory: 128,
64
+ cpu: 256,
65
+ env: {
66
+ PORT: '3000',
67
+ MESSAGE: std.format('%s-san', provide('username')),
68
+ },
69
+ },
70
+ sidecars: {
71
+ front: {
72
+ image_tag: 'hako-nginx',
73
+ memory: 32,
74
+ cpu: 32,
75
+ },
76
+ },
77
+ scripts: [
78
+ (import 'front.libsonnet') + {
79
+ backend_port: 3000,
80
+ locations: {
81
+ '/': {
82
+ allow_only_from: ['10.0.0.0/24'],
76
83
  },
77
- ],
84
+ },
85
+ },
86
+ ],
78
87
  }
@@ -1,25 +1,25 @@
1
1
  {
2
- scheduler: {
3
- type: 'ecs',
4
- region: 'ap-northeast-1',
5
- cluster: 'eagletmt',
6
- desired_count: 1,
2
+ scheduler: {
3
+ type: 'ecs',
4
+ region: 'ap-northeast-1',
5
+ cluster: 'eagletmt',
6
+ desired_count: 1,
7
+ },
8
+ app: {
9
+ image: 'busybox',
10
+ memory: 128,
11
+ cpu: 256,
12
+ command: ['echo', 'hello awslogs'],
13
+ log_configuration: {
14
+ log_driver: 'awslogs',
15
+ options: {
16
+ 'awslogs-group': 'my-logs',
17
+ 'awslogs-region': 'ap-northeast-1',
18
+ 'awslogs-stream-prefix': 'example',
19
+ },
7
20
  },
8
- app: {
9
- image: 'busybox',
10
- memory: 128,
11
- cpu: 256,
12
- command: ['echo', 'hello awslogs'],
13
- log_configuration: {
14
- log_driver: 'awslogs',
15
- options: {
16
- 'awslogs-group': 'my-logs',
17
- 'awslogs-region': 'ap-northeast-1',
18
- 'awslogs-stream-prefix': 'example',
19
- },
20
- },
21
- },
22
- scripts: [
23
- (import 'create_aws_cloud_watch_logs_log_group.libsonnet'),
24
- ],
21
+ },
22
+ scripts: [
23
+ (import 'create_aws_cloud_watch_logs_log_group.libsonnet'),
24
+ ],
25
25
  }
@@ -1,19 +1,19 @@
1
1
  {
2
- scheduler: {
3
- type: 'ecs',
4
- region: 'ap-northeast-1',
5
- cluster: 'eagletmt',
6
- desired_count: 1,
7
- },
8
- app: {
9
- image: 'busybox',
10
- memory: 128,
11
- cpu: 256,
12
- command: ['echo', 'hello with SYS_RAWIO'],
13
- linux_parameters: {
14
- capabilities: {
15
- add: ['SYS_RAWIO'],
16
- },
17
- },
2
+ scheduler: {
3
+ type: 'ecs',
4
+ region: 'ap-northeast-1',
5
+ cluster: 'eagletmt',
6
+ desired_count: 1,
7
+ },
8
+ app: {
9
+ image: 'busybox',
10
+ memory: 128,
11
+ cpu: 256,
12
+ command: ['echo', 'hello with SYS_RAWIO'],
13
+ linux_parameters: {
14
+ capabilities: {
15
+ add: ['SYS_RAWIO'],
16
+ },
18
17
  },
18
+ },
19
19
  }
@@ -1,38 +1,38 @@
1
1
  {
2
- scheduler: {
3
- type: 'ecs',
4
- region: 'us-east-1',
5
- cluster: 'eagletmt',
6
- // Fargate
7
- execution_role_arn: 'arn:aws:iam::012345678901:role/ecsTaskExecutionRole',
8
- cpu: '1024',
9
- memory: '2048',
10
- requires_compatibilities: ['FARGATE'],
11
- network_mode: 'awsvpc',
12
- launch_type: 'FARGATE',
13
- network_configuration: {
14
- awsvpc_configuration: {
15
- subnets: ['subnet-XXXXXXXX'],
16
- security_groups: [],
17
- assign_public_ip: 'DISABLED',
18
- },
19
- },
2
+ scheduler: {
3
+ type: 'ecs',
4
+ region: 'us-east-1',
5
+ cluster: 'eagletmt',
6
+ // Fargate
7
+ execution_role_arn: 'arn:aws:iam::012345678901:role/ecsTaskExecutionRole',
8
+ cpu: '1024',
9
+ memory: '2048',
10
+ requires_compatibilities: ['FARGATE'],
11
+ network_mode: 'awsvpc',
12
+ launch_type: 'FARGATE',
13
+ network_configuration: {
14
+ awsvpc_configuration: {
15
+ subnets: ['subnet-XXXXXXXX'],
16
+ security_groups: [],
17
+ assign_public_ip: 'DISABLED',
18
+ },
20
19
  },
21
- app: {
22
- image: 'ryotarai/hello-sinatra',
23
- cpu: 1024,
24
- memory: 256,
25
- memory_reservation: 128,
26
- log_configuration: {
27
- log_driver: 'awslogs',
28
- options: {
29
- 'awslogs-group': '/ecs/hello-fargate-batch',
30
- 'awslogs-region': 'us-east-1',
31
- 'awslogs-stream-prefix': 'ecs',
32
- },
33
- },
20
+ },
21
+ app: {
22
+ image: 'ryotarai/hello-sinatra',
23
+ cpu: 1024,
24
+ memory: 256,
25
+ memory_reservation: 128,
26
+ log_configuration: {
27
+ log_driver: 'awslogs',
28
+ options: {
29
+ 'awslogs-group': '/ecs/hello-fargate-batch',
30
+ 'awslogs-region': 'us-east-1',
31
+ 'awslogs-stream-prefix': 'ecs',
32
+ },
34
33
  },
35
- scripts: [
36
- (import './create_aws_cloud_watch_logs_log_group.libsonnet'),
37
- ],
34
+ },
35
+ scripts: [
36
+ (import './create_aws_cloud_watch_logs_log_group.libsonnet'),
37
+ ],
38
38
  }
@@ -6,79 +6,79 @@ local privateSubnets = ['subnet-zzzzzzzz', 'subnet-wwwwwwww'];
6
6
  local elbSecurityGroups = ['sg-xxxxxxxx'];
7
7
  local taskSecurityGroups = ['sg-yyyyyyyy', 'sg-zzzzzzzz'];
8
8
  local awslogs = {
9
- log_driver: 'awslogs',
10
- options: {
11
- 'awslogs-group': std.format('/ecs/%s', appId),
12
- 'awslogs-region': region,
13
- 'awslogs-stream-prefix': 'ecs',
14
- },
9
+ log_driver: 'awslogs',
10
+ options: {
11
+ 'awslogs-group': std.format('/ecs/%s', appId),
12
+ 'awslogs-region': region,
13
+ 'awslogs-stream-prefix': 'ecs',
14
+ },
15
15
  };
16
16
 
17
17
  {
18
- scheduler: {
19
- type: 'ecs',
20
- region: region,
21
- cluster: 'eagletmt',
22
- desired_count: 1,
23
- task_role_arn: 'arn:aws:iam::012345678901:role/EcsDefault',
24
- elb_v2: {
25
- vpc_id: 'vpc-xxxxxxxx',
26
- health_check_path: '/site/sha',
27
- listeners: [
28
- {
29
- port: 80,
30
- protocol: 'HTTP',
31
- },
32
- {
33
- port: 443,
34
- protocol: 'HTTPS',
35
- certificate_arn: 'arn:aws:acm:us-east-1:012345678901:certificate/01234567-89ab-cdef-0123-456789abcdef',
36
- },
37
- ],
38
- subnets: publicSubnets,
39
- security_groups: elbSecurityGroups,
40
- load_balancer_attributes: {
41
- 'access_logs.s3.enabled': 'true',
42
- 'access_logs.s3.bucket': 'hako-access-logs',
43
- 'access_logs.s3.prefix': std.format('hako-%s', appId),
44
- 'idle_timeout.timeout_seconds': '5',
45
- },
46
- target_group_attributes: {
47
- 'deregistration_delay.timeout_seconds': '20',
48
- },
18
+ scheduler: {
19
+ type: 'ecs',
20
+ region: region,
21
+ cluster: 'eagletmt',
22
+ desired_count: 1,
23
+ task_role_arn: 'arn:aws:iam::012345678901:role/EcsDefault',
24
+ elb_v2: {
25
+ vpc_id: 'vpc-xxxxxxxx',
26
+ health_check_path: '/site/sha',
27
+ listeners: [
28
+ {
29
+ port: 80,
30
+ protocol: 'HTTP',
49
31
  },
50
- # Fargate
51
- execution_role_arn: 'arn:aws:iam::012345678901:role/ecsTaskExecutionRole',
52
- cpu: '1024',
53
- memory: '2048',
54
- requires_compatibilities: ['FARGATE'],
55
- network_mode: 'awsvpc',
56
- launch_type: 'FARGATE',
57
- network_configuration: {
58
- awsvpc_configuration: {
59
- subnets: privateSubnets,
60
- security_groups: taskSecurityGroups,
61
- assign_public_ip: 'DISABLED',
62
- },
32
+ {
33
+ port: 443,
34
+ protocol: 'HTTPS',
35
+ certificate_arn: 'arn:aws:acm:us-east-1:012345678901:certificate/01234567-89ab-cdef-0123-456789abcdef',
63
36
  },
37
+ ],
38
+ subnets: publicSubnets,
39
+ security_groups: elbSecurityGroups,
40
+ load_balancer_attributes: {
41
+ 'access_logs.s3.enabled': 'true',
42
+ 'access_logs.s3.bucket': 'hako-access-logs',
43
+ 'access_logs.s3.prefix': std.format('hako-%s', appId),
44
+ 'idle_timeout.timeout_seconds': '5',
45
+ },
46
+ target_group_attributes: {
47
+ 'deregistration_delay.timeout_seconds': '20',
48
+ },
64
49
  },
65
- app: {
66
- image: 'ryotarai/hello-sinatra',
67
- cpu: 128,
68
- memory: 256,
69
- env: {
70
- PORT: '3000',
71
- MESSAGE: 'Hello, Fargate',
72
- },
73
- log_configuration: awslogs,
50
+ // Fargate
51
+ execution_role_arn: 'arn:aws:iam::012345678901:role/ecsTaskExecutionRole',
52
+ cpu: '1024',
53
+ memory: '2048',
54
+ requires_compatibilities: ['FARGATE'],
55
+ network_mode: 'awsvpc',
56
+ launch_type: 'FARGATE',
57
+ network_configuration: {
58
+ awsvpc_configuration: {
59
+ subnets: privateSubnets,
60
+ security_groups: taskSecurityGroups,
61
+ assign_public_ip: 'DISABLED',
62
+ },
74
63
  },
75
- additional_containers: {
76
- front: {
77
- image_tag: 'hako-nginx',
78
- log_configuration: awslogs,
79
- },
64
+ },
65
+ app: {
66
+ image: 'ryotarai/hello-sinatra',
67
+ cpu: 128,
68
+ memory: 256,
69
+ env: {
70
+ PORT: '3000',
71
+ MESSAGE: 'Hello, Fargate',
72
+ },
73
+ log_configuration: awslogs,
74
+ },
75
+ sidecars: {
76
+ front: {
77
+ image_tag: 'hako-nginx',
78
+ log_configuration: awslogs,
80
79
  },
81
- scripts: [
82
- (import 'front.libsonnet') + { backend_port: 3000 },
83
- ],
80
+ },
81
+ scripts: [
82
+ (import 'front.libsonnet') + { backend_port: 3000 },
83
+ ],
84
84
  }
@@ -1,47 +1,47 @@
1
1
  {
2
- scheduler: {
3
- type: 'ecs',
4
- region: 'ap-northeast-1',
5
- cluster: 'eagletmt',
6
- desired_count: 2,
7
- role: 'ecsServiceRole',
8
- // health_check_grace_period_seconds: 0,
9
- elb_v2: {
10
- // NLB can not have
11
- // * health check path
12
- // * securit group
13
- scheme: 'internal',
14
- type: 'network',
15
- // VPC id where the target group is located
16
- vpc_id: 'vpc-WWWWWWWW',
17
- listeners: [
18
- {
19
- port: 80,
20
- protocol: 'TCP',
21
- },
22
- ],
23
- subnets: [
24
- 'subnet-XXXXXXXX',
25
- 'subnet-YYYYYYYY',
26
- ],
27
- container_name: 'app',
28
- container_port: 80,
29
- // If you want enalbed cross zone load balancing, then specify attribute.
30
- // load_balancer_attributes: {
31
- // 'load_balancing.cross_zone.enabled': 'true',
32
- // },
2
+ scheduler: {
3
+ type: 'ecs',
4
+ region: 'ap-northeast-1',
5
+ cluster: 'eagletmt',
6
+ desired_count: 2,
7
+ role: 'ecsServiceRole',
8
+ // health_check_grace_period_seconds: 0,
9
+ elb_v2: {
10
+ // NLB can not have
11
+ // * health check path
12
+ // * securit group
13
+ scheme: 'internal',
14
+ type: 'network',
15
+ // VPC id where the target group is located
16
+ vpc_id: 'vpc-WWWWWWWW',
17
+ listeners: [
18
+ {
19
+ port: 80,
20
+ protocol: 'TCP',
33
21
  },
22
+ ],
23
+ subnets: [
24
+ 'subnet-XXXXXXXX',
25
+ 'subnet-YYYYYYYY',
26
+ ],
27
+ container_name: 'app',
28
+ container_port: 80,
29
+ // If you want enalbed cross zone load balancing, then specify attribute.
30
+ // load_balancer_attributes: {
31
+ // 'load_balancing.cross_zone.enabled': 'true',
32
+ // },
34
33
  },
35
- app: {
36
- image: 'nginx',
37
- memory: 128,
38
- cpu: 256,
39
- port_mappings: [
40
- {
41
- container_port: 80,
42
- host_port: 0,
43
- protocol: 'TCP',
44
- },
45
- ],
46
- },
34
+ },
35
+ app: {
36
+ image: 'nginx',
37
+ memory: 128,
38
+ cpu: 256,
39
+ port_mappings: [
40
+ {
41
+ container_port: 80,
42
+ host_port: 0,
43
+ protocol: 'TCP',
44
+ },
45
+ ],
46
+ },
47
47
  }