24sama
你好!

这个是我生成的 config-sample.yaml
下面是我的安装日志:
[root@master ~]# ./kk create cluster -f config-sample.yaml
+————–+——+——+———+———-+——-+——-+———–+———-+————+————-+——————+————–+
| name | sudo | curl | openssl | ebtables | socat | ipset | conntrack | docker | nfs client | ceph client | glusterfs client | time |
+————–+——+——+———+———-+——-+——-+———–+———-+————+————-+——————+————–+
| node2.local | y | y | y | y | y | y | y | 20.10.12 | y | | | CST 15:07:31 |
| node1.local | y | y | y | y | y | y | y | 20.10.12 | y | | | CST 15:07:31 |
| master.local | y | y | y | y | y | y | y | 20.10.12 | y | | | CST 15:07:31 |
+————–+——+——+———+———-+——-+——-+———–+———-+————+————-+——————+————–+
This is a simple check of your environment.
Before installation, you should ensure that your machines meet all requirements specified at
https://github.com/kubesphere/kubekey#requirements-and-recommendations
Continue this installation? [yes/no]: yes
INFO[15:07:34 CST] Downloading Installation Files
INFO[15:07:34 CST] Downloading kubeadm …
INFO[15:07:35 CST] Downloading kubelet …
INFO[15:07:36 CST] Downloading kubectl …
INFO[15:07:37 CST] Downloading helm …
INFO[15:07:37 CST] Downloading kubecni …
INFO[15:07:38 CST] Downloading etcd …
INFO[15:07:38 CST] Downloading docker …
INFO[15:07:39 CST] Downloading crictl …
INFO[15:07:39 CST] Configuring operating system …
[node1.local 192.168.24.101] MSG:
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_local_reserved_ports = 30000-32767
vm.max_map_count = 262144
vm.swappiness = 1
fs.inotify.max_user_instances = 524288
[node2.local 192.168.24.102] MSG:
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_local_reserved_ports = 30000-32767
vm.max_map_count = 262144
vm.swappiness = 1
fs.inotify.max_user_instances = 524288
[master.local 192.168.24.100] MSG:
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_local_reserved_ports = 30000-32767
vm.max_map_count = 262144
vm.swappiness = 1
fs.inotify.max_user_instances = 524288
INFO[15:07:43 CST] Get cluster status
INFO[15:07:44 CST] Installing Container Runtime …
INFO[15:07:45 CST] Start to download images on all nodes
[node2.local] Downloading image: kubesphere/pause:3.4.1
[master.local] Downloading image: kubesphere/pause:3.4.1
[node1.local] Downloading image: kubesphere/pause:3.4.1
[node2.local] Downloading image: kubesphere/kube-proxy:v1.21.5
[node1.local] Downloading image: kubesphere/kube-proxy:v1.21.5
[master.local] Downloading image: kubesphere/kube-apiserver:v1.21.5
[master.local] Downloading image: kubesphere/kube-controller-manager:v1.21.5
[node2.local] Downloading image: coredns/coredns:1.8.0
[node1.local] Downloading image: coredns/coredns:1.8.0
[master.local] Downloading image: kubesphere/kube-scheduler:v1.21.5
[node2.local] Downloading image: kubesphere/k8s-dns-node-cache:1.15.12
[node1.local] Downloading image: kubesphere/k8s-dns-node-cache:1.15.12
[master.local] Downloading image: kubesphere/kube-proxy:v1.21.5
[node2.local] Downloading image: calico/kube-controllers:v3.20.0
[node1.local] Downloading image: calico/kube-controllers:v3.20.0
[master.local] Downloading image: coredns/coredns:1.8.0
[node2.local] Downloading image: calico/cni:v3.20.0
[node1.local] Downloading image: calico/cni:v3.20.0
[master.local] Downloading image: kubesphere/k8s-dns-node-cache:1.15.12
[node2.local] Downloading image: calico/node:v3.20.0
[master.local] Downloading image: calico/kube-controllers:v3.20.0
[node2.local] Downloading image: calico/pod2daemon-flexvol:v3.20.0
[node1.local] Downloading image: calico/node:v3.20.0
[master.local] Downloading image: calico/cni:v3.20.0
[master.local] Downloading image: calico/node:v3.20.0
[master.local] Downloading image: calico/pod2daemon-flexvol:v3.20.0
[node1.local] Downloading image: calico/pod2daemon-flexvol:v3.20.0
INFO[15:11:41 CST] Getting etcd status
[master.local 192.168.24.100] MSG:
Configuration file will be created
INFO[15:11:42 CST] Generating etcd certs
INFO[15:11:44 CST] Synchronizing etcd certs
INFO[15:11:44 CST] Creating etcd service
Push /root/kubekey/v1.21.5/amd64/etcd-v3.4.13-linux-amd64.tar.gz to 192.168.24.100:/tmp/kubekey/etcd-v3.4.13-linux-amd64.tar.gz Done
INFO[15:11:45 CST] Starting etcd cluster
INFO[15:11:46 CST] Refreshing etcd configuration
[master.local 192.168.24.100] MSG:
Created symlink from /etc/systemd/system/multi-user.target.wants/etcd.service to /etc/systemd/system/etcd.service.
INFO[15:11:50 CST] Backup etcd data regularly
INFO[15:11:57 CST] Installing kube binaries
Push /root/kubekey/v1.21.5/amd64/kubeadm to 192.168.24.101:/tmp/kubekey/kubeadm Done
Push /root/kubekey/v1.21.5/amd64/kubeadm to 192.168.24.100:/tmp/kubekey/kubeadm Done
Push /root/kubekey/v1.21.5/amd64/kubeadm to 192.168.24.102:/tmp/kubekey/kubeadm Done
Push /root/kubekey/v1.21.5/amd64/kubelet to 192.168.24.100:/tmp/kubekey/kubelet Done
Push /root/kubekey/v1.21.5/amd64/kubectl to 192.168.24.100:/tmp/kubekey/kubectl Done
Push /root/kubekey/v1.21.5/amd64/kubelet to 192.168.24.101:/tmp/kubekey/kubelet Done
Push /root/kubekey/v1.21.5/amd64/kubelet to 192.168.24.102:/tmp/kubekey/kubelet Done
Push /root/kubekey/v1.21.5/amd64/helm to 192.168.24.100:/tmp/kubekey/helm Done
Push /root/kubekey/v1.21.5/amd64/kubectl to 192.168.24.101:/tmp/kubekey/kubectl Done
Push /root/kubekey/v1.21.5/amd64/kubectl to 192.168.24.102:/tmp/kubekey/kubectl Done
Push /root/kubekey/v1.21.5/amd64/cni-plugins-linux-amd64-v0.9.1.tgz to 192.168.24.100:/tmp/kubekey/cni-plugins-linux-amd64-v0.9.1.tgz Done
Push /root/kubekey/v1.21.5/amd64/helm to 192.168.24.101:/tmp/kubekey/helm Done
Push /root/kubekey/v1.21.5/amd64/helm to 192.168.24.102:/tmp/kubekey/helm Done
Push /root/kubekey/v1.21.5/amd64/cni-plugins-linux-amd64-v0.9.1.tgz to 192.168.24.101:/tmp/kubekey/cni-plugins-linux-amd64-v0.9.1.tgz Done
Push /root/kubekey/v1.21.5/amd64/cni-plugins-linux-amd64-v0.9.1.tgz to 192.168.24.102:/tmp/kubekey/cni-plugins-linux-amd64-v0.9.1.tgz Done
INFO[15:12:28 CST] Initializing kubernetes cluster
[master.local 192.168.24.100] MSG:
W1223 15:12:30.279915 11413 utils.go:69] The recommended value for “clusterDNS” in “KubeletConfiguration” is: [10.233.0.10]; the provided value is: [169.254.25.10]
[init] Using Kubernetes version: v1.21.5
[preflight] Running pre-flight checks
[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’
[certs] Using certificateDir folder “/etc/kubernetes/pki”
[certs] Generating “ca” certificate and key
[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 lb.kubesphere.local localhost master.local master.local.cluster.local node1.local node1.local.cluster.local node2.local node2.local.cluster.local] and IPs [10.233.0.1 192.168.24.100 127.0.0.1 192.168.24.101 192.168.24.102]
[certs] Generating “apiserver-kubelet-client” certificate and key
[certs] Generating “front-proxy-ca” certificate and key
[certs] Generating “front-proxy-client” certificate and key
[certs] External etcd mode: Skipping etcd/ca certificate authority generation
[certs] External etcd mode: Skipping etcd/server certificate generation
[certs] External etcd mode: Skipping etcd/peer certificate generation
[certs] External etcd mode: Skipping etcd/healthcheck-client certificate generation
[certs] External etcd mode: Skipping apiserver-etcd-client certificate generation
[certs] Generating “sa” key and public key
[kubeconfig] Using kubeconfig folder “/etc/kubernetes”
[kubeconfig] Writing “admin.conf” kubeconfig file
[kubeconfig] Writing “kubelet.conf” kubeconfig file
[kubeconfig] Writing “controller-manager.conf” kubeconfig file
[kubeconfig] Writing “scheduler.conf” kubeconfig file
[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
[control-plane] Using manifest folder “/etc/kubernetes/manifests”
[control-plane] Creating static Pod manifest for “kube-apiserver”
[control-plane] Creating static Pod manifest for “kube-controller-manager”
[control-plane] Creating static Pod manifest for “kube-scheduler”
[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 28.007885 seconds
[upload-config] Storing the configuration used in ConfigMap “kubeadm-config” in the “kube-system” Namespace
[kubelet] Creating a ConfigMap “kubelet-config-1.21” in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see –upload-certs
[mark-control-plane] Marking the node master.local as control-plane by adding the labels: [node-role.kubernetes.io/master(deprecated) node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]
[mark-control-plane] Marking the node master.local as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: 2jl6ru.wo2eqx4tq853qa6d
[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
[kubelet-finalize] Updating “/etc/kubernetes/kubelet.conf” to point to a rotatable kubelet client certificate and key
[addons] Applied essential addon: CoreDNS
[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/
You can now join any number of control-plane nodes by copying certificate authorities
and service account keys on each node and then running the following as root:
kubeadm join lb.kubesphere.local:6443 –token 2jl6ru.wo2eqx4tq853qa6d \
--discovery-token-ca-cert-hash sha256:4fb3825f5c9848f9e017a68616a6dbd7cf340d2eca9ea10711c76f2a200ce2e4 \\
--control-plane
Then you can join any number of worker nodes by running the following on each as root:
kubeadm join lb.kubesphere.local:6443 –token 2jl6ru.wo2eqx4tq853qa6d \
--discovery-token-ca-cert-hash sha256:4fb3825f5c9848f9e017a68616a6dbd7cf340d2eca9ea10711c76f2a200ce2e4
[master.local 192.168.24.100] MSG:
service “kube-dns” deleted
[master.local 192.168.24.100] MSG:
service/coredns created
Warning: resource clusterroles/system:coredns is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create –save-config or kubectl apply. The missing annotation will be patched automatically.
clusterrole.rbac.authorization.k8s.io/system:coredns configured
[master.local 192.168.24.100] MSG:
serviceaccount/nodelocaldns created
daemonset.apps/nodelocaldns created
[master.local 192.168.24.100] MSG:
configmap/nodelocaldns created
INFO[15:23:26 CST] Get cluster status
INFO[15:23:31 CST] Joining nodes to cluster
[node2.local 192.168.24.102] MSG:
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster…
[preflight] FYI: You can look at this config file with ‘kubectl -n kube-system get cm kubeadm-config -o yaml’
W1223 15:23:35.652552 21532 utils.go:69] The recommended value for “clusterDNS” in “KubeletConfiguration” is: [10.233.0.10]; the provided value is: [169.254.25.10]
[kubelet-start] Writing kubelet configuration to file “/var/lib/kubelet/config.yaml”
[kubelet-start] Writing kubelet environment file with flags to file “/var/lib/kubelet/kubeadm-flags.env”
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap…
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
Run ‘kubectl get nodes’ on the control-plane to see this node join the cluster.
[node1.local 192.168.24.101] MSG:
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster…
[preflight] FYI: You can look at this config file with ‘kubectl -n kube-system get cm kubeadm-config -o yaml’
W1223 15:23:36.166778 10215 utils.go:69] The recommended value for “clusterDNS” in “KubeletConfiguration” is: [10.233.0.10]; the provided value is: [169.254.25.10]
[kubelet-start] Writing kubelet configuration to file “/var/lib/kubelet/config.yaml”
[kubelet-start] Writing kubelet environment file with flags to file “/var/lib/kubelet/kubeadm-flags.env”
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap…
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
Run ‘kubectl get nodes’ on the control-plane to see this node join the cluster.
[node2.local 192.168.24.102] MSG:
node/node2.local labeled
[node1.local 192.168.24.101] MSG:
node/node1.local labeled
INFO[15:23:46 CST] Deploying network plugin …
[master.local 192.168.24.100] MSG:
configmap/calico-config created
customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrole.rbac.authorization.k8s.io/calico-node created
clusterrolebinding.rbac.authorization.k8s.io/calico-node created
daemonset.apps/calico-node created
serviceaccount/calico-node created
deployment.apps/calico-kube-controllers created
serviceaccount/calico-kube-controllers created
Warning: policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+; use policy/v1 PodDisruptionBudget
poddisruptionbudget.policy/calico-kube-controllers created
INFO[15:23:54 CST] Congratulations! Installation is successful.
[root@master ~]#
[root@master ~]#
现在都执行完毕后,还是没有需要的Po和ns