-
Notifications
You must be signed in to change notification settings - Fork 22
/
template_main_launch_template.go
109 lines (108 loc) · 3.51 KB
/
template_main_launch_template.go
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
package template
const TemplateMainLaunchTemplate = `
{{- define "launch_template" -}}
NodePoolLaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateName: {{ .LaunchTemplate.Name }}
LaunchTemplateData:
BlockDeviceMappings:
- DeviceName: /dev/xvdh
Ebs:
DeleteOnTermination: true
Encrypted: true
VolumeSize: {{ .LaunchTemplate.BlockDeviceMapping.Docker.Volume.Size }}
VolumeType: gp3
- DeviceName: /dev/xvdg
Ebs:
DeleteOnTermination: true
Encrypted: true
VolumeSize: {{ .LaunchTemplate.BlockDeviceMapping.Kubelet.Volume.Size }}
VolumeType: gp3
- DeviceName: /dev/xvdf
Ebs:
DeleteOnTermination: true
Encrypted: true
VolumeSize: {{ .LaunchTemplate.BlockDeviceMapping.Logging.Volume.Size }}
VolumeType: gp3
- DeviceName: /dev/xvdi
Ebs:
DeleteOnTermination: true
Encrypted: true
VolumeSize: {{ .LaunchTemplate.BlockDeviceMapping.Containerd.Volume.Size }}
VolumeType: gp3
IamInstanceProfile:
Name: !Ref NodePoolInstanceProfile
ImageId: {{ .LaunchTemplate.Instance.Image }}
InstanceType: {{ .LaunchTemplate.Instance.Type }}
MetadataOptions:
HttpTokens: {{ .LaunchTemplate.Metadata.HttpTokens }}
HttpPutResponseHopLimit: 2
Monitoring:
Enabled: {{ .LaunchTemplate.Instance.Monitoring }}
NetworkInterfaces:
- AssociatePublicIpAddress: false
DeviceIndex: 0
Groups:
- !Ref GeneralSecurityGroup
TagSpecifications:
- ResourceType: instance
Tags:
- Key: giantswarm.io/release
Value: {{ .LaunchTemplate.ReleaseVersion }}
UserData:
Fn::Base64: |
{
"ignition": {
"version": "2.2.0",
"config": {
"append": [
{
"source": "{{ .LaunchTemplate.SmallCloudConfig.S3URL }}"
}
]
}
},
"storage": {
"filesystems": [
{
"name": "docker",
"mount": {
"device": "/dev/xvdh",
"wipeFilesystem": true,
"label": "docker",
"format": "xfs"
}
},
{
"name": "kubelet",
"mount": {
"device": "/dev/xvdg",
"wipeFilesystem": true,
"label": "kubelet",
"format": "xfs"
}
},
{
"name": "log",
"mount": {
"device": "/dev/xvdf",
"wipeFilesystem": true,
"label": "log",
"format": "xfs"
}
},
{
"name": "containerd",
"mount": {
"device": "/dev/xvdi",
"wipeFilesystem": true,
"label": "containerd",
"format": "xfs"
}
}
]
}
}
{{- end -}}
`