hostnamectl set-hostname l-master
hostnamectl set-hostname l-worker-01
hostnamectl set-hostname l-worker-02
192.168.31.66 l-master
192.168.31.67 l-worker-01
192.168.31.68 l-worker-02
yum install -y update
yum install -y wget && yum install -y vim && yum install -y lsof && yum install -y net-tools
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
cat /etc/selinux/config
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
free -l -h
yum install -y ebtables socat ipset conntrack
yum install lvm2 python3 ntpdate -y && ntpdate ntp1.aliyun.com
mkdir /opt/kubesphere
cd /opt/kubesphere
export KKZONE=cn
curl -sfL https://get-kk.kubesphere.io | VERSION=v3.0.7 sh -
cat /opt/kubesphere/k8s-config.yaml
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
name: sample
spec:
hosts:
- {name: l-master, address: 192.168.31.66, internalAddress: 192.168.31.66, user: root, password: "root"}
- {name: l-worker-01, address: 192.168.31.67, internalAddress: 192.168.31.67, user: root, password: "root"}
- {name: l-worker-02, address: 192.168.31.68, internalAddress: 192.168.31.68, user: root, password: "root"}
roleGroups:
etcd:
- l-master
control-plane:
- l-master
worker:
- l-master
- l-worker-01
- l-worker-02
controlPlaneEndpoint:
## Internal loadbalancer for apiservers
# internalLoadbalancer: haproxy
domain: lb.kubesphere.local
address: ""
port: 6443
kubernetes:
version: v1.24.8
clusterName: cluster.local
autoRenewCerts: true
containerManager: docker
etcd:
type: kubekey
network:
plugin: calico
kubePodsCIDR: 10.233.64.0/18
kubeServiceCIDR: 10.233.0.0/18
## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
multusCNI:
enabled: false
registry:
privateRegistry: ""
namespaceOverride: ""
registryMirrors: []
insecureRegistries: []
addons: []
./kk create cluster -f k8s-config.yaml -y --container-manager containerd
kubectl get pod -A
kube-system calico-kube-controllers-676c86494f-5lr5w 1/1 Running 1 (50m ago) 4h35m
kube-system calico-node-c79sk 1/1 Running 1 (50m ago) 4h35m
kube-system calico-node-mkmdg 1/1 Running 1 (50m ago) 4h35m
kube-system calico-node-p55pb 1/1 Running 1 (50m ago) 4h35m
kube-system coredns-757cd945b-9crbl 1/1 Running 1 (50m ago) 4h35m
kube-system coredns-757cd945b-pw9qc 1/1 Running 1 (50m ago) 4h35m
kube-system kube-apiserver-b-master 1/1 Running 1 (50m ago) 4h35m
kube-system kube-controller-manager-b-master 1/1 Running 1 (50m ago) 4h35m
kube-system kube-proxy-2vnlb 1/1 Running 1 (50m ago) 4h35m
kube-system kube-proxy-5tv62 1/1 Running 1 (50m ago) 4h35m
kube-system kube-proxy-vckp4 1/1 Running 1 (50m ago) 4h35m
kube-system kube-scheduler-b-master 1/1 Running 1 (50m ago) 4h35m
kube-system nodelocaldns-5jwdf 1/1 Running 1 (50m ago) 4h35m
kube-system nodelocaldns-p99zp 1/1 Running 1 (50m ago) 4h35m
kube-system nodelocaldns-xbvfk 1/1 Running 1 (50m ago) 4h35m