mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 15:20:17 +00:00
Enable node e2e accounting on systemd
Install docker from RHEL repo on RHEL
This commit is contained in:
parent
4047ca1d97
commit
67493aa9f4
@ -25,6 +25,22 @@
|
|||||||
# - centos 7
|
# - centos 7
|
||||||
# - debian jessie
|
# - debian jessie
|
||||||
|
|
||||||
|
# RHEL os detection
|
||||||
|
cat /etc/*-release | grep "ID=\"rhel\""
|
||||||
|
OS_RHEL=$?
|
||||||
|
|
||||||
|
# On a systemd environment, enable cpu and memory accounting for all processes by default.
|
||||||
|
if [ -d /etc/systemd ]; then
|
||||||
|
cat <<EOF >kubernetes-accounting.conf
|
||||||
|
[Manager]
|
||||||
|
DefaultCPUAccounting=yes
|
||||||
|
DefaultMemoryAccounting=yes
|
||||||
|
EOF
|
||||||
|
sudo mkdir -p /etc/systemd/system.conf.d/
|
||||||
|
sudo cp kubernetes-accounting.conf /etc/systemd/system.conf.d
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
fi
|
||||||
|
|
||||||
# Fixup sudoers require tty
|
# Fixup sudoers require tty
|
||||||
sudo grep -q "# Defaults requiretty" /etc/sudoers
|
sudo grep -q "# Defaults requiretty" /etc/sudoers
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
@ -44,9 +60,18 @@ fi
|
|||||||
# Install docker
|
# Install docker
|
||||||
hash docker 2>/dev/null
|
hash docker 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
curl -fsSL https://get.docker.com/ | sh
|
# RHEL platforms should always install from RHEL repository
|
||||||
sudo service docker start
|
# This will install the latest supported stable docker platform on RHEL
|
||||||
sudo systemctl enable docker.service
|
if [ $OS_RHEL -eq 0 ]; then
|
||||||
|
sudo yum install -y docker-latest
|
||||||
|
sudo groupadd docker
|
||||||
|
sudo systemctl enable docker-latest.service
|
||||||
|
sudo systemctl start docker-latest.service
|
||||||
|
else
|
||||||
|
curl -fsSL https://get.docker.com/ | sh
|
||||||
|
sudo service docker start
|
||||||
|
sudo systemctl enable docker.service
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Allow jenkins access to docker
|
# Allow jenkins access to docker
|
||||||
@ -55,10 +80,13 @@ sudo usermod -a -G docker jenkins
|
|||||||
# install lxc
|
# install lxc
|
||||||
cat /etc/*-release | grep "ID=debian"
|
cat /etc/*-release | grep "ID=debian"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
sudo apt-get install lxc -y
|
hash apt-get 2>/dev/null
|
||||||
lxc-checkconfig
|
if [ $? -ne 1 ]; then
|
||||||
sudo sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="\1 cgroup_enable=memory"/' /etc/default/grub
|
sudo apt-get install lxc -y
|
||||||
sudo update-grub
|
lxc-checkconfig
|
||||||
|
sudo sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="\1 cgroup_enable=memory"/' /etc/default/grub
|
||||||
|
sudo update-grub
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# delete init kubelet from containervm so that is doesn't startup
|
# delete init kubelet from containervm so that is doesn't startup
|
||||||
|
Loading…
Reference in New Issue
Block a user