Logo Kubernetes Containers

Kubernetes Containers

Cộng đồng
d-padmanabhan
kubernetes-containers

Kubernetes, Helm, and Argo CD best practices for container orchestration. Covers deployments, services, RBAC, resource management, Helm charts, GitOps synchronization, Podtrace runtime debugging, and production patterns. Use when working with Kubernetes manifests, Helm charts, Argo CD sync policies, kubectl commands, Podtrace, or when asking about container orchestration, pod configuration, GitOps, or cluster management.

Tổng quan

Nhà phát hànhd-padmanabhan
Kho mãagent-engineering-handbook
Tên kỹ năngkubernetes-containers
Sao
20
Bản fork
3
Tệp đi kèm
5
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được d-padmanabhan công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Kubernetes Containers trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/kubernetes-containers
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook.git /tmp/agent-engineering-handbook
mkdir -p .claude/skills
cp -r /tmp/agent-engineering-handbook/skills/kubernetes-containers .claude/skills/kubernetes-containers
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Kubernetes Containers trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Kubernetes Containers ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Kubernetes Containers với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Kubernetes & Containers

Core Concepts

  • Pods: Smallest deployable units
  • Deployments: Declarative pod management
  • Services: Network abstraction
  • ConfigMaps/Secrets: Configuration injection
  • RBAC: Access control

Essential Commands

bash
# Context & Namespace
kubectl config get-contexts
kubectl config use-context prod
kubectl get pods -n my-namespace

# Pod Operations
kubectl get pods -o wide
kubectl describe pod <pod-name>
kubectl logs <pod-name> -f --tail=100
kubectl exec -it <pod-name> -- /bin/sh

# Apply & Delete
kubectl apply -f manifest.yaml
kubectl delete -f manifest.yaml
kubectl rollout restart deployment/<name>

# Kustomize
kubectl kustomize overlays/dev
kubectl diff -k overlays/dev
kubectl apply -k overlays/dev

# Debugging
kubectl get events --sort-by='.lastTimestamp'
kubectl top pods
kubectl port-forward svc/my-service 8080:80

# Podtrace runtime diagnostics
podtrace -n my-namespace my-pod
podtrace -n my-namespace my-pod --diagnose 20s
podtrace -n my-namespace my-pod --metrics

Podtrace

Use podtrace for on-demand eBPF diagnostics when kubectl describe, logs, and standard metrics do not explain pod behavior.

  • Prefer short runs such as --diagnose 20s
  • Treat captured application-layer fields as sensitive
  • See Podtrace reference (${HANDBOOK_ROOT}/skills/kubernetes-containers/references/podtrace.md) for workflow, prerequisites, and command examples

Deployment Pattern

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
  labels:
    app: my-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      serviceAccountName: app-sa
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        fsGroup: 1000
      containers:
        - name: app
          image: myapp:1.0.0
          ports:
            - containerPort: 8080
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 500m
              memory: 512Mi
          livenessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /ready
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 5
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true

Readiness and Liveness Probes

Readiness and liveness probes are health checks used by Kubernetes to manage the lifecycle and traffic flow of your containers.

  • Liveness Probe: Determines if a container is still running correctly. If it fails, Kubernetes kills the container and starts a new one based on the restart policy
  • Readiness Probe: Determines if a container is ready to start accepting network traffic. If it fails, the Pod's IP address is removed from the Endpoints of all Services, ensuring no requests are sent to an unready application

Key Implementation Methods

Both probes can be configured using three main mechanisms:

  • HTTP GET: Kubernetes sends an HTTP request to a specific endpoint (for example /healthz). A status code between 200-399 indicates success
  • TCP Socket: Kubernetes attempts to open a TCP connection to a specified port. If the connection is established, the probe is successful
  • Exec Action: Kubernetes executes a command inside the container. If the command returns an exit code of 0, the probe is successful

EKS Traffic Routing (ALB/NLB and VPC Lattice - Pod IP Targets)

On EKS, AWS controllers can route to workloads using either node targets or pod IP targets.

AWS Load Balancer Controller (ALB/NLB)

  • Instance targets: register worker nodes in the AWS target group. Traffic reaches a node (often via NodePort) and is forwarded to a pod by kube-proxy
  • IP targets: register pod IPs in the AWS target group. Traffic routes directly to pods, avoiding the NodePort + kube-proxy hop

Common configuration knobs:

  • ALB Ingress: alb.ingress.kubernetes.io/target-type: ip (or instance)
  • NLB Service: service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"

Amazon VPC Lattice Gateway API Controller

When using VPC Lattice with Kubernetes (Gateway API), the controller can register pod IPs into VPC Lattice target groups and route requests directly to pods.

  • Pod registration: pod IPs are registered as targets (no node-level hop)
  • Readiness gates: pods can be gated on successful registration and target health to reduce rollout 5XX

