From d044c74ea4b9900c269ee8de8131ed49ba6fedc8 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 11 Jun 2020 14:03:52 -0400 Subject: [PATCH] Sync kublelet config across platforms This came up because of a bug report showing that workloads were scheduled on masters for the baremetal platform regardless of the schedulableMasters scheduler configuration. This is due to the NoSchedule taint not being applied by default on this platform. The baremetal platform specific kubelet caused this behavior. We were going to remove the custom kubelet config once this behavior was configurable (see PR #993), but it was never removed because we ended up needing to make some IPv6 related customizations in this file. We also forgot to re-add the default taint. Meanwhile, some other changes to the kubelet unit were not applied to the baremetal version. I also checked the openstack and vsphere files and found discrepencies there, as well. This is the simplest fix, which is to get these files in sync again. The differences are very minor, so a better follow-up would be to get back to a single kubelet unit, or at least share the duplicated content somehow. I'm leaving that further cleanup as another change, since the most straight forward fix will be the simpler one to backport. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1828250 --- .../01-master-kubelet/baremetal/units/kubelet.service.yaml | 6 +++++- .../01-master-kubelet/openstack/units/kubelet.service.yaml | 4 +++- .../01-master-kubelet/vsphere/units/kubelet.service.yaml | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/master/01-master-kubelet/baremetal/units/kubelet.service.yaml b/templates/master/01-master-kubelet/baremetal/units/kubelet.service.yaml index 20c41e4413..726075348b 100644 --- a/templates/master/01-master-kubelet/baremetal/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/baremetal/units/kubelet.service.yaml @@ -10,6 +10,7 @@ contents: | Type=notify ExecStartPre=/bin/mkdir --parents /etc/kubernetes/manifests ExecStartPre=/bin/rm -f /var/lib/kubelet/cpu_manager_state + Environment="KUBELET_LOG_LEVEL=4" EnvironmentFile=/etc/os-release EnvironmentFile=-/etc/kubernetes/kubelet-workaround EnvironmentFile=-/etc/kubernetes/kubelet-env @@ -21,6 +22,7 @@ contents: | --kubeconfig=/var/lib/kubelet/kubeconfig \ --container-runtime=remote \ --container-runtime-endpoint=/var/run/crio/crio.sock \ + --runtime-cgroups=/system.slice/crio.service \ --node-labels=node-role.kubernetes.io/master,node.openshift.io/os_id=${ID} \ --node-ip=${KUBELET_NODE_IP} \ --address=${KUBELET_NODE_IP} \ @@ -28,7 +30,9 @@ contents: | --cloud-provider={{cloudProvider .}} \ --volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume/exec \ {{cloudConfigFlag . }} \ - --v=3 + --register-with-taints=node-role.kubernetes.io/master=:NoSchedule \ + --pod-infra-container-image={{.Images.infraImageKey}} \ + --v=${KUBELET_LOG_LEVEL} Restart=always RestartSec=10 diff --git a/templates/master/01-master-kubelet/openstack/units/kubelet.service.yaml b/templates/master/01-master-kubelet/openstack/units/kubelet.service.yaml index 7058621efa..726075348b 100644 --- a/templates/master/01-master-kubelet/openstack/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/openstack/units/kubelet.service.yaml @@ -10,7 +10,7 @@ contents: | Type=notify ExecStartPre=/bin/mkdir --parents /etc/kubernetes/manifests ExecStartPre=/bin/rm -f /var/lib/kubelet/cpu_manager_state - Environment="KUBELET_LOG_LEVEL=3" + Environment="KUBELET_LOG_LEVEL=4" EnvironmentFile=/etc/os-release EnvironmentFile=-/etc/kubernetes/kubelet-workaround EnvironmentFile=-/etc/kubernetes/kubelet-env @@ -22,6 +22,7 @@ contents: | --kubeconfig=/var/lib/kubelet/kubeconfig \ --container-runtime=remote \ --container-runtime-endpoint=/var/run/crio/crio.sock \ + --runtime-cgroups=/system.slice/crio.service \ --node-labels=node-role.kubernetes.io/master,node.openshift.io/os_id=${ID} \ --node-ip=${KUBELET_NODE_IP} \ --address=${KUBELET_NODE_IP} \ @@ -30,6 +31,7 @@ contents: | --volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume/exec \ {{cloudConfigFlag . }} \ --register-with-taints=node-role.kubernetes.io/master=:NoSchedule \ + --pod-infra-container-image={{.Images.infraImageKey}} \ --v=${KUBELET_LOG_LEVEL} Restart=always diff --git a/templates/master/01-master-kubelet/vsphere/units/kubelet.service.yaml b/templates/master/01-master-kubelet/vsphere/units/kubelet.service.yaml index a1fdc02627..fae4c529ae 100644 --- a/templates/master/01-master-kubelet/vsphere/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/vsphere/units/kubelet.service.yaml @@ -10,7 +10,7 @@ contents: | Type=notify ExecStartPre=/bin/mkdir --parents /etc/kubernetes/manifests ExecStartPre=/bin/rm -f /var/lib/kubelet/cpu_manager_state - Environment="KUBELET_LOG_LEVEL=3" + Environment="KUBELET_LOG_LEVEL=4" EnvironmentFile=/etc/os-release EnvironmentFile=-/etc/kubernetes/kubelet-workaround EnvironmentFile=-/etc/kubernetes/kubelet-env @@ -41,6 +41,7 @@ contents: | --volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume/exec \ {{cloudConfigFlag . }} \ --register-with-taints=node-role.kubernetes.io/master=:NoSchedule \ + --pod-infra-container-image={{.Images.infraImageKey}} \ --v=${KUBELET_LOG_LEVEL} Restart=always