Deploying Kubernetes
Deploying a Local Test Cluster with kind
Project: https://github.com/kubernetes-sigs/kind
- Install the kind command
brew install kind
- Generate the cluster configuration
cat <<EOF > kind.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
extraPortMappings:
- containerPort: 30000
hostPort: 30000
protocol: TCP
EOF
- Create the cluster
The kindest/node image version is the Kubernetes version.
kind create cluster --image kindest/node:v1.26.0 --name test-1.26 --config kind.yaml
- Inspect the cluster
kubectl get node
NAME STATUS ROLES AGE VERSION
test-1.26-control-plane Ready control-plane 49s v1.26.0
test-1.26-worker Ready <none> 28s v1.26.0
test-1.26-worker2 Ready <none> 15s v1.26.0
Deploying a Cluster with KubeKey
Project: https://github.com/kubesphere/kubekey
- Install KubeKey
curl -sfL https://get-kk.kubesphere.io | sh -
- Create the cluster
./kk create cluster --with-kubernetes v1.22.15
Or
./kk create config --with-kubernetes v1.22.15
./kk create cluster -f /config-sample.yaml