Service Pattern

yaml
apiVersion: v1
kind: Service
metadata:
  name: app
spec:
  type: ClusterIP
  selector:
    app: my-app
  ports:
    - port: 80
      targetPort: 8080

Resource Management

ResourceRequestLimit
CPUGuaranteed minimumThrottled above
MemoryGuaranteed minimumOOMKilled above

Always set both requests and limits:

yaml
resources:
  requests:
    cpu: 100m      # 0.1 CPU
    memory: 128Mi
  limits:
    cpu: 500m      # 0.5 CPU
    memory: 512Mi

Security Best Practices

yaml
# Pod Security Context
securityContext:
  runAsNonRoot: true
  runAsUser: 1000
  fsGroup: 1000

# Container Security Context
securityContext:
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop:
      - ALL

Privileged Pods and Host Namespaces

For normal application workloads, reject:

yaml
spec:
  hostPID: true
  hostIPC: true
  hostNetwork: true
  containers:
    - name: app
      securityContext:
        privileged: true

Why: privileged: true grants broad kernel/device access, and host namespaces let the pod see or share node-level process, IPC, or network state. Together, these settings are close to node-level access from inside the pod.

Use the restricted baseline instead:

yaml
securityContext:
  runAsNonRoot: true
  seccompProfile:
    type: RuntimeDefault
containers:
  - name: app
    securityContext:
      privileged: false
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
      capabilities:
        drop:
          - ALL

Exceptions are narrow: CNI / CSI components, eBPF observability, runtime security agents, node problem detectors, and short-lived break-glass diagnostics. Require an owner, reason, dedicated namespace, scoped service account/RBAC, duration, and review date before allowing an exception.

Argo CD Synchronization Workflow

The mandatory authorization, preview, automation, and recovery gates live in the Kubernetes rule (${HANDBOOK_ROOT}/rules/450-kubernetes.mdc#argo-cd-synchronization). Follow the Argo CD synchronization runbook (${HANDBOOK_ROOT}/skills/kubernetes-containers/references/argocd-sync.md) for read-only preflight, approval evidence, exact-revision sync, bounded verification, and Git-based recovery.

Kubernetes Operators

Use the Kubernetes operator development skill (${HANDBOOK_ROOT}/skills/kubernetes-operator-development/SKILL.md) for CRD API design, reconciliation, status conditions, finalizers, admission and conversion webhooks, external-provider ownership, controller-runtime cache behavior, and operator testing. Keep this skill focused on workload, packaging, GitOps, and cluster operations.

Helm Quick Reference

bash
# Install/Upgrade
helm install my-app ./chart
helm upgrade my-app ./chart
helm upgrade --install my-app ./chart

# Values
helm install my-app ./chart -f values-prod.yaml
helm install my-app ./chart --set image.tag=1.0.0

# Debug
helm template my-app ./chart
helm lint ./chart
helm diff upgrade my-app ./chart

Scheduling and Placement

Taints repel Pods; tolerations permit placement but do not select a node. Use node affinity for dedicated pools, pod affinity or anti-affinity for relationships between workloads, and topology spread constraints for balanced replicas across failure domains. Prefer soft constraints unless minimum and degraded cluster capacity can satisfy hard constraints.

Follow the scheduling patterns and examples in the Kubernetes patterns reference (${HANDBOOK_ROOT}/skills/kubernetes-containers/references/kubernetes-patterns.md#pod-placement-and-scheduling).

Detailed References

  • Kubernetes Patterns: See Kubernetes patterns (${HANDBOOK_ROOT}/skills/kubernetes-containers/references/kubernetes-patterns.md)
  • Helm Charts: See Helm charts (${HANDBOOK_ROOT}/skills/kubernetes-containers/references/helm-charts.md)
  • Podtrace: See Podtrace reference (${HANDBOOK_ROOT}/skills/kubernetes-containers/references/podtrace.md) for runtime diagnostics in Kubernetes

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Kubernetes Containers làm được gì?

Kubernetes, Helm, and Argo CD best practices for container orchestration. Covers deployments, services, RBAC, resource management, Helm charts, GitOps synchronization, Podtrace runtime debugging, and production patterns. Use when working with Kubernetes manifests, Helm charts, Argo CD sync policies, kubectl commands, Podtrace, or when asking about container orchestration, pod configuration, GitOps, or cluster management.

Vì sao nên dùng Kubernetes Containers trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Kubernetes Containers là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Kubernetes Containers trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/kubernetes-containers. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Kubernetes Containers?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Kubernetes Containers với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Kubernetes Containers với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Kubernetes Containers có miễn phí không?

Có. Kỹ năng này được d-padmanabhan phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