Back to articles
DevOps & Systems

Guide to Configuring KubeKey for Fast Kubernetes Setup on 3 Cheap VPS Servers from Different Providers

With just 3 inexpensive VPS servers from different providers, you can set up a high-performance, fully functional Kubernetes cluster ready for application deployment. This guide...

DPTCloud Engineering4 min read
Guide to Configuring KubeKey for Fast Kubernetes Setup on 3 Cheap VPS Servers from Different Providers

Image credit: WildPixar · Pixabay Content License

With just 3 inexpensive VPS servers from different providers, you can set up a high-performance, fully functional Kubernetes cluster ready for application deployment. This guide uses KubeKey—the Kubernetes configuration and deployment tool from Kubespray—to automate the entire setup process, saving time and minimizing configuration errors. The guide covers preparation, installation, network configuration, authentication, and cluster validation.

Requirements and Preparation

To deploy a Kubernetes cluster using KubeKey on 3 VPS servers from different providers, you need the following:

  • 3 VPS servers (minimum 2GB RAM, 2 vCPU, 20GB SSD) from at least 2 different providers (e.g., VPS from provider A, B, C).
  • Public domain name or IP for each VPS (optional: use Cloudflare or custom DNS).
  • SSH access with root or sudo privileges.
  • Stable internet connection.

It's recommended to use NVMe VPS for improved I/O performance, especially when running high-load applications. Learn more about VPS solutions at NVMe Cloud VPS for Docker, Nginx & Databases.

Installing KubeKey

On each VPS, run the following commands to install KubeKey:

curl -sfL https://get-kubekey.io | sh

After installation, verify the KubeKey version:

kubekey version

Ensure the installed version is 2.0 or newer to support modern Kubernetes features.

Setting Up the Kubernetes Cluster Configuration

Create a configuration file named config.yaml to define the Kubernetes cluster. Below is a basic configuration for 3 nodes (1 master, 2 workers):

apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
  name: kubekey-cluster
spec:
  hosts:
  - {name: node1, address: 192.168.1.10, internalAddress: 192.168.1.10, user: root, password: "your-password"}
  - {name: node2, address: 192.168.1.11, internalAddress: 192.168.1.11, user: root, password: "your-password"}
  - {name: node3, address: 192.168.1.12, internalAddress: 192.168.1.12, user: root, password: "your-password"}
  roleGroups:
    etcd:
    - node1
    master:
    - node1
    worker:
    - node2
    - node3
  controlPlaneEndpoint:
    domain: k8s.example.com
    address: ""
    port: 6443
  kubernetes:
    version: v1.28.0
    imageRepo: k8s.gcr.io
    clusterName: kubekey-cluster

Replace address with the public IP or domain of each VPS. If you don't have a domain, use the public IP. The controlPlaneEndpoint configuration allows external access to the API server.

Deploying the Kubernetes Cluster

Deploy the cluster using the following command:

kubekey install cluster -f config.yaml

The installation process takes 10–30 minutes depending on network speed and VPS performance. KubeKey automatically installs components like kubelet, kubeadm, container runtime (containerd), and other required services.

Testing and Validation

After deployment, check the cluster status with these commands:

kubectl get nodes
kubectl get pods -n kube-system

Ensure all nodes are in the Ready state and system pods (kube-proxy, coredns, etc.) are running normally.

To test external access, deploy a simple application like Nginx:

kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=NodePort

Then access the IP of any node and the assigned NodePort to verify functionality.

Troubleshooting and Optimization

If issues arise, check logs using:

kubectl logs -n kube-system <pod-name>

Common issues include network, firewall, or insufficient resources. Ensure ports 6443, 10250, and 30000–32767 are open on all VPS servers.

For performance improvements, install CSI drivers like Longhorn or Rook for storage management, or use an Ingress controller like Nginx for HTTP access control.

For more information on optimizing VPS costs, read Hidden Costs of Running VPS: Bandwidth, IOPS, and What Providers Don’t Tell You.

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478