Hi,
I am trying to run kubernetes on nixos in a single node mode. I have added the following to my configuration.nix
:
services.kubernetes = {
roles = ["master" "node"];
};
when I run nixos-rebuild
, I do get kubectl
executable and I notice that a bunch of new systemd services have been loaded:
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"archive", BuildDate:"1970-01-01T00:00:01Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"archive", BuildDate:"1970-01-01T00:00:01Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
However, I cannot create any persistent volumes or schedule any pods and my cluster seem to have no nodes:
kubectl get nodes
# No resources found.
Also I can notice that the kublet
service has failed loading
kubelet.service - Kubernetes Kubelet Service
Loaded: loaded (/nix/store/wgd21w9frc9zs9x8905z3zcnhzz16yam-unit-kubelet.service/kubelet.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-02-17 09:13:34 GMT; 7min ago
Process: 1760 ExecStart=/nix/store/bnrn04kn7bf3gjzp9di7nrgmn1y22j1c-kubernetes-1.13.3/bin/kubelet --kubeconfig=/nix/store/99xycfah58lrhimynja1dyqkgrylzygd-kubelet->
Main PID: 1760 (code=exited, status=255)
CPU: 94ms
[...]
Feb 17 09:13:34 antanix kubelet[1760]: I0217 09:13:34.311412 1760 server.go:666] --cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /
Feb 17 09:13:34 antanix kubelet[1760]: F0217 09:13:34.311580 1760 server.go:261] failed to run Kubelet: Running with swap on is not supported, please disable swap>
Feb 17 09:13:34 antanix systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Feb 17 09:13:34 antanix systemd[1]: kubelet.service: Failed with result 'exit-code'.
Feb 17 09:13:34 antanix systemd[1]: kubelet.service: Consumed 94ms CPU time
Is there a nixos option to disable swap? Also, Am I supposed to do add any other configuration step in order to configure a single node setup (similar to minikube?)