lesson-plan

📘 KUBERNETES: HỆ THỐNG ĐIỀU PHỐI CONTAINER

🎯 Mục tiêu tổng quát


🧑‍🏫 Bài 1: Giới thiệu về Kubernetes

Kubernetes là gì?

Lịch sử phát triển

Lợi ích của Kubernetes

  1. Tự động hóa triển khai: Triển khai ứng dụng một cách đáng tin cậy và nhất quán
  2. Self-healing: Tự động khởi động lại containers khi chúng bị lỗi
  3. Mở rộng tự động: Tự động mở rộng/thu hẹp số lượng container dựa trên tải
  4. Cân bằng tải: Phân phối lưu lượng mạng để đảm bảo triển khai ổn định
  5. Service discovery: Containers có thể tìm nhau thông qua DNS nội bộ

Các giải pháp thay thế cho Kubernetes

Use cases phổ biến


🧑‍🏫 Bài 2: Kiến trúc Kubernetes

Tổng quan kiến trúc

+-------------------------------------------------------+
|                  Kubernetes Cluster                   |
|                                                       |
|  +--------------------+       +--------------------+  |
|  |                    |       |                    |  |
|  |   Control Plane    |       |    Worker Nodes    |  |
|  |                    |       |                    |  |
|  |  +--------------+  |       |  +--------------+  |  |
|  |  | API Server   |  |       |  | Kubelet      |  |  |
|  |  +--------------+  |       |  +--------------+  |  |
|  |                    |       |                    |  |
|  |  +--------------+  |       |  +--------------+  |  |
|  |  | Scheduler    |  |       |  | Kube-proxy   |  |  |
|  |  +--------------+  |       |  +--------------+  |  |
|  |                    |       |                    |  |
|  |  +--------------+  |       |  +--------------+  |  |
|  |  | Controller   |  |       |  | Container    |  |  |
|  |  | Manager      |  |       |  | Runtime      |  |  |
|  |  +--------------+  |       |  +--------------+  |  |
|  |                    |       |                    |  |
|  |  +--------------+  |       |                    |  |
|  |  | etcd         |  |       |                    |  |
|  |  +--------------+  |       |                    |  |
|  +--------------------+       +--------------------+  |
+-------------------------------------------------------+

Control Plane Components

  1. API Server (kube-apiserver):

    • Điểm cuối HTTP API để tương tác với Kubernetes
    • Cổng chính để kiểm soát cluster
    • Xác thực và phân quyền tất cả các requests
  2. Scheduler (kube-scheduler):

    • Quan sát các pods mới chưa được gán node
    • Lựa chọn node phù hợp để chạy pod
    • Cân nhắc tài nguyên, ràng buộc, affinity, anti-affinity…
  3. Controller Manager (kube-controller-manager):

    • Chạy các quy trình controller
    • Điều khiển trạng thái của cluster
    • Chứa nhiều loại controllers: Node Controller, Replication Controller, Endpoint Controller,…
  4. etcd:

    • Cơ sở dữ liệu phân tán key-value
    • Lưu trữ tất cả dữ liệu của cluster
    • Đảm bảo tính nhất quán và sẵn sàng cao

Node Components

  1. Kubelet:

    • Agent chạy trên mỗi node
    • Đảm bảo containers chạy trong pod
    • Báo cáo tình trạng node lên control plane
  2. Kube-proxy:

    • Duy trì network rules trên node
    • Cho phép giao tiếp mạng đến pods từ trong hoặc ngoài cluster
    • Thực hiện chức năng load balancing cho services
  3. Container Runtime:

    • Phần mềm chịu trách nhiệm chạy containers
    • Ví dụ: Docker, containerd, CRI-O

Các Add-ons quan trọng

Mô hình hoạt động


🧑‍🏫 Bài 3: Cài đặt và Cấu hình Kubernetes

Các phương pháp cài đặt Kubernetes

  1. Minikube: Cho môi trường phát triển, chạy Kubernetes cục bộ
  2. kubeadm: Công cụ chính thức để cài đặt và cấu hình Kubernetes
  3. kind (Kubernetes IN Docker): Chạy Kubernetes trên Docker containers
  4. Dịch vụ quản lý: EKS (AWS), GKE (Google), AKS (Azure)

Cài đặt Minikube cho môi trường phát triển

# Cài đặt Minikube trên Linux
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/

# Khởi động cluster
minikube start

# Kiểm tra trạng thái
minikube status

Cài đặt kubectl - công cụ CLI để tương tác với Kubernetes

# Linux
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/

