Beyond Docker: Cloud Platforms & K8s for Multi-Server Container Clusters
This article explains cloud platforms as server supermarkets, categorizes cloud products, demonstrates how cloud platforms, containers, and Kubernetes collaborate for multi-server container clusters, and provides essential kubectl commands for cluster management, deployment, scaling, debugging, and configuration.
Introduction
The previous article covered Docker containerization on a single server. Real-world projects, however, require multiple servers for applications, databases, and caches, plus the ability to scale during traffic peaks. This article advances to cloud platforms and Kubernetes (K8s) to manage multi-server container clusters, achieving "one entry point to manage all" without per-server SSH.
1. What Is a Cloud Platform? The "Server Supermarket"
Cloud platforms (e.g., Alibaba Cloud, Tencent Cloud, AWS) are internet companies' pre-built "server supermarkets." They operate massive data centers worldwide, slice hardware resources into services — virtual servers, databases, storage — sold on-demand with pay-as-you-go pricing. You avoid purchasing physical hardware, renting data centers, or maintaining equipment.
2. Cloud Platform Product Categories
All major cloud providers organize products around core project needs. The article includes an illustration (see image below) that groups services into compute, storage, networking, databases, security, and more. The key takeaway: whatever you need — servers, databases, network, security — the "supermarket" has it, enabling startups to build highly available architectures without reinventing the wheel.
3. Cloud Platform + Containers + K8s: The Golden Partnership
Cloud Platform: Elastic Hardware Foundation
The cloud platform acts as an on-demand server butler. Normal traffic: two 6C16G cloud servers running 10 containers. Traffic peak (e.g., Double 11): scale to eight servers instantly, no hardware procurement wait.
Kubernetes: The Container Commander
When containers spread across multiple cloud servers, Docker alone cannot manage them. K8s provides:
Auto-scheduling: distributes requests across containers on different servers, preventing overload and single points of failure.
Self-healing: restarts failed containers or replaces containers on a downed server automatically.
One-command scaling: kubectl scale --replicas=10 deployment/my-app expands from 5 to 10 pods instantly.
Cloud integration: K8s calls cloud elastic scaling and load balancing services so that server count adjusts automatically with container scaling.
Simplified Architecture
User → Cloud CDN → Cloud Load Balancer (SLB) → K8s Cluster (multiple cloud servers) → Containers (app/db/cache) → Cloud Storage (OSS/NAS)In short: cloud platform supplies hardware, containers maximize resource efficiency, K8s orchestrates containers — together reducing cost and operational overhead.
4. Essential kubectl Commands (Curated for Beginners)
Basic Operations: Inspect Cluster & Resources
# Check cluster status
kubectl cluster-info
# List nodes (cloud servers in cluster)
kubectl get nodes
kubectl get nodes -o wide # detailed info (IP, status, OS version)
# Core resources (most used)
kubectl get pods # all pods (container instances)
kubectl get deployments # deployments (pod controllers)
kubectl get services # services (external access endpoints)
kubectl get namespaces # namespaces (resource isolation)
# Resource details (troubleshooting)
kubectl describe pod my-nginx-pod # pod events, error causes
kubectl describe deployment my-app # deployment detailsCore Operations: Deploy & Manage Applications
# Deploy from image
kubectl create deployment my-nginx --image=nginx:1.25.3
# Expose service
kubectl expose deployment my-nginx --port=80 --type=NodePort # node port
kubectl expose deployment my-nginx --port=80 --type=LoadBalancer # cloud load balancer
# Scale
kubectl scale --replicas=10 deployment/my-nginx # scale to 10 pods
kubectl scale --replicas=2 deployment/my-nginx # scale down to 2
# Update image
kubectl set image deployment/my-nginx nginx=nginx:1.26.0
# Delete resources
kubectl delete pod my-nginx-pod # deletes single pod (recreated by deployment)
kubectl delete deployment my-nginx # deletes deployment and all its pods
kubectl delete service my-nginx # deletes serviceDebugging: Enter Pods & View Logs
# Enter pod (like docker exec)
kubectl exec -it my-nginx-pod -- /bin/bash
# View logs
kubectl logs -f my-nginx-pod # real-time
kubectl logs -f --tail 100 my-nginx-pod # last 100 lines + follow
kubectl logs my-nginx-pod | grep "error" # filter errors
# Copy files
kubectl cp my-nginx-pod:/var/log/nginx/access.log /tmp/ # pod → host
kubectl cp /tmp/my.conf my-nginx-pod:/etc/nginx/conf.d/ # host → podAdvanced: Config & Operations
# Resource usage
kubectl top pod my-nginx-pod
# Edit resource config (temporary)
kubectl edit deployment my-nginx # modify replicas, image, etc.
# Cluster events
kubectl get eventsCommand Tips
Core verbs: kubectl get (view), kubectl create (create), kubectl scale (scale), kubectl logs (logs) cover 80% of scenarios.
Forgot a command? Use kubectl --help or kubectl <resource> --help (e.g., kubectl get --help).
In production, avoid imperative kubectl create; write YAML manifests and apply with kubectl apply -f xxx.yaml for version control and reproducibility.
Conclusion
The core logic is division of labor: cloud platform manages hardware, K8s manages containers, containerization maximizes efficiency. Beginners should first memorize cloud product categories, then practice the core kubectl commands (deploy, inspect pods, scale). Spin up a mini cluster on a cloud server, run an Nginx deployment, and experience multi-server container management firsthand. K8s and cloud platforms are now fundamental skills for backend and operations roles. Future articles will cover K8s YAML configuration, persistent storage, rolling updates, and cloud cost optimization.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Engineer Tang's Implementation Study Notes
Old Tang | Pseudo-full-stack tech player: writes code without going bald, manages projects without going crazy, delivers without staying up late. No formal tutorials here, only a "slacking-off" practical manual that cures system pain points. Focuses on Shell, SQL, Java, and delivery, turning complexity into simplicity and making efficiency fun.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
