forked from awslabs/amazon-eks-ami
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eks-worker-al2.json
78 lines (76 loc) · 1.95 KB
/
eks-worker-al2.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"variables": {
"aws_region": "us-west-2",
"ami_name": "amazon-eks-node-{{timestamp}}",
"binary_bucket_name": "amazon-eks",
"binary_bucket_region": "us-west-2",
"binary_bucket_path": "1.10.3/2018-07-26/bin/linux/amd64",
"creator": "{{env `USER`}}",
"instance_type": "m4.large",
"source_ami_id": ""
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `aws_region`}}",
"source_ami": "{{user `source_ami_id`}}",
"source_ami_filter": {
"filters": {
"architecture": "x86_64",
"name": "amzn2-ami-minimal-hvm-*",
"owner-id": "137112412989",
"root-device-type": "ebs",
"state": "available",
"virtualization-type": "hvm"
},
"most_recent": true
},
"instance_type": "{{user `instance_type`}}",
"launch_block_device_mappings": [
{
"device_name": "/dev/xvda",
"volume_type": "gp2",
"volume_size": 20,
"delete_on_termination": true
}
],
"ssh_username": "ec2-user",
"ssh_pty": true,
"run_tags": {
"creator": "{{user `creator`}}"
},
"tags": {
"created": "{{timestamp}}"
},
"ami_name": "{{user `ami_name`}}",
"ami_description": "EKS Kubernetes Worker AMI with AmazonLinux2 image"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["mkdir -p /tmp/worker/"]
},
{
"type": "file",
"source": "./files/",
"destination": "/tmp/worker/"
},
{
"type": "shell",
"script": "install-worker.sh",
"environment_vars": [
"BINARY_BUCKET_NAME={{user `binary_bucket_name`}}",
"BINARY_BUCKET_PATH={{user `binary_bucket_path`}}",
"BINARY_BUCKET_REGION={{user `binary_bucket_region`}}"
]
}
],
"post-processors": [
{
"type": "manifest",
"output": "manifest.json",
"strip_path": true
}
]
}