# Kiểm tra phiên bản
kubectl version --client

Cài đặt cluster với kubeadm

# 1. Cài đặt container runtime (ví dụ: Docker)
# 2. Cài đặt kubeadm, kubelet và kubectl
apt-get update
apt-get install -y apt-transport-https ca-certificates curl
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
add-apt-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
apt-get update
apt-get install -y kubelet kubeadm kubectl

# 3. Khởi tạo control plane
kubeadm init --pod-network-cidr=10.244.0.0/16

# 4. Cấu hình kubectl cho user
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

# 5. Cài đặt network plugin (ví dụ: Calico)
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml

# 6. Join worker nodes
# Sử dụng lệnh từ output của kubeadm init
kubeadm join <control-plane-ip>:<port> --token <token> --discovery-token-ca-cert-hash <hash>

Xác nhận cài đặt Kubernetes

# Kiểm tra trạng thái các nodes
kubectl get nodes

# Kiểm tra các pods trong namespace kube-system
kubectl get pods -n kube-system

# Kiểm tra phiên bản server và client
kubectl version

Cấu hình Kubernetes

  1. Contexts và Clusters:

    # Liệt kê contexts
    kubectl config get-contexts
    
    # Chuyển đổi context
    kubectl config use-context my-cluster
    
    # Xem cấu hình hiện tại
    kubectl config view
    
  2. Các file cấu hình quan trọng:

    • /etc/kubernetes/: Chứa cấu hình của cluster
    • ~/.kube/config: Cấu hình của kubectl
    • /etc/systemd/system/kubelet.service.d/: Cấu hình kubelet
  3. Roles và RBAC (Điều khiển truy cập dựa trên vai trò):

    # Tạo Role
    kubectl create role pod-reader --verb=get,list,watch --resource=pods
    
    # Tạo RoleBinding
    kubectl create rolebinding read-pods --role=pod-reader --user=jane
    
    # Kiểm tra quyền
    kubectl auth can-i list pods --as jane
    
  4. Namespace:

# Tạo namespace
kubectl create namespace my-namespace

# Liệt kê namespaces
kubectl get namespaces

# Thực hiện lệnh trong namespace cụ thể
kubectl get pods -n my-namespace

🧑‍🏫 Bài 4: Kubernetes Objects và Workloads

Kubernetes Objects là gì?

Các Objects phổ biến

  1. Pods: Đơn vị nhỏ nhất có thể deploy trong Kubernetes
  2. ReplicaSets: Đảm bảo số lượng Pods mong muốn
  3. Deployments: Quản lý ReplicaSets, hỗ trợ cập nhật và rollback
  4. Services: Định nghĩa cách truy cập vào Pods
  5. ConfigMaps và Secrets: Cấu hình và dữ liệu nhạy cảm
  6. Volumes: Lưu trữ dữ liệu cho Pods
  7. Namespaces: Phân chia cluster thành nhiều môi trường ảo

Pod

# pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
  labels:
    app: nginx
spec:
  containers:
    - name: nginx
      image: nginx:1.19
      ports:
        - containerPort: 80
    - name: log-sidecar
      image: busybox
      command: ["sh", "-c", "tail -f /var/log/nginx/access.log"]
      volumeMounts:
        - name: logs-volume
          mountPath: /var/log/nginx
  volumes:
    - name: logs-volume
      emptyDir: {}

Deployment

# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:1.19
          ports:
            - containerPort: 80

Service

# service.yaml
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: nginx
  ports:
    - port: 80
      targetPort: 80
  type: ClusterIP

DaemonSet

# daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: prometheus-node-exporter
spec:
  selector:
    matchLabels:
      app: node-exporter
  template:
    metadata:
      labels:
        app: node-exporter
    spec:
      containers:
        - name: node-exporter
          image: prom/node-exporter
          ports:
            - containerPort: 9100

StatefulSet

# statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mongodb
spec:
  serviceName: "mongodb"
  replicas: 3
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
        - name: mongodb
          image: mongo:4.4
          ports:
            - containerPort: 27017
          volumeMounts:
            - name: data
              mountPath: /data/db
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 1Gi

Job và CronJob

# cronjob.yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: backup-database
spec:
  schedule: "0 1 * * *" # Mỗi ngày lúc 1 giờ sáng
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: backup
              image: mybackup:1.0
              command: ["/bin/sh", "-c", "backup.sh"]
          restartPolicy: OnFailure

Quản lý Kubernetes Objects

# Tạo từ file YAML
kubectl apply -f deployment.yaml

