-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ERROR Swap]: running with swap on is not supported. Please disable swap #610
Comments
If you do set the kubelet flag, you're safe to do this |
no need to re-open this but I still feel this is a bit counter intuitive. If you set the kubelet flag, then I would expect I don't need to ignore the preflight errors. If |
What is the command to turn off swap? |
|
It's true that Here is how I could get my mini-cluster up and running: UPD: Below workaround applies to k8s 1.10- only - for 1.11+ see https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ (TLDR: you can specify kubeadm reset
## ↓ see explanation below
sed -i '9s/^/Environment="KUBELET_EXTRA_ARGS=--fail-swap-on=false"\n/' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
systemctl daemon-reload
systemctl restart kubelet
echo "
kind: MasterConfiguration
apiVersion: kubeadm.k8s.io/v1alpha1
api:
bindPort: ${K8S_API_PORT}
apiServerCertSANs: ${K8S_API_EXTRA_HOSTS}
" > /tmp/config.yaml
kubeadm init --config /tmp/config.yaml --ignore-preflight-errors Swap
## make possible to run workload on master
kubectl taint nodes --all node-role.kubernetes.io/master- Below paragraphs apply to k8s 1.10- only
Because
It'd be great if enabling swap in kubeadm was easier than now – this would save people across the world tones of hours. Making my mini-cluster work after upgrading to 1.8 was a real pain because I'm quite inexperienced in Linux administration and I think it'd be great if others did not have to take the same path. The ideal solution would look like this IMO: echo "
kind: MasterConfiguration
apiVersion: kubeadm.k8s.io/v1alpha1
kubeletConfiguration:
allowSwap: true
" > /tmp/config.yaml
kubeadm init --config /tmp/config.yaml Of course, enabling swap should remain an edge case because it may bite in lots of circumstances. However, it'd be great if kubeadm users had a choice. Until then, it'd be great if there was an opened issue about enabling swap. |
+1 for having an option for an experimental/alpha/etc "feature" flag to enable swap that adds it to the kubeadm drop-in in kubelet.service.d and disables that pre-flight check. Definitely an edge case, agreed, but it would be nice if it were easier. (Googling and being able to quickly find this issue helps a lot, though.) |
See related: kubernetes/kubernetes#53533 |
I turned my swap off but I'm still getting this error. |
Just for the record, at least in an ubuntu-based system, I guess the place to add the --fail-swap-on=false flag is in /etc/default/kubelet file; not in the systemd conf file itself. |
for 1.11+ this is true. |
To disable it permanently, just insert Tested on Ubuntu 16.04 and 18.04. |
I QUOTE THIS, I finally was able to fix by doing this, thanks :) |
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
kubeadm version (use
kubeadm version
): 1.9.0Environment:
kubectl version
): 1.9.0uname -a
): Linux 4.9.35-v7+What happened?
When doing
kubeadm init
the error pops up[ERROR Swap]: running with swap on is not supported. Please disable swap
. The suggested fix is to use kubelet's flag so basically:But in the end, the error is still there. Maybe this is a Kubelet issue instead or maybe I'm misconfiguring something...
The text was updated successfully, but these errors were encountered: