forked from awslabs/amazon-eks-ami
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheks-worker-al2.json
111 lines (109 loc) · 3.17 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
"variables": {
"aws_region": "us-west-2",
"build_tag": "",
"ami_name": "amazon-eks-node-{{timestamp}}",
"binary_bucket_name": "amazon-eks",
"binary_bucket_region": "us-west-2",
"binary_bucket_path": "1.11.5/2018-12-06/bin/linux/amd64",
"docker_version": "18",
"creator": "{{env `USER`}}",
"instance_type": "t3.small",
"source_ami_id": "",
"encrypted": "false",
"kms_key_id": "",
"cni_version": "v0.6.0",
"cni_plugin_version": "v0.7.4",
"docker_ebs_name": "/dev/sdf"
},
"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-*",
"root-device-type": "ebs",
"state": "available",
"virtualization-type": "hvm"
},
"owners": [ "137112412989" ],
"most_recent": true
},
"instance_type": "{{user `instance_type`}}",
"spot_price": "auto",
"spot_price_auto_product": "Linux/UNIX (Amazon VPC)",
"launch_block_device_mappings": [
{
"device_name": "/dev/xvda",
"volume_type": "gp2",
"volume_size": 20,
"delete_on_termination": true
},
{
"device_name": "{{user `docker_ebs_name`}}",
"volume_type": "gp2",
"volume_size": 64,
"delete_on_termination": true
}
],
"ssh_username": "ec2-user",
"ssh_pty": true,
"encrypt_boot": "{{user `encrypted`}}",
"kms_key_id": "{{user `kms_key_id`}}",
"run_tags": {
"creator": "{{user `creator`}}"
},
"tags": {
"created": "{{timestamp}}",
"docker_version": "{{ user `docker_version`}}",
"kubernetes": "{{ user `binary_bucket_path`}}",
"cni_version": "{{ user `cni_version`}}",
"cni_plugin_version": "{{ user `cni_plugin_version`}}"
},
"ami_name": "{{user `ami_name`}}",
"ami_description": "EKS Kubernetes Worker AMI with AmazonLinux2 image (k8s: {{ user `binary_bucket_path`}}, docker:{{ user `docker_version`}})"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["mkdir -p /tmp/worker/"]
},
{
"type": "file",
"source": "./files/",
"destination": "/tmp/worker/"
},
{
"type": "shell",
"script": "setup_docker_ebs.sh",
"environment_vars": [
"DOCKER_EBS_NAME={{user `docker_ebs_name`}}",
"FSTYPE=ext4"
]
},
{
"type": "shell",
"script": "install-worker.sh",
"environment_vars": [
"AMI_NAME={{user `ami_name`}}",
"BINARY_BUCKET_NAME={{user `binary_bucket_name`}}",
"BINARY_BUCKET_PATH={{user `binary_bucket_path`}}",
"BINARY_BUCKET_REGION={{user `binary_bucket_region`}}",
"DOCKER_VERSION={{user `docker_version`}}",
"CNI_VERSION={{user `cni_version`}}",
"CNI_PLUGIN_VERSION={{user `cni_plugin_version`}}"
]
}
],
"post-processors": [
{
"type": "manifest",
"output": "manifest.json",
"strip_path": true
}
]
}