Difference between revisions of "Kubeadm init"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
(47 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | <code>[[kubeadm | + | {{lowercase}} |
+ | <code>[[kubeadm]] init</code> to bootstrap a Kubernetes [[control-plane]] node | ||
+ | * <code>[[kubeadm]] init --[[pod-network-cidr]]=10.244.0.0/16</code> | ||
+ | * <code>[[kubeadm init --ignore-preflight-errors=All]]</code> | ||
+ | Dependencies: | ||
+ | * <code>[[kubeadm config images pull]]</code> | ||
+ | * <code>[[apt install socat]] [[conntrack]]</code> | ||
+ | * <code>[[snap install kubectl --classic]]</code> | ||
+ | * <code>[[snap install kubelet --classic]] && [[snap start kubelet.daemon]]</code> | ||
+ | * [[Ubuntu crictl installation|crictl-tools]] | ||
+ | |||
+ | == [[Play-with-K8s]] == | ||
+ | * <code>[[kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16]]</code> | ||
+ | * <code>[[kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml]]</code> | ||
+ | |||
+ | == With errors == | ||
+ | |||
+ | kubeadm init --pod-network-cidr=10.244.0.0/16 | ||
+ | W0419 17:17:35.020389 29884 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io | ||
+ | kubeproxy.config.k8s.io] | ||
+ | [init] Using Kubernetes version: v1.18.2 | ||
+ | [preflight] Running pre-flight checks | ||
+ | [preflight] WARNING: Couldn't create the interface used for talking to the container runtime: docker is required for container runtime: exec: "docker": | ||
+ | executable file not found in $PATH | ||
+ | [WARNING FileExisting-socat]: socat not found in system path | ||
+ | [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' | ||
+ | error execution phase preflight: [preflight] Some fatal errors occurred: | ||
+ | [ERROR NumCPU]: the number of available CPUs 1 is less than the required 2 | ||
+ | [ERROR FileExisting-crictl]: [[crictl]] not found in system path | ||
+ | [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist | ||
+ | [ERROR FileExisting-conntrack]: conntrack not found in system path | ||
+ | [ERROR KubeletVersion]: couldn't get kubelet version: cannot execute 'kubelet --version': executable file not found in $PATH | ||
+ | [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` | ||
+ | To see the stack trace of this error execute with --v=5 or higher | ||
+ | |||
+ | |||
+ | === [ERROR NumCPU]: the number of available CPUs 1 is less than the required 2 === | ||
+ | * If using <code>[[multipass]]</code>: [[Multipass: Modify number of CPU on an existing instance]] | ||
+ | |||
+ | |||
+ | kubeadm init --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=All | ||
+ | |||
+ | == With errors: [[docker]] not installed == | ||
+ | kubeadm init | ||
+ | <pre> | ||
+ | W0823 18:18:03.055636 30827 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io] | ||
+ | [init] Using Kubernetes version: v1.18.8 | ||
+ | [preflight] Running pre-flight checks | ||
+ | [preflight] WARNING: Couldn't create the interface used for talking to the container runtime: docker is required for | ||
+ | container runtime: exec: "docker": executable file not found in $PATH | ||
+ | [WARNING FileExisting-socat]: socat not found in system path | ||
+ | [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' | ||
+ | error execution phase preflight: [preflight] Some fatal errors occurred: | ||
+ | [ERROR NumCPU]: the number of available CPUs 1 is less than the required 2 | ||
+ | [ERROR FileExisting-crictl]: crictl not found in system path | ||
+ | [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does | ||
+ | not exist | ||
+ | [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1 | ||
+ | [ERROR FileExisting-conntrack]: conntrack not found in system path | ||
+ | [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` | ||
+ | To see the stack trace of this error execute with --v=5 or higher | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | == [[v1.25]].4 == | ||
+ | [init] Using Kubernetes version: v1.25.4 | ||
+ | [preflight] Running pre-flight checks | ||
+ | W1203 13:22:13.289185 159684 checks.go:1019] [preflight] WARNING: Couldn't create the interface used for talking to the container | ||
+ | runtime: [[crictl]] is required by the container runtime: executable file not found in $PATH | ||
+ | [WARNING SystemVerification]: missing optional [[cgroups]]: [[blkio]] | ||
+ | [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' | ||
+ | error execution phase preflight: [preflight] Some fatal errors occurred: | ||
+ | [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist | ||
+ | [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1 | ||
+ | [ERROR FileExisting-crictl]: crictl not found in system path | ||
+ | [ERROR KubeletVersion]: couldn't get kubelet version: cannot execute 'kubelet --version': executable file not found in $PATH | ||
+ | [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` | ||
+ | To see the stack trace of this error execute with --v=5 or higher | ||
+ | |||
+ | == Related terms == | ||
+ | * <code>[[conntrack]] (command)</code> [[Netfilter]] (<code>[[apt install conntrack]]</code>) | ||
+ | * <code>[[socat]]</code>: <code>[[apt install]] [[socat]]</code> | ||
+ | * <code>[[kubeadm config images pull]]</code> | ||
+ | * [[Kubernetes (snap install)]] | ||
+ | * <code>[[kubeadm join]]</code> | ||
+ | * <code>[[kind: ClusterConfiguration]]</code> | ||
+ | * <code>[[snap install kubelet --classic]]</code> | ||
+ | * <code>[[/etc/kubernetes/manifests/]]</code> | ||
== See also == | == See also == | ||
+ | * {{kubeadm init}} | ||
* {{kubeadm}} | * {{kubeadm}} | ||
− | * {{ | + | * {{Kubernetes installation}} |
[[Category:Kubernetes]] | [[Category:Kubernetes]] |
Latest revision as of 10:43, 20 March 2024
kubeadm init
to bootstrap a Kubernetes control-plane node
kubeadm init --pod-network-cidr=10.244.0.0/16
kubeadm init --ignore-preflight-errors=All
Dependencies:
kubeadm config images pull
apt install socat conntrack
snap install kubectl --classic
snap install kubelet --classic && snap start kubelet.daemon
- crictl-tools
Contents
Play-with-K8s[edit]
kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16
kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml
With errors[edit]
kubeadm init --pod-network-cidr=10.244.0.0/16 W0419 17:17:35.020389 29884 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io] [init] Using Kubernetes version: v1.18.2 [preflight] Running pre-flight checks [preflight] WARNING: Couldn't create the interface used for talking to the container runtime: docker is required for container runtime: exec: "docker": executable file not found in $PATH [WARNING FileExisting-socat]: socat not found in system path [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR NumCPU]: the number of available CPUs 1 is less than the required 2 [ERROR FileExisting-crictl]: crictl not found in system path [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist [ERROR FileExisting-conntrack]: conntrack not found in system path [ERROR KubeletVersion]: couldn't get kubelet version: cannot execute 'kubelet --version': executable file not found in $PATH [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` To see the stack trace of this error execute with --v=5 or higher
[ERROR NumCPU]: the number of available CPUs 1 is less than the required 2[edit]
kubeadm init --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=All
With errors: docker not installed[edit]
kubeadm init
W0823 18:18:03.055636 30827 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io] [init] Using Kubernetes version: v1.18.8 [preflight] Running pre-flight checks [preflight] WARNING: Couldn't create the interface used for talking to the container runtime: docker is required for container runtime: exec: "docker": executable file not found in $PATH [WARNING FileExisting-socat]: socat not found in system path [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR NumCPU]: the number of available CPUs 1 is less than the required 2 [ERROR FileExisting-crictl]: crictl not found in system path [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1 [ERROR FileExisting-conntrack]: conntrack not found in system path [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` To see the stack trace of this error execute with --v=5 or higher
v1.25.4[edit]
[init] Using Kubernetes version: v1.25.4 [preflight] Running pre-flight checks W1203 13:22:13.289185 159684 checks.go:1019] [preflight] WARNING: Couldn't create the interface used for talking to the container runtime: crictl is required by the container runtime: executable file not found in $PATH [WARNING SystemVerification]: missing optional cgroups: blkio [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1 [ERROR FileExisting-crictl]: crictl not found in system path [ERROR KubeletVersion]: couldn't get kubelet version: cannot execute 'kubelet --version': executable file not found in $PATH [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...` To see the stack trace of this error execute with --v=5 or higher
Related terms[edit]
conntrack (command)
Netfilter (apt install conntrack
)socat
:apt install socat
kubeadm config images pull
- Kubernetes (snap install)
kubeadm join
kind: ClusterConfiguration
snap install kubelet --classic
/etc/kubernetes/manifests/
See also[edit]
Advertising: