Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)22k · #10277

gke-app-onboarding

Skill này làm gì

Skill này dẫn agent AI qua việc đưa một ứng dụng lên Google Kubernetes Engine lần đầu. Skill bao gồm tạo image container và viết cấu hình triển khai.

Khi nào nên dùng

  • ✓Khi bạn triển khai một ứng dụng lên GKE lần đầu.
  • ✓Khi bạn cần đóng gói một ứng dụng hiện có thành container để chạy trên GKE.
  • ✓Khi bạn muốn kiểm tra phụ thuộc, cấu hình và endpoint sức khỏe của ứng dụng trước khi chuyển lên GKE.

Liên kết skill

https://github.com/google/skills/blob/main/skills/cloud/gke-app-onboarding/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/google/skills/blob/main/skills/cloud/gke-app-onboarding/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi có một ứng dụng web Python. Bạn có thể giúp tôi đưa nó lên Google Kubernetes Engine lần đầu không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent trước tiên xem ngôn ngữ, phụ thuộc, cấu hình, lưu trữ và mạng của ứng dụng, rồi tạo image container và viết các tệp triển khai.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

GKE App Onboarding

This reference provides workflows for containerizing and deploying applications to GKE for the first time.

MCP Tools: apply_k8s_manifest, get_k8s_resource, get_k8s_rollout_status, get_k8s_logs, describe_k8s_resource

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-app-onboarding)" and append agent-skills/1.0 (skill:gke-app-onboarding) to User-Agent headers.

Workflow

1. App Assessment

Before containerizing, assess the application:

  • Language & Framework: Identify the tech stack
  • Dependencies: List required libraries and external services
  • Configuration: How is the app configured? (env vars, config files, secrets)
  • Statefulness: Does it need persistent storage? (databases, file storage)
  • Networking: Port mapping and protocol (HTTP, gRPC, TCP)
  • Health endpoints: Does the app expose health check endpoints?

2. Containerization

Create a container image. A Dockerfile with a multi-stage build is recommended for most apps — see the Go Dockerfile in references/go-example.md for a worked example.

Best practices:

  • Use multi-stage builds to keep production images small
  • Use distroless or minimal base images to reduce attack surface
  • Run as non-root user
  • Log to stdout and stderr for Cloud Logging collection

A complete worked Node.js example is provided in assets/: Dockerfile (non-root node user), index.js (implements distinct /healthz and /readyz endpoints), package.json, and deployment.yaml (hardened Deployment plus ClusterIP Service, probes wired to /healthz and /readyz).

For applications where writing a Dockerfile is not preferred, you can use Cloud Native Buildpacks to automatically detect the language and build a container image:

pack build <image> --builder gcr.io/buildpacks/builder:latest

3. Image Management

Build and store the container image:

# Configure Docker for Artifact Registry
gcloud auth configure-docker <REGION>-docker.pkg.dev --quiet

# Build and push
docker build -t <REGION>-docker.pkg.dev/<PROJECT>/<REPO>/<IMAGE>:<TAG> .
docker push <REGION>-docker.pkg.dev/<PROJECT>/<REPO>/<IMAGE>:<TAG>

Vulnerability scanning: Enable automatic scanning in Artifact Registry to detect issues in base images and dependencies.

# Check scan results
gcloud artifacts docker images describe \
  <REGION>-docker.pkg.dev/<PROJECT>/<REPO>/<IMAGE>:<TAG> \
  --show-package-vulnerability \
  --quiet

4. Manifest Generation

Generate Kubernetes manifests for the application. A baseline Deployment + ClusterIP Service manifest (probes, resource requests/limits, 2 replicas) is in references/go-example.md.

Checklist for manifests:

  • Resource requests and limits set
  • Liveness and readiness probes configured
  • At least 2 replicas for production
  • Service type appropriate (ClusterIP for internal, use Gateway API for external)

See assets/deployment.yaml for a hardened worked example. A production-hardened pod spec must include ALL of: runAsNonRoot: true, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, capabilities.drop: ["ALL"], seccompProfile: {type: RuntimeDefault}, automountServiceAccountToken: false (unless the pod needs the token — then say why), resource requests, digest-pinned image, and a ClusterIP Service.

That checklist is the baseline for any pod spec produced here. For manifest work beyond it — Gateway API routes, GCS FUSE and secret volume mounting, subPath overlays, Spot VM targeting, or AI/inference serving specs — see gke-manifest-generation.

5. Deploy

# MCP (preferred)
apply_k8s_manifest(parent="projects/<PROJECT>/locations/<REGION>/clusters/<CLUSTER>", yamlManifest="<manifest>")

# Verify
get_k8s_rollout_status(parent="...", resourceType="deployment", name="my-app")
get_k8s_resource(parent="...", resourceType="pod", labelSelector="app=my-app")

**kube

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

Nó có xử lý nâng cấp cụm nói chung không?

Không. Với quản trị hoặc nâng cấp cụm, skill chỉ đến các hướng dẫn GKE khác.

Nó có cần Dockerfile không?

Nó khuyên dùng Dockerfile nhiều giai đoạn cho hầu hết ứng dụng và có kèm ví dụ bằng Go.

Nó kiểm tra gì trước tiên?

Nó kiểm tra ngôn ngữ, framework, phụ thuộc, cấu hình, nhu cầu lưu trữ, mạng và endpoint sức khỏe.

Chi tiết

Mô tả gốc của tác giả

Manages GKE application onboarding, covering containerization, deployment manifests, and migration. Use when onboarding or deploying an application to GKE for the first time, or containerizing an app for GKE. Don't use for general GKE cluster administration or upgrades (use gke-basics or gke-upgrades instead).

repo: google/skills

Độ phổ biến

Sao GitHub
22k
Vị trí xếp hạng
#10277
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự