Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions pkg/nodebootstrap/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions pkg/nodebootstrap/assets/docker-daemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"bridge": "none",
"exec-opts": [
"native.cgroupdriver=systemd"
],
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "10"
},
"live-restore": true,
"max-concurrent-downloads": 10
}
2 changes: 1 addition & 1 deletion pkg/nodebootstrap/assets/kubelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ authorization:

serverTLSBootstrap: true

cgroupDriver: cgroupfs
cgroupDriver: systemd

featureGates:
RotateKubeletServerCertificate: true
9 changes: 9 additions & 0 deletions pkg/nodebootstrap/userdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
const (
configDir = "/etc/eksctl/"
kubeletDropInUnitDir = "/etc/systemd/system/kubelet.service.d/"
dockerConfigDir = "/etc/docker/"
)

type configFile struct {
Expand Down Expand Up @@ -111,6 +112,14 @@ func getKubeReserved(info InstanceTypeInfo) api.InlineDocument {
}
}

func makeDockerConfigJSON(spec *api.ClusterConfig, ng *api.NodeGroup) ([]byte, error) {
data, err := Asset("docker-daemon.json")
if err != nil {
return nil, err
}
return data, nil
}

func makeKubeletConfigYAML(spec *api.ClusterConfig, ng *api.NodeGroup) ([]byte, error) {
data, err := Asset("kubelet.yaml")
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions pkg/nodebootstrap/userdata_al2.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ func makeAmazonLinux2Config(spec *api.ClusterConfig, ng *api.NodeGroup) (configF
return nil, err
}

dockerConfigData, err := makeDockerConfigJSON(spec, ng)
if err != nil {
return nil, err
}

files := configFiles{
kubeletDropInUnitDir: {
"10-eksclt.al2.conf": {isAsset: true},
Expand All @@ -38,6 +43,9 @@ func makeAmazonLinux2Config(spec *api.ClusterConfig, ng *api.NodeGroup) (configF
"kubeconfig.yaml": {content: string(clientConfigData)},
"max_pods.map": {content: makeMaxPodsMapping()},
},
dockerConfigDir: {
"daemon.json": {content: string(dockerConfigData)},
},
}

return files, nil
Expand Down
8 changes: 8 additions & 0 deletions pkg/nodebootstrap/userdata_ubuntu.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func makeUbuntuConfig(spec *api.ClusterConfig, ng *api.NodeGroup) (configFiles,
return nil, err
}

dockerConfigData, err := makeDockerConfigJSON(spec, ng)
if err != nil {
return nil, err
}

files := configFiles{
configDir: {
"metadata.env": {content: strings.Join(makeMetadata(spec), "\n")},
Expand All @@ -52,6 +57,9 @@ func makeUbuntuConfig(spec *api.ClusterConfig, ng *api.NodeGroup) (configFiles,
"kubeconfig.yaml": {content: string(clientConfigData)},
"max_pods.map": {content: makeMaxPodsMapping()},
},
dockerConfigDir: {
"daemon.json": {content: string(dockerConfigData)},
},
}

return files, nil
Expand Down