K8s easy và dễ hiểu

🧭 Sơ đồ minh họa Kubernetes đơn giản

+------------------------------+
|        Kubernetes Cluster    |
|                              |
|  +--------+   +-----------+  |
|  | Node 1 |   |  Node 2   |  |
|  +--------+   +-----------+  |
|     |               |        |
|  +-------+      +-------+    |
|  |  Pod  |      |  Pod  |    |
|  | nginx |      | redis |    |
|  +-------+      +-------+    |
|                              |
+------------------------------+

📄 YAML chạy 1 Pod đơn giản (nginx)

Tạo file tên nginx-pod.yaml với nội dung:

apiVersion: v1
kind: Pod
metadata:
  name: nginx-demo
spec:
  containers:
    - name: nginx
      image: nginx:1.25
      ports:
        - containerPort: 80

🚀 Chạy thử với Minikube


🌐 Truy cập nginx từ máy bạn

Expose port tạm thời để duyệt trình duyệt:

→ Truy cập tại: http://localhost:8080arrow-up-right

Last updated