# Cập nhật image
kubectl set image deployment/nginx-deployment nginx=nginx:1.20

# Rollback
kubectl rollout undo deployment/nginx-deployment

# Scale
kubectl scale deployment/nginx-deployment --replicas=5

# Xóa
kubectl delete deployment nginx-deployment

🧑‍🏫 Bài 5: Networking trong Kubernetes

Mô hình networking của Kubernetes

Các thành phần networking

  1. Pod Network: Giao tiếp giữa các pods
  2. Service Network: Truy cập đến các pods
  3. Cluster DNS: Service discovery
  4. Ingress: Routing HTTP/HTTPS từ bên ngoài vào cluster

Network Plugins (CNI)

Service ()

Các loại Services

  1. ClusterIP: (mặc định)
    • IP nội bộ trong cluster
    • Chỉ truy cập được từ bên trong cluster
    apiVersion: v1
    kind: Service
    metadata:
      name: backend-service
    spec:
      selector:
        app: backend
      ports:
        - port: 80
          targetPort: 8080
      type: ClusterIP
    
  2. NodePort:
    • Mở port cố định trên tất cả các nodes
    • Truy cập từ bên ngoài qua <NodeIP>:<NodePort>

      apiVersion: v1
      kind: Service
      metadata:
        name: web-service
      spec:
        selector:
          app: web
        ports:
          - port: 80
            targetPort: 8080
            nodePort: 30080 # Port 30000-32767
        type: NodePort
      
  3. LoadBalancer:
    • Sử dụng load balancer của cloud provider
    • Cung cấp IP công khai
    apiVersion: v1
    kind: Service
    metadata:
      name: web-service
    spec:
      selector:
        app: web
      ports:
        - port: 80
          targetPort: 8080
      type: LoadBalancer
    
  4. ExternalName:
    • CNAME record tới service bên ngoài
apiVersion: v1
kind: Service
metadata:
  name: external-db
spec:
  type: ExternalName
  externalName: database.example.com

Ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: app-ingress
spec:
  rules:
    - host: app.example.com
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: api-service
                port:
                  number: 80
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web-service
                port:
                  number: 80

Network Policies

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: db-policy
spec:
  podSelector:
    matchLabels:
      role: db
  policyTypes:
    - Ingress
  ingress:
    - from:
        - podSelector:
            matchLabels:
              role: backend
      ports:
        - protocol: TCP
          port: 5432

Debugging Network Issues

# Kiểm tra service
kubectl get svc my-service

# Debug DNS
kubectl run -i --tty --rm debug --image=busybox -- sh
# Trong container debug
nslookup my-service

# Kiểm tra endpoints
kubectl get endpoints my-service

# Xem network policies
kubectl get networkpolicies

🧑‍🏫 Bài 6: Storage và Persistence

Persistent Storage trong Kubernetes

Volumes

Các loại Volumes phổ biến

  1. emptyDir: Thư mục tạm thời, bị xóa khi Pod bị xóa
  2. hostPath: Sử dụng path trên Node
  3. PersistentVolume (PV): Storage độc lập với Pod
  4. ConfigMap/Secret as Volume: Mount cấu hình/bí mật

emptyDir

apiVersion: v1
kind: Pod
metadata:
  name: cache-pod
spec:
  containers:
    - name: app
      image: nginx
      volumeMounts:
        - name: cache-volume
          mountPath: /cache
  volumes:
    - name: cache-volume
      emptyDir: {}

hostPath

apiVersion: v1
kind: Pod
metadata:
  name: log-pod
spec:
  containers:
    - name: app
      image: nginx
      volumeMounts:
        - name: log-volume
          mountPath: /var/log/nginx
  volumes:
    - name: log-volume
      hostPath:
        path: /var/log/pods
        type: DirectoryOrCreate

Persistent Storage Architecture

  1. PersistentVolume (PV): Tài nguyên storage thực tế
  2. PersistentVolumeClaim (PVC): Yêu cầu sử dụng storage
  3. StorageClass: Định nghĩa loại storage và provisioner

PersistentVolume (PV)

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-storage
spec:
  capacity:
    storage: 10Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: standard
  hostPath:
    path: /data/pv0001

PersistentVolumeClaim (PVC)

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: db-storage-claim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: standard

Sử dụng PVC trong Pod

apiVersion: v1
kind: Pod
metadata:
  name: db-pod
spec:
  containers:
    - name: db
      image: postgres:13
      volumeMounts:
        - name: db-data
          mountPath: /var/lib/postgresql/data
  volumes:
    - name: db-data
      persistentVolumeClaim:
        claimName: db-storage-claim

