gke-service-networking
Skill này làm gì
Skill này giúp agent AI thiết lập cách các ứng dụng trên Google Kubernetes Engine được truy cập, từ internet hoặc từ mạng riêng. Skill dành cho các nhóm đưa ứng dụng GKE ra ngoài với định tuyến và cân bằng tải.
Khi nào nên dùng
- ✓Khi bạn muốn đưa một ứng dụng GKE ra ngoài bằng Gateway API hoặc Ingress tiêu chuẩn.
- ✓Khi bạn cần thiết lập chính sách bảo mật Cloud Armor hoặc chứng chỉ SSL do Google quản lý.
- ✓Khi một Ingress hoặc load balancer trả về lỗi 502 hoặc lỗi 5xx khác trên GKE.
Liên kết skill
https://github.com/google/skills/blob/main/skills/cloud/gke-service-networking/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Ứng dụng GKE của tôi trả về lỗi 502 qua load balancer. Làm sao để thiết lập định tuyến và sửa lỗi?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent dùng các mẫu sẵn có cho gateway, route và phân chia lưu lượng, rồi kiểm tra health check và cài đặt backend khi lỗi xuất hiện.
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 Service Networking Skill
This skill provides workflows for exposing applications running on GKE securely to the internet or internal networks.
Deployable manifest templates live in assets/ — edit the # Replace ...
placeholders before applying.
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-service-networking)"
and append agent-skills/1.0 (skill:gke-service-networking) to User-Agent headers.
Workflows
1. Configure Gateway API (Recommended)
The Gateway API is the modern way to manage routing in Kubernetes.
Prerequisites: Gateway API must be enabled on the cluster (enabled by
default on new clusters running GKE 1.26+; on older supported versions enable it
with --gateway-api=standard).
Templates:
assets/gateway.yaml— external Gateway using thegke-l7-global-external-managedGatewayClass with an HTTP listener.assets/httproute.yaml— HTTPRoute attaching to the Gateway viaparentRefsand routing a path prefix to a ServicebackendRef.assets/httproute-traffic-split.yaml— HTTPRoute demonstrating weighted traffic splitting (e.g. 90/10) for canary deployments across backend services.
kubectl apply -f assets/gateway.yaml
kubectl apply -f assets/httproute.yaml
Traffic Splitting (Canary Deployments):
HTTPRoute supports weighted traffic splitting across multiple backend Services for canary rollouts:
spec:
rules:
- backendRefs:
- name: app-v1
port: 80
weight: 90
- name: app-v2
port: 80
weight: 10
2. Configure Standard GKE Ingress
Use standard Ingress for simpler use cases or legacy setups.
Template: assets/ingress.yaml — GCE Ingress (kubernetes.io/ingress.class: "gce" annotation) routing to a Service.
3. Secure with Cloud Armor
Cloud Armor provides WAF and DDoS protection.
Create a Security Policy in Cloud Armor:
gcloud compute security-policies create {security_policy_name} \ --description "WAF policy for {app_name}" # Example rule: block an abusive IP range gcloud compute security-policies rules create 1000 \ --security-policy {security_policy_name} \ --action deny-403 \ --src-ip-ranges "203.0.113.0/24" \ --description "Block abusive range"Reference it in a
BackendConfig:assets/backendconfig.yaml(setsspec.securityPolicy.name).Associate the
BackendConfigwith yourServicevia annotations:# In your Kubernetes Service manifest metadata.annotations: cloud.google.com/backend-config: '{"default": "{backend_config_name}"}' # Or for specific port mappings: cloud.google.com/backend-config: '{"ports": {"80": "{backend_config_name}"}}'
4. Configure Google-Managed SSL Certificates
Automatically provision and renew SSL certificates.
Legacy Ingress approach: apply assets/managed-certificate.yaml (a
ManagedCertificate listing your domains), then reference it in the Ingress
annotations:
networking.gke.io/managed-certificates: {certificate_name}
Gateway API approach: for standard Certificate Manager integration, create a
CertificateMap and reference it in the Gateway metadata annotations using the
exact annotation networking.gke.io/certmap (spelled without any hyphens in
certmap):
metadata:
annotations:
networking.gke.io/certmap: {certificate_map_name}
[!IMPORTANT] The annotation key is strictly
networking.gke.io/certmap(do not usecert-maporcertificate-map).
Alternatively, reference a Kubernetes Secret in the HTTPS listener's
tls.certificateRefs. Both variants are in assets/gateway-https.yaml.
5. Enable Container-Native Load Balancing (Recommended)
Container-native load balancing allows load balancers to target Kubernetes Pods directly, rather than targeting nodes. This improves latency and distribution.
Prerequisites: Cluster must be VPC-native.
How it works: the cloud.google.com/neg annotation on a Service triggers
creation of a NEG that mirrors the Pod IPs. GKE often adds it for you — but not
always, and knowing which case you are in
Câu hỏi thường gặp
Nó đề xuất phương pháp định tuyến nào?
Nó nói Gateway API là cách hiện đại để quản lý định tuyến trong Kubernetes.
Nó có thể chia lưu lượng giữa các phiên bản không?
Có. Nó có một mẫu phân chia lưu lượng theo trọng số.
Nó có bao gồm truy cập dịch vụ riêng tư không?
Có. Nó bao gồm Private Service Connect cho các endpoint dịch vụ riêng tư.
Chi tiết
Mô tả gốc của tác giả
Configures GKE edge networking, traffic routing, load balancing, and private service endpoints. Use when configuring Gateway API manifests, standard Ingress, Cloud Armor WAF security policies, Container-Native Load Balancing (NEGs), Private Service Connect (PSC), or Google-managed SSL certificates on GKE, and to troubleshoot Ingress and load-balancer 502/5xx errors, backend health-check failures, connection draining, and TLS/SSL policy enforcement. Don't use for core cluster IP planning, Dataplane V2 network policies, or node NAT egress (use gke-networking instead).
repo: google/skills
Độ phổ biến
- Sao GitHub
- 22k
- Vị trí xếp hạng
- #10297
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
finding-google-skills
22kGiúp agent của bạn tìm hướng dẫn Google phù hợp cho việc thiết lập, như hosting, cơ sở dữ liệu, lưu trữ, đăng nhập hoặc phục vụ mô hình AI.
gcloud
22kGiúp agent của bạn viết và kiểm tra các lệnh gcloud của Google Cloud, tra cứu cú pháp chính xác trước khi chạy bất cứ thứ gì để không đoán các flag.
google-cloud-recipe-auth
22kHướng dẫn agent của bạn qua quản lý danh tính và quyền truy cập của Google Cloud, gồm cách con người và dịch vụ đăng nhập và những quyền họ nhận được.
google-cloud-recipe-onboarding
22kHướng dẫn một lập trình viên mới qua các bước đầu tiên trên Google Cloud, gồm chọn dự án, liên kết thanh toán và triển khai tài nguyên đầu tiên.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.