Manages GKE application onboarding, covering containerization, deployment manifests, and migration. Use when onboarding or deploying an application to GKE for t
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-gke-app-onboarding-f8797d4fe06e ,按照其中的说明把「gke-app-onboarding」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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
Before containerizing, assess the application:
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:
stdout and stderr for Cloud Logging collectionA 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
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
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:
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.
# 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")
kubectl fallback:
kubectl apply -f manifests/
kubectl rollout status deployment/my-app
kubectl get pods -l app=my-app
For every production application onboarding to GKE:
runAsNonRoot: true), lockfile
install, minimal/distroless base image.livenessProbe) and readiness
(readinessProbe) probes configured.PodDisruptionBudget (minAvailable: 1 or 2).iam.gke.io/gcp-service-account) instead of static service account keys.Once the application is running on GKE:
gke-workload-scaling skillgke-observability skillgke-workload-security skillgke-reliability
skill