StorageClass

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
  fsType: ext4
reclaimPolicy: Delete
allowVolumeExpansion: true

Volume Snapshots

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: db-snapshot
spec:
  volumeSnapshotClassName: csi-hostpath-snapclass
  source:
    persistentVolumeClaimName: db-storage-claim

StatefulSet với Storage

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: postgres
spec:
  serviceName: "postgres"
  replicas: 3
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
        - name: postgres
          image: postgres:13
          volumeMounts:
            - name: data
              mountPath: /var/lib/postgresql/data
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ["ReadWriteOnce"]
        storageClassName: "standard"
        resources:
          requests:
            storage: 10Gi

Best Practices

  1. Sử dụng PVs và PVCs thay vì volumes trực tiếp
  2. Định nghĩa StorageClass phù hợp cho từng loại workload
  3. Cấu hình backup và disaster recovery
  4. Sử dụng StatefulSets với volumeClaimTemplates cho ứng dụng stateful
  5. Giám sát dung lượng và hiệu suất storage

🧑‍🏫 Bài 7: ConfigMaps và Secrets

ConfigMaps

Tạo ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  database.host: "mysql"
  database.port: "3306"
  ui.theme: "dark"
  config.json: |
    {
      "log_level": "info",
      "debug": false,
      "features": {
        "billing": true,
        "notifications": false
      }
    }

Sử dụng ConfigMap

  1. Biến môi trường:

    apiVersion: v1
    kind: Pod
    metadata:
      name: web
    spec:
      containers:
        - name: web
          image: nginx
          env:
            - name: DB_HOST
              valueFrom:
                configMapKeyRef:
                  name: app-config
                  key: database.host
            - name: DB_PORT
              valueFrom:
                configMapKeyRef:
                  name: app-config
                  key: database.port
    
  2. envFrom - tất cả keys làm biến môi trường:

    apiVersion: v1
    kind: Pod
    metadata:
      name: web
    spec:
      containers:
        - name: web
          image: nginx
          envFrom:
            - configMapRef:
                name: app-config
    
  3. Volume mount:

    apiVersion: v1
    kind: Pod
    metadata:
      name: web
    spec:
      containers:
        - name: web
          image: nginx
          volumeMounts:
            - name: config-volume
              mountPath: /etc/config
      volumes:
        - name: config-volume
          configMap:
            name: app-config
    

Secrets

Tạo Secret

apiVersion: v1
kind: Secret
metadata:
  name: db-credentials
type: Opaque
data:
  # Giá trị phải ở dạng base64
  username: YWRtaW4= # admin
  password: c2VjcmV0 # secret

Tạo Secret từ command line

# Tạo từ file
kubectl create secret generic ssl-cert --from-file=cert.pem --from-file=key.pem

# Tạo từ literal
kubectl create secret generic api-keys --from-literal=api_key=123456 --from-literal=secret_key=abcdef

Sử dụng Secret

  1. Biến môi trường:

    apiVersion: v1
    kind: Pod
    metadata:
      name: db-client
    spec:
      containers:
        - name: app
          image: myapp
          env:
            - name: DB_USERNAME
              valueFrom:
                secretKeyRef:
                  name: db-credentials
                  key: username
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: db-credentials
                  key: password
    
  2. Volume mount:

    apiVersion: v1
    kind: Pod
    metadata:
      name: db-client
    spec:
      containers:
        - name: app
          image: myapp
          volumeMounts:
            - name: secret-volume
              mountPath: /etc/secrets
              readOnly: true
      volumes:
        - name: secret-volume
          secret:
            secretName: db-credentials
    

Secret Types

Docker Registry Secret

apiVersion: v1
kind: Secret
metadata:
  name: docker-registry-cred
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: <base64-encoded-docker-config>

Sử dụng Docker Registry Secret

apiVersion: v1
kind: Pod
metadata:
  name: private-app
spec:
  containers:
    - name: app
      image: myprivate/repo:tag
  imagePullSecrets:
    - name: docker-registry-cred

Best Practices (Bí quyết bảo mật Secrets)

  1. Không lưu trữ Secrets trong git repositories
  2. Hạn chế access đến Secrets bằng RBAC
  3. Sử dụng solutions bên ngoài như Vault cho quản lý bí mật
  4. Thiết lập network policies cho Pods với Secrets
  5. Encrypt etcd để bảo vệ Secrets khi lưu trữ

🧑‍🏫 Bài 8: Helm - Package Manager cho Kubernetes

Helm là gì?

