Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
refactor: move cri config into cloud-init
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeldeib committed Apr 17, 2020
1 parent de57fec commit 4a68be7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 140 deletions.
7 changes: 0 additions & 7 deletions parts/k8s/cloud-init/artifacts/cse_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ installContainerd() {
ensureContainerd() {
wait_for_file 1200 1 /etc/systemd/system/containerd.service.d/exec_start.conf || exit {{GetCSEErrorCode "ERR_FILE_WATCH_TIMEOUT"}}
wait_for_file 1200 1 /etc/containerd/config.toml || exit {{GetCSEErrorCode "ERR_FILE_WATCH_TIMEOUT"}}
{{- if HasValidContainerdConfig}}
echo '{{GetContainerdConfig}}' > /etc/containerd/config.toml
{{- end}}
systemctlEnableAndStart containerd || exit {{GetCSEErrorCode "ERR_SYSTEMCTL_START_FAIL"}}
}
{{end}}
Expand All @@ -297,11 +294,7 @@ ensureDocker() {
DOCKER_JSON_FILE=/etc/docker/daemon.json
for i in $(seq 1 1200); do
if [ -s $DOCKER_JSON_FILE ]; then
{{- if HasValidDockerConfig}}
echo '{{GetDockerConfig}}' > $DOCKER_JSON_FILE && break
{{- else}}
jq '.' <$DOCKER_JSON_FILE && break
{{- end}}
fi
if [ $i -eq 1200 ]; then
exit {{GetCSEErrorCode "ERR_FILE_WATCH_TIMEOUT"}}
Expand Down
30 changes: 2 additions & 28 deletions parts/k8s/cloud-init/masternodecustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,7 @@ write_files:
permissions: "0644"
owner: root
content: |
{
"live-restore": true,
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "5"
}
}
{{GetDockerConfig}}
{{end}}

{{if HasCiliumNetworkPlugin}}
Expand Down Expand Up @@ -221,26 +214,7 @@ write_files:
permissions: "0644"
owner: root
content: |
version = 2
subreaper = false
oom_score = 0
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "{{GetPodInfraContainerSpec}}"
[plugins."io.containerd.grpc.v1.cri".cni]
{{if IsKubenet}}
conf_template = "/etc/containerd/kubenet_template.conf"
{{end}}
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "runc"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.untrusted]
{{/* note: runc really should not be used for untrusted workloads... should we remove this? This is here because it was here before */}}
runtime_type = "io.containerd.runc.v2"
#EOF
{{GetContainerdConfig}}
{{if IsKubenet}}
- path: /etc/containerd/kubenet_template.conf
Expand Down
37 changes: 2 additions & 35 deletions parts/k8s/cloud-init/nodecustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,7 @@ write_files:
permissions: "0644"
owner: root
content: |
{
"live-restore": true,
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "5"
}{{if IsNSeriesSKU .}}
,"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}{{end}}
}
{{GetDockerConfig}}
{{end}}

{{if HasCiliumNetworkPlugin}}
Expand Down Expand Up @@ -222,26 +208,7 @@ write_files:
permissions: "0644"
owner: root
content: |
version = 2
subreaper = false
oom_score = 0
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "{{GetPodInfraContainerSpec}}"
[plugins."io.containerd.grpc.v1.cri".cni]
{{if IsKubenet}}
conf_template = "/etc/containerd/kubenet_template.conf"
{{end}}
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "runc"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.untrusted]
{{/* note: runc really should not be used for untrusted workloads... should we remove this? This is here because it was here before */}}
runtime_type = "io.containerd.runc.v2"
#EOF
{{GetContainerdConfig}}
{{if IsKubenet }}
- path: /etc/containerd/kubenet_template.conf
Expand Down
74 changes: 4 additions & 70 deletions pkg/engine/templates_generated.go

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

0 comments on commit 4a68be7

Please sign in to comment.