Skip to content

Commit 86b7238

Browse files
authored
feat: add support for container runtime on windows AMIs (#359)
* feat: add support for container runtime on windows AMIs Signed-off-by: Jonah Back <[email protected]> * chore: update docs to reflect Windows support for containerRuntime Signed-off-by: Jonah Back <[email protected]>
1 parent 592d94f commit 86b7238

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

controllers/provisioners/eks/helpers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ func (ctx *EksInstanceGroupContext) GetBootstrapArgs() string {
553553
sb.WriteString(fmt.Sprintf("-Base64ClusterCA %v ", aws.StringValue(state.Cluster.CertificateAuthority.Data)))
554554
sb.WriteString(fmt.Sprintf("-APIServerEndpoint %v ", aws.StringValue(state.Cluster.Endpoint)))
555555
}
556+
if bootstrapOptions != nil && bootstrapOptions.ContainerRuntime != "" {
557+
sb.WriteString(fmt.Sprintf("-ContainerRuntime %v ", bootstrapOptions.ContainerRuntime))
558+
}
556559
sb.WriteString(fmt.Sprintf("-KubeletExtraArgs '%v'", ctx.GetKubeletExtraArgs()))
557560
case OsFamilyAmazonLinux2:
558561
if bootstrapOptions != nil && bootstrapOptions.MaxPods > 0 {

controllers/provisioners/eks/helpers_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ func TestGetBasicUserDataWindows(t *testing.T) {
190190

191191
configuration.BootstrapOptions = &v1alpha1.BootstrapOptions{
192192
MaxPods: 4,
193+
ContainerRuntime: "containerd",
193194
}
194195
configuration.Labels = map[string]string{
195196
"foo": "bar",
@@ -229,7 +230,7 @@ func TestGetBasicUserDataWindows(t *testing.T) {
229230
Echo "Not starting Kubelet due to warmed state."
230231
& C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 –Schedule
231232
} else {
232-
& $EKSBootstrapScriptFile -EKSClusterName foo -Base64ClusterCA dGVzdA== -APIServerEndpoint foo.amazonaws.com -KubeletExtraArgs '--node-labels=foo=bar,instancemgr.keikoproj.io/image=ami-123456789012,node.kubernetes.io/role=instance-group-1 --register-with-taints=foo=bar:NoSchedule --eviction-hard=memory.available<300Mi,nodefs.available<5% --system-reserved=memory=2.5Gi --v=2 --max-pods=4' 3>&1 4>&1 5>&1 6>&1
233+
& $EKSBootstrapScriptFile -EKSClusterName foo -Base64ClusterCA dGVzdA== -APIServerEndpoint foo.amazonaws.com -ContainerRuntime containerd -KubeletExtraArgs '--node-labels=foo=bar,instancemgr.keikoproj.io/image=ami-123456789012,node.kubernetes.io/role=instance-group-1 --register-with-taints=foo=bar:NoSchedule --eviction-hard=memory.available<300Mi,nodefs.available<5% --system-reserved=memory=2.5Gi --v=2 --max-pods=4' 3>&1 4>&1 5>&1 6>&1
233234
bar
234235
}
235236
</powershell>`

docs/EKS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
suspendProcesses: <[]string> : must match scaling process names to suspend
6060

6161
bootstrapOptions:
62-
containerRuntime: <string> : one of "dockerd" or "containerd". Specifies which container runtime to use. Currently only available on Amazon Linux 2
62+
containerRuntime: <string> : one of "dockerd" or "containerd". Specifies which container runtime to use. Available for Amazon Linux 2 and Windows.
6363
maxPods: <int> : maximum number of pods that can be run per-node in this IG.
6464

6565

0 commit comments

Comments
 (0)