Khái niệm cơ bản của Helm

  1. Chart: Package của Helm, chứa tất cả tài nguyên Kubernetes
  2. Repository: Nơi lưu trữ và chia sẻ charts
  3. Release: Instance của chart đã được deploy

Cài đặt Helm

# Linux
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

# macOS
brew install helm

# Windows
choco install kubernetes-helm

Cấu trúc của một Helm Chart

mychart/
  Chart.yaml          # Thông tin về chart
  values.yaml         # Giá trị mặc định cho templates
  templates/          # Thư mục chứa templates
    deployment.yaml
    service.yaml
    ingress.yaml
    _helpers.tpl      # Partial templates
  charts/             # Charts phụ thuộc
  templates/NOTES.txt # Notes hiển thị sau khi cài đặt

Chart.yaml

apiVersion: v2
name: myapp
version: 1.0.0
description: My Application Helm Chart
type: application
appVersion: "1.0.0"
dependencies:
  - name: mysql
    version: 8.8.5
    repository: https://charts.bitnami.com/bitnami

values.yaml

# Default values
replicaCount: 2

image:
  repository: nginx
  tag: 1.19.0
  pullPolicy: IfNotPresent

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: false
  hosts:
    - host: chart-example.local
      paths: ["/"]

Template file (deployment.yaml)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: { { include "myapp.fullname" . } }
  labels: { { - include "myapp.labels" . | nindent 4 } }
spec:
  replicas: { { .Values.replicaCount } }
  selector:
    matchLabels: { { - include "myapp.selectorLabels" . | nindent 6 } }
  template:
    metadata:
      labels: { { - include "myapp.selectorLabels" . | nindent 8 } }
    spec:
      containers:
        - name: { { .Chart.Name } }
          image: ":"
          imagePullPolicy: { { .Values.image.pullPolicy } }
          ports:
            - name: http
              containerPort: 80
              protocol: TCP

Helm Commands

# Tìm kiếm charts
helm search hub wordpress

# Thêm repository
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

# Cài đặt chart
helm install my-release bitnami/wordpress

# Xem các releases đã cài đặt
helm list

# Kiểm tra trạng thái
helm status my-release

# Nâng cấp release
helm upgrade my-release bitnami/wordpress --values=custom-values.yaml

# Rollback
helm rollback my-release 1

# Gỡ cài đặt
helm uninstall my-release

Tạo Helm Chart mới

# Tạo chart mới
helm create mychart

# Kiểm tra cấu trúc chart
helm lint mychart

# Đóng gói chart
helm package mychart

# Cài đặt chart local
helm install my-app ./mychart

# Cài đặt với custom values
helm install my-app ./mychart -f my-values.yaml

Helm Template Functions

# Quote
app: 

# Default
replicas: 

# Indent
data:

# toYaml
labels:

# if/else
# ingress configuration

Chart Hooks

apiVersion: batch/v1
kind: Job
metadata:
  name: -db-init
  annotations:
    "helm.sh/hook": post-install
    "helm.sh/hook-weight": "0"
    "helm.sh/hook-delete-policy": hook-succeeded
spec:
  template:
    spec:
      containers:
      - name: db-init
        image: postgres
        command: ["psql", "--command", "CREATE DATABASE app"]
      restartPolicy: Never

Best Practices (Bí quyết sử dụng Helm)

  1. Sử dụng Helm repo để quản lý charts
  2. Phân chia values.yaml theo các thành phần logic
  3. Đặt thực nghiệm với templates trong values.yaml
  4. Sử dụng helpers để tái sử dụng code
  5. Thêm NOTES.txt để hướng dẫn người dùng

🧪 BÀI TẬP LỚN CUỐI PHẦN: Xây dựng và triển khai ứng dụng microservices trên Kubernetes

Mô tả bài toán

Xây dựng hệ thống microservices hoàn chỉnh và triển khai trên Kubernetes cluster, với các thành phần:

Yêu cầu

  1. Xây dựng Docker images cho từng microservice
  2. Tạo các Kubernetes manifests cho tất cả các components
  3. Cấu hình Services, Ingress để quản lý traffic
  4. Thiết lập PersistentVolumes cho database
  5. Cấu hình ConfigMaps và Secrets
  6. Triển khai Prometheus và Grafana để monitoring
  7. Cấu hình Horizontal Pod Autoscaler
  8. Tạo Helm chart cho toàn bộ ứng dụng
  9. Viết scripts cho CI/CD pipeline

Kết quả đạt được


⬅️ Trở lại: DEVOPS/Docker2.md | 🏠 Home | ➡️ Tiếp theo: Tổng kết