Get resource_type of kubernetes cgroup

Cgroup name of Kubernetes is determined by the
cgroup driver of Docker. If cgroup driver of Docker
is systemd, there will be an error in deploying HugePages.

https: //github.com/kubernetes/kubernetes/blob/release-1.26/pkg/kubelet/cm/cgroup_manager_linux.go#L77-L81
Change-Id: If709a968dde24d01e17fef63f09ebf9d7a23fc62
This commit is contained in:
jinyuanliu 2021-07-02 13:52:56 +08:00 committed by Vladimir Kozhukalov
parent c4e0007717
commit 03c22c3c76
1 changed files with 11 additions and 0 deletions

View File

@ -27,9 +27,20 @@ fi
#NOTE: Lint and package chart
make -C ${OSH_INFRA_PATH} libvirt
#NOTE: Get resource_type of kubernetes cgroup
KUBERNETES_CGROUP=$(sudo docker info | grep "Cgroup Driver" | awk -F': ' '{print $2}' | grep -q systemd && echo kubepods.slice || echo kubepods)
#NOTE: Deploy libvirt
tee /tmp/libvirt.yaml << EOF
conf:
kubernetes:
cgroup: ${KUBERNETES_CGROUP}
EOF
#NOTE: Deploy libvirt
helm upgrade --install libvirt ${OSH_INFRA_PATH}/libvirt \
--namespace=openstack \
--values=/tmp/libvirt.yaml \
--set conf.ceph.enabled=${CEPH_ENABLED} \
${OSH_EXTRA_HELM_ARGS} \
${OSH_EXTRA_HELM_ARGS_LIBVIRT}