[root@master01 ~]# kubeadm init \
--kubernetes-version=v1.28.2 \
--image-repository=registry.aliyuncs.com/google_containers \
--service-cidr=10.96.0.0/12 \
--pod-network-cidr=10.244.0.0/16 \
--cri-socket unix:///run/containerd/containerd.sock \
--v=5
I1127 09:11:04.933591 5740 interface.go:432] Looking for default routes with IPv4 addresses
I1127 09:11:04.933660 5740 interface.go:437] Default route transits interface "ens160"
I1127 09:11:04.933854 5740 interface.go:209] Interface ens160 is up
I1127 09:11:04.933888 5740 interface.go:257] Interface "ens160" has 2 addresses :[192.168.19.101/24 fe80::20c:29ff:fe65:281e/64].
I1127 09:11:04.933898 5740 interface.go:224] Checking addr 192.168.19.101/24.
I1127 09:11:04.933904 5740 interface.go:231] IP found 192.168.19.101
I1127 09:11:04.933917 5740 interface.go:263] Found valid IPv4 address 192.168.19.101 for interface "ens160".
I1127 09:11:04.933922 5740 interface.go:443] Found active IP 192.168.19.101
I1127 09:11:04.933933 5740 kubelet.go:196] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"
[init] Using Kubernetes version: v1.28.2
[preflight] Running pre-flight checks
I1127 09:11:04.940620 5740 checks.go:563] validating Kubernetes and kubeadm version
I1127 09:11:04.940641 5740 checks.go:168] validating if the firewall is enabled and active
I1127 09:11:04.951518 5740 checks.go:203] validating availability of port 6443
I1127 09:11:04.951913 5740 checks.go:203] validating availability of port 10259
I1127 09:11:04.951933 5740 checks.go:203] validating availability of port 10257
I1127 09:11:04.951946 5740 checks.go:280] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml
I1127 09:11:04.951956 5740 checks.go:280] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml
I1127 09:11:04.951963 5740 checks.go:280] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml
I1127 09:11:04.952114 5740 checks.go:280] validating the existence of file /etc/kubernetes/manifests/etcd.yaml
I1127 09:11:04.952122 5740 checks.go:430] validating if the connectivity type is via proxy or direct
I1127 09:11:04.952144 5740 checks.go:469] validating http connectivity to first IP address in the CIDR
I1127 09:11:04.952158 5740 checks.go:469] validating http connectivity to first IP address in the CIDR
I1127 09:11:04.952165 5740 checks.go:104] validating the container runtime
I1127 09:11:04.974481 5740 checks.go:639] validating whether swap is enabled or not
I1127 09:11:04.974719 5740 checks.go:370] validating the presence of executable crictl
I1127 09:11:04.974748 5740 checks.go:370] validating the presence of executable conntrack
I1127 09:11:04.974947 5740 checks.go:370] validating the presence of executable ip
I1127 09:11:04.974961 5740 checks.go:370] validating the presence of executable iptables
I1127 09:11:04.974976 5740 checks.go:370] validating the presence of executable mount
I1127 09:11:04.974987 5740 checks.go:370] validating the presence of executable nsenter
I1127 09:11:04.975015 5740 checks.go:370] validating the presence of executable ebtables
I1127 09:11:04.975139 5740 checks.go:370] validating the presence of executable ethtool
I1127 09:11:04.975151 5740 checks.go:370] validating the presence of executable socat
I1127 09:11:04.975167 5740 checks.go:370] validating the presence of executable tc
I1127 09:11:04.975353 5740 checks.go:370] validating the presence of executable touch
I1127 09:11:04.975368 5740 checks.go:516] running all checks
I1127 09:11:04.981977 5740 checks.go:401] checking whether the given node name is valid and reachable using net.LookupHost
I1127 09:11:04.982153 5740 checks.go:605] validating kubelet version
I1127 09:11:05.026497 5740 checks.go:130] validating if the "kubelet" service is enabled and active
I1127 09:11:05.035875 5740 checks.go:203] validating availability of port 10250
I1127 09:11:05.036129 5740 checks.go:329] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I1127 09:11:05.036240 5740 checks.go:329] validating the contents of file /proc/sys/net/ipv4/ip_forward
I1127 09:11:05.036350 5740 checks.go:203] validating availability of port 2379
I1127 09:11:05.036371 5740 checks.go:203] validating availability of port 2380
I1127 09:11:05.036384 5740 checks.go:243] validating the existence and emptiness of directory /var/lib/etcd
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
I1127 09:11:05.036565 5740 checks.go:828] using image pull policy: IfNotPresent
I1127 09:11:05.054564 5740 checks.go:846] image exists: registry.aliyuncs.com/google_containers/kube-apiserver:v1.28.2
I1127 09:11:05.072632 5740 checks.go:846] image exists: registry.aliyuncs.com/google_containers/kube-controller-manager:v1.28.2
I1127 09:11:05.089009 5740 checks.go:846] image exists: registry.aliyuncs.com/google_containers/kube-scheduler:v1.28.2
I1127 09:11:05.109786 5740 checks.go:846] image exists: registry.aliyuncs.com/google_containers/kube-proxy:v1.28.2
W1127 09:11:05.128647 5740 checks.go:835] detected that the sandbox image "registry.aliyuncs.com/k8sxio/pause:3.6" of the container runtime is inconsistent with that used by kubeadm. It is recommended that using "registry.aliyuncs.com/google_containers/pause:3.9" as the CRI sandbox image.
I1127 09:11:05.145902 5740 checks.go:846] image exists: registry.aliyuncs.com/google_containers/pause:3.9
I1127 09:11:05.160620 5740 checks.go:846] image exists: registry.aliyuncs.com/google_containers/etcd:3.5.9-0
I1127 09:11:05.176455 5740 checks.go:846] image exists: registry.aliyuncs.com/google_containers/coredns:v1.10.1
[certs] Using certificateDir folder "/etc/kubernetes/pki"
I1127 09:11:05.176678 5740 certs.go:112] creating a new certificate authority for ca
[certs] Generating "ca" certificate and key
I1127 09:11:05.282992 5740 certs.go:519] validating certificate period for ca certificate
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local master01] and IPs [10.96.0.1 192.168.19.101]
[certs] Generating "apiserver-kubelet-client" certificate and key
I1127 09:11:05.649872 5740 certs.go:112] creating a new certificate authority for front-proxy-ca
[certs] Generating "front-proxy-ca" certificate and key
I1127 09:11:05.786684 5740 certs.go:519] validating certificate period for front-proxy-ca certificate
[certs] Generating "front-proxy-client" certificate and key
I1127 09:11:05.867778 5740 certs.go:112] creating a new certificate authority for etcd-ca
[certs] Generating "etcd/ca" certificate and key
I1127 09:11:06.035242 5740 certs.go:519] validating certificate period for etcd/ca certificate
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [localhost master01] and IPs [192.168.19.101 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [localhost master01] and IPs [192.168.19.101 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
I1127 09:11:06.437750 5740 certs.go:78] creating new public/private key files for signing service account users
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
I1127 09:11:06.470753 5740 kubeconfig.go:103] creating kubeconfig file for admin.conf
[kubeconfig] Writing "admin.conf" kubeconfig file
I1127 09:11:06.660910 5740 kubeconfig.go:103] creating kubeconfig file for kubelet.conf
[kubeconfig] Writing "kubelet.conf" kubeconfig file
I1127 09:11:06.783916 5740 kubeconfig.go:103] creating kubeconfig file for controller-manager.conf
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
I1127 09:11:06.831956 5740 kubeconfig.go:103] creating kubeconfig file for scheduler.conf
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
I1127 09:11:06.873106 5740 local.go:65] [etcd] wrote Static Pod manifest for a local etcd member to "/etc/kubernetes/manifests/etcd.yaml"
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
I1127 09:11:06.873153 5740 manifests.go:102] [control-plane] getting StaticPodSpecs
I1127 09:11:06.873358 5740 certs.go:519] validating certificate period for CA certificate
I1127 09:11:06.873427 5740 manifests.go:128] [control-plane] adding volume "ca-certs" for component "kube-apiserver"
I1127 09:11:06.873435 5740 manifests.go:128] [control-plane] adding volume "etc-pki" for component "kube-apiserver"
I1127 09:11:06.873463 5740 manifests.go:128] [control-plane] adding volume "k8s-certs" for component "kube-apiserver"
I1127 09:11:06.873901 5740 manifests.go:157] [control-plane] wrote static Pod manifest for component "kube-apiserver" to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
I1127 09:11:06.873932 5740 manifests.go:102] [control-plane] getting StaticPodSpecs
I1127 09:11:06.874093 5740 manifests.go:128] [control-plane] adding volume "ca-certs" for component "kube-controller-manager"
I1127 09:11:06.874117 5740 manifests.go:128] [control-plane] adding volume "etc-pki" for component "kube-controller-manager"
I1127 09:11:06.874123 5740 manifests.go:128] [control-plane] adding volume "flexvolume-dir" for component "kube-controller-manager"
I1127 09:11:06.874128 5740 manifests.go:128] [control-plane] adding volume "k8s-certs" for component "kube-controller-manager"
I1127 09:11:06.874132 5740 manifests.go:128] [control-plane] adding volume "kubeconfig" for component "kube-controller-manager"
I1127 09:11:06.874527 5740 manifests.go:157] [control-plane] wrote static Pod manifest for component "kube-controller-manager" to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[control-plane] Creating static Pod manifest for "kube-scheduler"
I1127 09:11:06.874563 5740 manifests.go:102] [control-plane] getting StaticPodSpecs
I1127 09:11:06.874722 5740 manifests.go:128] [control-plane] adding volume "kubeconfig" for component "kube-scheduler"
I1127 09:11:06.875004 5740 manifests.go:157] [control-plane] wrote static Pod manifest for component "kube-scheduler" to "/etc/kubernetes/manifests/kube-scheduler.yaml"
I1127 09:11:06.875030 5740 kubelet.go:67] Stopping the kubelet
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Starting the kubelet
I1127 09:11:07.017539 5740 waitcontrolplane.go:83] [wait-control-plane] Waiting for the API server to be healthy
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 4.002718 seconds
I1127 09:11:11.021584 5740 uploadconfig.go:112] [upload-config] Uploading the kubeadm ClusterConfiguration to a ConfigMap
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
I1127 09:11:11.029062 5740 uploadconfig.go:126] [upload-config] Uploading the kubelet component config to a ConfigMap
[kubelet] Creating a ConfigMap "kubelet-config" in namespace kube-system with the configuration for the kubelets in the cluster
I1127 09:11:11.035946 5740 uploadconfig.go:131] [upload-config] Preserving the CRISocket information for the control-plane node
I1127 09:11:11.035964 5740 patchnode.go:31] [patchnode] Uploading the CRI Socket information "unix:///run/containerd/containerd.sock" to the Node API object "master01" as an annotation
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node master01 as control-plane by adding the labels: [node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]
[mark-control-plane] Marking the node master01 as control-plane by adding the taints [node-role.kubernetes.io/control-plane:NoSchedule]
[bootstrap-token] Using token: dj67du.p9nabt08rk2f7rs6
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes
[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
I1127 09:11:12.069563 5740 clusterinfo.go:47] [bootstrap-token] loading admin kubeconfig
I1127 09:11:12.070387 5740 clusterinfo.go:58] [bootstrap-token] copying the cluster from admin.conf to the bootstrap kubeconfig
I1127 09:11:12.070547 5740 clusterinfo.go:70] [bootstrap-token] creating/updating ConfigMap in kube-public namespace
I1127 09:11:12.073271 5740 clusterinfo.go:84] creating the RBAC rules for exposing the cluster-info ConfigMap in the kube-public namespace
I1127 09:11:12.078107 5740 kubeletfinalize.go:90] [kubelet-finalize] Assuming that kubelet client certificate rotation is enabled: found "/var/lib/kubelet/pki/kubelet-client-current.pem"
[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key
I1127 09:11:12.078690 5740 kubeletfinalize.go:134] [kubelet-finalize] Restarting the kubelet to enable client certificate rotation
[addons] Applied essential addon: CoreDNS
I1127 09:11:12.457842 5740 request.go:629] Waited for 178.849313ms due to client-side throttling, not priority and fairness, request: POST:https://192.168.19.101:6443/apis/rbac.authorization.k8s.io/v1/namespaces/kube-system/rolebindings?timeout=10s
[addons] Applied essential addon: kube-proxy
Your Kubernetes control-plane has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Alternatively, if you are the root user, you can run:
export KUBECONFIG=/etc/kubernetes/admin.conf
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
Then you can join any number of worker nodes by running the following on each as root:
kubeadm join 192.168.19.101:6443 --token dj67du.p9nabt08rk2f7rs6 \
--discovery-token-ca-cert-hash sha256:201dc88b6f1863edfc9ecc6968a60ed3168c52f4f6d4aebb052fba73dc6752ea