-
Notifications
You must be signed in to change notification settings - Fork 0
/
eks-worker-al2.json
220 lines (220 loc) · 7.36 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
{
"variables": {
"aws_region": "us-west-2",
"ami_name": null,
"creator": "{{env `USER`}}",
"encrypted": "false",
"kms_key_id": "",
"aws_access_key_id": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_access_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"aws_session_token": "{{env `AWS_SESSION_TOKEN`}}",
"binary_bucket_name": "amazon-eks",
"binary_bucket_region": "us-west-2",
"kubernetes_version": null,
"kubernetes_build_date": null,
"kernel_version": "",
"docker_version": "20.10.17-1.amzn2",
"containerd_version": "1.6.6-1.amzn2",
"runc_version": "1.1.3-1.amzn2",
"cni_plugin_version": "v0.8.6",
"pull_cni_from_github": "true",
"source_ami_id": "",
"source_ami_owners": "137112412989",
"source_ami_filter_name": "amzn2-ami-minimal-hvm-*",
"arch": null,
"instance_type": null,
"ami_description": "EKS Kubernetes Worker AMI with AmazonLinux2 image",
"ssh_interface": "",
"ssh_username": "ec2-user",
"temporary_security_group_source_cidrs": "",
"security_group_id": "",
"associate_public_ip_address": "",
"subnet_id": "",
"remote_folder": "",
"launch_block_device_mappings_volume_size": "4",
"ami_users": "",
"additional_yum_repos": "",
"sonobuoy_e2e_registry": "",
"ami_regions": ""
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `aws_region`}}",
"source_ami": "{{user `source_ami_id`}}",
"ami_users": "{{user `ami_users`}}",
"snapshot_users": "{{user `ami_users`}}",
"source_ami_filter": {
"filters": {
"name": "{{user `source_ami_filter_name`}}",
"architecture": "{{user `arch`}}",
"root-device-type": "ebs",
"state": "available",
"virtualization-type": "hvm"
},
"owners": [
"{{user `source_ami_owners`}}"
],
"most_recent": true
},
"instance_type": "{{user `instance_type`}}",
"launch_block_device_mappings": [
{
"device_name": "/dev/xvda",
"volume_type": "gp2",
"volume_size": "{{user `launch_block_device_mappings_volume_size`}}",
"delete_on_termination": true
}
],
"ami_block_device_mappings": [
{
"device_name": "/dev/xvda",
"volume_type": "gp2",
"volume_size": 20,
"delete_on_termination": true
}
],
"aws_polling": {
"delay_seconds": 30,
"max_attempts": 90
},
"ami_regions": "{{user `ami_regions`}}",
"ssh_username": "{{user `ssh_username`}}",
"ssh_interface": "{{user `ssh_interface`}}",
"temporary_security_group_source_cidrs": "{{user `temporary_security_group_source_cidrs`}}",
"security_group_id": "{{user `security_group_id`}}",
"associate_public_ip_address": "{{user `associate_public_ip_address`}}",
"ssh_pty": true,
"encrypt_boot": "{{user `encrypted`}}",
"kms_key_id": "{{user `kms_key_id`}}",
"run_tags": {
"creator": "{{user `creator`}}"
},
"subnet_id": "{{user `subnet_id`}}",
"tags": {
"Name": "{{user `ami_name`}}",
"created": "{{timestamp}}",
"build_region": "{{ .BuildRegion }}",
"source_ami_id": "{{ .SourceAMI }}",
"source_ami_name": "{{ .SourceAMIName }}",
"docker_version": "{{ user `docker_version`}}",
"containerd_version": "{{ user `containerd_version`}}",
"kubernetes": "{{ user `kubernetes_version`}}/{{ user `kubernetes_build_date` }}/bin/linux/{{ user `arch` }}",
"cni_plugin_version": "{{ user `cni_plugin_version`}}"
},
"ami_name": "{{user `ami_name`}}",
"ami_description": "{{ user `ami_description` }}, (k8s: {{ user `kubernetes_version` }}, docker: {{ user `docker_version` }}, containerd: {{ user `containerd_version` }})"
}
],
"provisioners": [
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/scripts/install_additional_repos.sh",
"environment_vars": [
"ADDITIONAL_YUM_REPOS={{user `additional_yum_repos`}}"
]
},
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"expect_disconnect": true,
"script": "{{template_dir}}/scripts/upgrade_kernel.sh",
"environment_vars": [
"KUBERNETES_VERSION={{user `kubernetes_version`}}",
"KERNEL_VERSION={{user `kernel_version`}}"
]
},
{
"type": "shell",
"pause_before": "90s",
"remote_folder": "{{ user `remote_folder`}}",
"inline": [
"mkdir -p /tmp/worker/log-collector-script/"
]
},
{
"type": "file",
"source": "{{template_dir}}/files/",
"destination": "/tmp/worker/"
},
{
"type": "file",
"source": "{{template_dir}}/log-collector-script/linux/",
"destination": "/tmp/worker/log-collector-script/"
},
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/scripts/install-worker.sh",
"environment_vars": [
"KUBERNETES_VERSION={{user `kubernetes_version`}}",
"KUBERNETES_BUILD_DATE={{user `kubernetes_build_date`}}",
"BINARY_BUCKET_NAME={{user `binary_bucket_name`}}",
"BINARY_BUCKET_REGION={{user `binary_bucket_region`}}",
"DOCKER_VERSION={{user `docker_version`}}",
"CONTAINERD_VERSION={{user `containerd_version`}}",
"RUNC_VERSION={{user `runc_version`}}",
"CNI_PLUGIN_VERSION={{user `cni_plugin_version`}}",
"PULL_CNI_FROM_GITHUB={{user `pull_cni_from_github`}}",
"AWS_ACCESS_KEY_ID={{user `aws_access_key_id`}}",
"AWS_SECRET_ACCESS_KEY={{user `aws_secret_access_key`}}",
"AWS_SESSION_TOKEN={{user `aws_session_token`}}",
"SONOBUOY_E2E_REGISTRY={{user `sonobuoy_e2e_registry`}}"
]
},
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/scripts/cleanup.sh"
},
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/scripts/cleanup_additional_repos.sh",
"environment_vars": [
"ADDITIONAL_YUM_REPOS={{user `additional_yum_repos`}}"
]
},
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/scripts/validate.sh",
"environment_vars": [
"KERNEL_VERSION={{user `kernel_version`}}"
]
},
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/scripts/generate-version-info.sh",
"execute_command": "chmod +x {{ .Path }}; {{ .Path }} /tmp/version-info.json"
},
{
"type": "file",
"direction": "download",
"source": "/tmp/version-info.json",
"destination": "{{ user `ami_name` }}-version-info.json"
}
],
"post-processors": [
{
"type": "manifest",
"output": "manifest.json",
"strip_path": true,
"custom_data": {
"source_ami_name": "{{ build `SourceAMIName` }}",
"source_ami_id": "{{ build `SourceAMI` }}"
}
},
{
"type": "manifest",
"output": "{{user `ami_name`}}-manifest.json",
"strip_path": true,
"custom_data": {
"source_ami_name": "{{ build `SourceAMIName` }}",
"source_ami_id": "{{ build `SourceAMI` }}"
}
}
]
}