This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "[Step 1] Disable and turn off SWAP" | |
# https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#before-you-begin | |
# 文件最後一行:Swap disabled. You **MUST** disable swap in order for the kubelet to work properly. | |
# K8s需要關閉swap | |
# 先手動關閉 | |
swapoff -a | |
# 將fstab裡的swap那一行註解 | |
sed -i '/swap/s/^/#/' /etc/fstab |