forked from awslabs/amazon-eks-ami
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eks-worker-al2.json
128 lines (121 loc) · 4.08 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
{
"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,
"docker_version": "18.09.9ce-2.amzn2",
"cni_version": "v0.6.0",
"cni_plugin_version": "v0.7.5",
"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": "",
"associate_public_ip_address": "",
"subnet_id": ""
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `aws_region`}}",
"source_ami": "{{user `source_ami_id`}}",
"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": 4,
"delete_on_termination": true
}
],
"ami_block_device_mappings": [
{
"device_name": "/dev/xvda",
"volume_type": "gp2",
"volume_size": 20,
"delete_on_termination": true
}
],
"ssh_username": "{{user `ssh_username`}}",
"ssh_interface": "{{user `ssh_interface`}}",
"temporary_security_group_source_cidrs": "{{user `temporary_security_group_source_cidrs`}}",
"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}}",
"docker_version": "{{ user `docker_version`}}",
"source_ami_id": "{{ user `source_ami_id`}}",
"kubernetes": "{{ user `kubernetes_version`}}/{{ user `kubernetes_build_date` }}/bin/linux/{{ user `arch` }}",
"cni_version": "{{ user `cni_version`}}",
"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`}})"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["mkdir -p /tmp/worker/"]
},
{
"type": "file",
"source": "{{template_dir}}/files/",
"destination": "/tmp/worker/"
},
{
"type": "shell",
"script": "{{template_dir}}/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`}}",
"CNI_VERSION={{user `cni_version`}}",
"CNI_PLUGIN_VERSION={{user `cni_plugin_version`}}",
"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`}}"
]
}
],
"post-processors": [
{
"type": "manifest",
"output": "manifest.json",
"strip_path": true
}
]
}