From 2a6972337058d881289a1feb385df2716eeab73f Mon Sep 17 00:00:00 2001 From: Artiom Diomin Date: Wed, 18 Mar 2020 18:07:24 +0200 Subject: [PATCH 1/2] Converge docker.json config usage across operating systems Signed-off-by: Artiom Diomin --- pkg/userdata/centos/provider.go | 11 +++++++-- .../centos/testdata/kubelet-v1.10-aws.yaml | 11 +++++++-- .../centos/testdata/kubelet-v1.11-aws.yaml | 11 +++++++-- .../testdata/kubelet-v1.12-aws-external.yaml | 11 +++++++-- .../centos/testdata/kubelet-v1.12-aws.yaml | 11 +++++++-- .../kubelet-v1.12-vsphere-mirrors.yaml | 11 +++++++-- .../testdata/kubelet-v1.12-vsphere-proxy.yaml | 11 +++++++-- .../testdata/kubelet-v1.12-vsphere.yaml | 11 +++++++-- .../centos/testdata/kubelet-v1.9-aws.yaml | 11 +++++++-- ...te-openstack-kubelet-v-version-prefix.yaml | 2 +- ....3-auto-update-openstack-multiple-dns.yaml | 2 +- .../v1.11.2-vsphere-static-ipconfig.yaml | 2 +- .../testdata/v1.12.0-vsphere-mirrors.yaml | 2 +- ...v1.12.0-vsphere-overwrite-cloudconfig.yaml | 2 +- .../testdata/v1.12.0-vsphere-proxy.yaml | 2 +- .../coreos/testdata/v1.15.0-vsphere.yaml | 2 +- pkg/userdata/coreos/testdata/v1.17.0.yaml | 2 +- ....9.2-disable-auto-update-aws-external.yaml | 2 +- .../v1.9.2-disable-auto-update-aws.yaml | 2 +- .../v1.9.2-disable-locksmith-aws.yaml | 2 +- .../v1.9.2-disable-update-engine-aws.yaml | 2 +- pkg/userdata/helper/helper.go | 13 +++++++---- pkg/userdata/rhel/provider.go | 23 +++++-------------- .../rhel/testdata/kubelet-v1.10-aws.yaml | 23 +++++-------------- .../rhel/testdata/kubelet-v1.11-aws.yaml | 23 +++++-------------- .../testdata/kubelet-v1.12-aws-external.yaml | 23 +++++-------------- .../rhel/testdata/kubelet-v1.12-aws.yaml | 23 +++++-------------- .../kubelet-v1.12-vsphere-mirrors.yaml | 23 +++++-------------- .../testdata/kubelet-v1.12-vsphere-proxy.yaml | 23 +++++-------------- .../rhel/testdata/kubelet-v1.12-vsphere.yaml | 23 +++++-------------- .../rhel/testdata/kubelet-v1.9-aws.yaml | 23 +++++-------------- .../sles/testdata/dist-upgrade-on-boot.yaml | 2 +- .../kubelet-version-without-v-prefix.yaml | 2 +- .../sles/testdata/multiple-dns-servers.yaml | 2 +- .../sles/testdata/multiple-ssh-keys.yaml | 2 +- .../openstack-overwrite-cloud-config.yaml | 2 +- pkg/userdata/sles/testdata/openstack.yaml | 2 +- .../sles/testdata/version-1.10.10.yaml | 2 +- .../sles/testdata/version-1.11.3.yaml | 2 +- .../sles/testdata/version-1.12.1.yaml | 2 +- .../sles/testdata/version-1.9.10.yaml | 2 +- .../sles/testdata/vsphere-mirrors.yaml | 2 +- pkg/userdata/sles/testdata/vsphere-proxy.yaml | 2 +- pkg/userdata/sles/testdata/vsphere.yaml | 2 +- pkg/userdata/ubuntu/provider.go | 4 ++-- .../ubuntu/testdata/dist-upgrade-on-boot.yaml | 6 ++--- .../kubelet-version-without-v-prefix.yaml | 6 ++--- .../ubuntu/testdata/multiple-dns-servers.yaml | 6 ++--- .../ubuntu/testdata/multiple-ssh-keys.yaml | 6 ++--- .../openstack-overwrite-cloud-config.yaml | 6 ++--- pkg/userdata/ubuntu/testdata/openstack.yaml | 6 ++--- .../ubuntu/testdata/version-1.10.10.yaml | 6 ++--- .../ubuntu/testdata/version-1.11.3.yaml | 6 ++--- .../ubuntu/testdata/version-1.12.1.yaml | 6 ++--- .../ubuntu/testdata/version-1.9.10.yaml | 6 ++--- .../ubuntu/testdata/vsphere-mirrors.yaml | 6 ++--- .../ubuntu/testdata/vsphere-proxy.yaml | 6 ++--- pkg/userdata/ubuntu/testdata/vsphere.yaml | 6 ++--- 58 files changed, 210 insertions(+), 241 deletions(-) diff --git a/pkg/userdata/centos/provider.go b/pkg/userdata/centos/provider.go index 18a913dfe..5303c95e8 100644 --- a/pkg/userdata/centos/provider.go +++ b/pkg/userdata/centos/provider.go @@ -184,7 +184,10 @@ write_files: hostnamectl set-hostname {{ .MachineSpec.Name }} {{ end }} - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -202,7 +205,6 @@ write_files: systemctl enable --now vmtoolsd.service {{ end -}} {{- /* Without this, the conformance tests fail with differing tests causing it, the common denominator: They look for some string in container logs and get an empty log */ -}} - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -284,6 +286,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | +{{ dockerConfig .InsecureRegistries .RegistryMirrors | indent 4 }} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.10-aws.yaml b/pkg/userdata/centos/testdata/kubelet-v1.10-aws.yaml index 31b4cb311..228524f05 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.10-aws.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.10-aws.yaml @@ -69,7 +69,10 @@ write_files: swapoff -a - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -97,7 +100,6 @@ write_files: curl -Lfo /opt/bin/health-monitor.sh https://raw.githubusercontent.com/kubermatic/machine-controller/8b5b66e4910a6228dfaecccaa0a3b05ec4902f8e/pkg/userdata/scripts/health-monitor.sh chmod +x /opt/bin/health-monitor.sh fi - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -252,6 +254,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.11-aws.yaml b/pkg/userdata/centos/testdata/kubelet-v1.11-aws.yaml index a9b3da7a9..453c8eb41 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.11-aws.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.11-aws.yaml @@ -69,7 +69,10 @@ write_files: swapoff -a - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -97,7 +100,6 @@ write_files: curl -Lfo /opt/bin/health-monitor.sh https://raw.githubusercontent.com/kubermatic/machine-controller/8b5b66e4910a6228dfaecccaa0a3b05ec4902f8e/pkg/userdata/scripts/health-monitor.sh chmod +x /opt/bin/health-monitor.sh fi - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -252,6 +254,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.12-aws-external.yaml b/pkg/userdata/centos/testdata/kubelet-v1.12-aws-external.yaml index 3f1215219..cf43ae21a 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.12-aws-external.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.12-aws-external.yaml @@ -69,7 +69,10 @@ write_files: swapoff -a - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -97,7 +100,6 @@ write_files: curl -Lfo /opt/bin/health-monitor.sh https://raw.githubusercontent.com/kubermatic/machine-controller/8b5b66e4910a6228dfaecccaa0a3b05ec4902f8e/pkg/userdata/scripts/health-monitor.sh chmod +x /opt/bin/health-monitor.sh fi - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -250,6 +252,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.12-aws.yaml b/pkg/userdata/centos/testdata/kubelet-v1.12-aws.yaml index 83518f51f..5493e90e2 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.12-aws.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.12-aws.yaml @@ -69,7 +69,10 @@ write_files: swapoff -a - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -97,7 +100,6 @@ write_files: curl -Lfo /opt/bin/health-monitor.sh https://raw.githubusercontent.com/kubermatic/machine-controller/8b5b66e4910a6228dfaecccaa0a3b05ec4902f8e/pkg/userdata/scripts/health-monitor.sh chmod +x /opt/bin/health-monitor.sh fi - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -251,6 +253,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-mirrors.yaml b/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-mirrors.yaml index 4a8608ed0..dc7d434a6 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-mirrors.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-mirrors.yaml @@ -81,7 +81,10 @@ write_files: hostnamectl set-hostname node1 - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -112,7 +115,6 @@ write_files: fi systemctl enable --now vmtoolsd.service - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -268,6 +270,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"},"registry-mirrors":["https://registry.docker-cn.com"]} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-proxy.yaml b/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-proxy.yaml index 1e4916f3d..aeaeb0084 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-proxy.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere-proxy.yaml @@ -81,7 +81,10 @@ write_files: hostnamectl set-hostname node1 - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -112,7 +115,6 @@ write_files: fi systemctl enable --now vmtoolsd.service - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -268,6 +270,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"},"insecure-registries":["192.168.100.100:5000","10.0.0.1:5000"]} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere.yaml b/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere.yaml index ed93d64dd..8c765233d 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.12-vsphere.yaml @@ -73,7 +73,10 @@ write_files: hostnamectl set-hostname node1 - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -104,7 +107,6 @@ write_files: fi systemctl enable --now vmtoolsd.service - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -259,6 +261,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/centos/testdata/kubelet-v1.9-aws.yaml b/pkg/userdata/centos/testdata/kubelet-v1.9-aws.yaml index 77ab27808..27b2e1f33 100644 --- a/pkg/userdata/centos/testdata/kubelet-v1.9-aws.yaml +++ b/pkg/userdata/centos/testdata/kubelet-v1.9-aws.yaml @@ -69,7 +69,10 @@ write_files: swapoff -a - yum install -y docker-1.13.1 \ + yum install -y yum-utils + yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + + yum install -y docker-ce-18.09.9-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -97,7 +100,6 @@ write_files: curl -Lfo /opt/bin/health-monitor.sh https://raw.githubusercontent.com/kubermatic/machine-controller/8b5b66e4910a6228dfaecccaa0a3b05ec4902f8e/pkg/userdata/scripts/health-monitor.sh chmod +x /opt/bin/health-monitor.sh fi - sed -i 's/journald/json-file/g' /etc/sysconfig/docker systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service @@ -252,6 +254,11 @@ write_files: content: | export PATH="/opt/bin:$PATH" +- path: /etc/docker/daemon.json + permissions: "0644" + content: | + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} + - path: /etc/systemd/system/kubelet-healthcheck.service permissions: "0644" content: | diff --git a/pkg/userdata/coreos/testdata/auto-update-openstack-kubelet-v-version-prefix.yaml b/pkg/userdata/coreos/testdata/auto-update-openstack-kubelet-v-version-prefix.yaml index 0684c9d71..f2c8743db 100644 --- a/pkg/userdata/coreos/testdata/auto-update-openstack-kubelet-v-version-prefix.yaml +++ b/pkg/userdata/coreos/testdata/auto-update-openstack-kubelet-v-version-prefix.yaml @@ -316,7 +316,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.10.3-auto-update-openstack-multiple-dns.yaml b/pkg/userdata/coreos/testdata/v1.10.3-auto-update-openstack-multiple-dns.yaml index a996daa0c..442887ab2 100644 --- a/pkg/userdata/coreos/testdata/v1.10.3-auto-update-openstack-multiple-dns.yaml +++ b/pkg/userdata/coreos/testdata/v1.10.3-auto-update-openstack-multiple-dns.yaml @@ -318,7 +318,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.11.2-vsphere-static-ipconfig.yaml b/pkg/userdata/coreos/testdata/v1.11.2-vsphere-static-ipconfig.yaml index 55a6e6586..8c39d6fe3 100644 --- a/pkg/userdata/coreos/testdata/v1.11.2-vsphere-static-ipconfig.yaml +++ b/pkg/userdata/coreos/testdata/v1.11.2-vsphere-static-ipconfig.yaml @@ -336,7 +336,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.12.0-vsphere-mirrors.yaml b/pkg/userdata/coreos/testdata/v1.12.0-vsphere-mirrors.yaml index eb4ae76ca..0c09e082b 100644 --- a/pkg/userdata/coreos/testdata/v1.12.0-vsphere-mirrors.yaml +++ b/pkg/userdata/coreos/testdata/v1.12.0-vsphere-mirrors.yaml @@ -353,7 +353,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":["https://registry.docker-cn.com"]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"},"registry-mirrors":["https://registry.docker-cn.com"]} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.12.0-vsphere-overwrite-cloudconfig.yaml b/pkg/userdata/coreos/testdata/v1.12.0-vsphere-overwrite-cloudconfig.yaml index 5fd76036e..7a840a3a8 100644 --- a/pkg/userdata/coreos/testdata/v1.12.0-vsphere-overwrite-cloudconfig.yaml +++ b/pkg/userdata/coreos/testdata/v1.12.0-vsphere-overwrite-cloudconfig.yaml @@ -337,7 +337,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.12.0-vsphere-proxy.yaml b/pkg/userdata/coreos/testdata/v1.12.0-vsphere-proxy.yaml index 3f710f3ed..dd51fab0f 100644 --- a/pkg/userdata/coreos/testdata/v1.12.0-vsphere-proxy.yaml +++ b/pkg/userdata/coreos/testdata/v1.12.0-vsphere-proxy.yaml @@ -353,7 +353,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":["192.168.100.100:5000","10.0.0.1:5000"],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"},"insecure-registries":["192.168.100.100:5000","10.0.0.1:5000"]} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.15.0-vsphere.yaml b/pkg/userdata/coreos/testdata/v1.15.0-vsphere.yaml index d118ba1c9..44d8b807a 100644 --- a/pkg/userdata/coreos/testdata/v1.15.0-vsphere.yaml +++ b/pkg/userdata/coreos/testdata/v1.15.0-vsphere.yaml @@ -312,7 +312,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.17.0.yaml b/pkg/userdata/coreos/testdata/v1.17.0.yaml index 8fa9e7272..f0ec22e6a 100644 --- a/pkg/userdata/coreos/testdata/v1.17.0.yaml +++ b/pkg/userdata/coreos/testdata/v1.17.0.yaml @@ -335,7 +335,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws-external.yaml b/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws-external.yaml index 52f1a65c7..761f74996 100644 --- a/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws-external.yaml +++ b/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws-external.yaml @@ -313,7 +313,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws.yaml b/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws.yaml index 735c9c73b..a07046d76 100644 --- a/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws.yaml +++ b/pkg/userdata/coreos/testdata/v1.9.2-disable-auto-update-aws.yaml @@ -314,7 +314,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.9.2-disable-locksmith-aws.yaml b/pkg/userdata/coreos/testdata/v1.9.2-disable-locksmith-aws.yaml index 25a8809c6..1a9b481f5 100644 --- a/pkg/userdata/coreos/testdata/v1.9.2-disable-locksmith-aws.yaml +++ b/pkg/userdata/coreos/testdata/v1.9.2-disable-locksmith-aws.yaml @@ -312,7 +312,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/coreos/testdata/v1.9.2-disable-update-engine-aws.yaml b/pkg/userdata/coreos/testdata/v1.9.2-disable-update-engine-aws.yaml index b7e876c10..c6b13031d 100644 --- a/pkg/userdata/coreos/testdata/v1.9.2-disable-update-engine-aws.yaml +++ b/pkg/userdata/coreos/testdata/v1.9.2-disable-update-engine-aws.yaml @@ -312,7 +312,7 @@ storage: mode: 0644 contents: inline: | - {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","insecure-registries":[],"registry-mirrors":[]} + {"exec-opts":["native.cgroupdriver=systemd"],"storage-driver":"overlay2","log-driver":"json-file","log-opts":{"max-size":"100m"}} - path: /opt/bin/download.sh filesystem: root diff --git a/pkg/userdata/helper/helper.go b/pkg/userdata/helper/helper.go index bfcedcbb9..e09c01872 100644 --- a/pkg/userdata/helper/helper.go +++ b/pkg/userdata/helper/helper.go @@ -102,10 +102,13 @@ SystemMaxUse=5G } type dockerConfig struct { - ExecOpts []string `json:"exec-opts"` - StorageDriver string `json:"storage-driver"` - InsecureRegistries []string `json:"insecure-registries"` - RegistryMirrors []string `json:"registry-mirrors"` + ExecOpts []string `json:"exec-opts,omitempty"` + StorageDriver string `json:"storage-driver,omitempty"` + StorageOpts []string `json:"storage-opts,omitempty"` + LogDriver string `json:"log-driver,omitempty"` + LogOpts map[string]string `json:"log-opts,omitempty"` + InsecureRegistries []string `json:"insecure-registries,omitempty"` + RegistryMirrors []string `json:"registry-mirrors,omitempty"` } // DockerConfig returns the docker daemon.json. @@ -113,6 +116,8 @@ func DockerConfig(insecureRegistries, registryMirrors []string) (string, error) cfg := dockerConfig{ ExecOpts: []string{"native.cgroupdriver=systemd"}, StorageDriver: "overlay2", + LogDriver: "json-file", + LogOpts: map[string]string{"max-size": "100m"}, InsecureRegistries: insecureRegistries, RegistryMirrors: registryMirrors, } diff --git a/pkg/userdata/rhel/provider.go b/pkg/userdata/rhel/provider.go index a7e20270b..14bc88f0b 100644 --- a/pkg/userdata/rhel/provider.go +++ b/pkg/userdata/rhel/provider.go @@ -192,9 +192,7 @@ write_files: yum config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo - mkdir -p "/etc/docker" - - yum install -y docker-ce-3:18.09.1-3.el7 \ + yum install -y docker-ce-18.09.1-3.el7 \ ebtables \ ethtool \ nfs-utils \ @@ -206,20 +204,6 @@ write_files: ipvsadm{{ if eq .CloudProviderName "vsphere" }} \ open-vm-tools{{ end }} - cat > /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json < Date: Thu, 19 Mar 2020 15:26:20 +0200 Subject: [PATCH 2/2] Drop unneeded comment from centos userdata Signed-off-by: Artiom Diomin --- pkg/userdata/centos/provider.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/userdata/centos/provider.go b/pkg/userdata/centos/provider.go index 5303c95e8..2dd451e02 100644 --- a/pkg/userdata/centos/provider.go +++ b/pkg/userdata/centos/provider.go @@ -204,7 +204,6 @@ write_files: {{- if eq .CloudProviderName "vsphere" }} systemctl enable --now vmtoolsd.service {{ end -}} -{{- /* Without this, the conformance tests fail with differing tests causing it, the common denominator: They look for some string in container logs and get an empty log */ -}} systemctl enable --now docker systemctl enable --now kubelet systemctl enable --now --no-block kubelet-healthcheck.service