Gke Manifest Generation
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to creating and updating Kubernetes YAML manifests tailored for Google Kubernetes Engine (GKE). It emphasizes security best practices, resource optimization, and high availability. The skill includes specific guidance for GKE Autopilot and Standard, covering namespace isolation, container security hardening, health probes, and specialized configurations for AI/LLM inference workloads. It also integrates with the GKE Inference Quickstart CLI for optimized model serving deployments.
What it does
- Generates secure deployment, service, and configuration manifests for GKE.
- Applies security hardening including non-root execution and read-only filesystems.
- Configures resource requests, limits, and health probes for stability.
- Provides templates for AI/LLM inference workloads with GPU and shared memory support.
- Implements high availability via topology spread and disruption budgets.
- Integrates with GKE Inference Quickstart for optimized AI model serving.
When to use it
- When creating new Kubernetes manifests for GKE deployments.
- When hardening existing YAML configurations for production readiness.
- When configuring AI/LLM inference workloads on GKE.
- When optimizing resource allocation for GKE Autopilot or Standard clusters.
- When setting up secure networking and service routing via Gateway API.
Advantages
- Ensures compliance with GKE-specific security and operational standards.
- Reduces configuration errors through standardized templates and best practices.
- Optimizes resource usage and costs for both Autopilot and Standard clusters.
- Simplifies complex setups like GPU-accelerated inference workloads.
- Promotes consistent resource isolation and naming conventions.
Usage examples
- “Generate a production-ready deployment manifest for a Python web service on GKE Autopilot.”
- The agent produces a YAML file with explicit namespace, resource requests/limits, non-root security context, and mandatory liveness/readiness probes.
- “Create a manifest for a vLLM inference server using an L4 GPU.”
- The agent provides a manifest including GPU resource requests, node selectors for L4 accelerators, shared memory volume mounts, and startup probes.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/gke-manifest-generation/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip gke-manifest-generation.zip -d .agents/skills
Documentation by Google
GKE Manifest Generation Skill
This skill provides guidelines, tooling integration, and templates to translate natural language descriptions or application code changes into secure, compliant, and cost-effective Kubernetes YAML manifests optimized for both GKE Autopilot and GKE Standard clusters.
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-manifest-generation)"
and append agent-skills/1.0 (skill:gke-manifest-generation) to User-Agent headers.
Core Rules & Verification
When generating or updating YAML manifests, you must strictly adhere to the following rules:
1. Namespace & Resource Isolation
Explicit Namespace: Always declare
namespace: {namespace}explicitly in the metadata of every resource (Deployments, Services, ConfigMaps, Secrets, PVCs, Roles, bindings). Map it to the namespace configured in your activeSETTINGS.md. Never omit the namespace.Dedicated ServiceAccount: Avoid using the namespace's
defaultServiceAccount. Always create and reference a dedicatedServiceAccount(e.g.,devteam-agent-sa) for each microservice.
2. GKE Resource Tuning (Autopilot & Standard)
Resources Requests & Limits: Always specify CPU and Memory requests and limits for all containers.
GKE Autopilot: Requests determine pod billing directly; requests and limits must be equal. If they differ, Autopilot will automatically scale requests up to match limits, which can significantly increase costs.
GKE Standard: Requests ensure stable scheduling and bin-packing; limits prevent resource starvation/noisy-neighbor issues.
Density Defaults: For stateless apps or sidecars on GKE Standard, default to conservative requests (e.g.,
requests.cpu: "100m"or"200m",requests.memory: "256Mi"or"512Mi") with burstable limits. Use a reasonable overcommit ratio for limits (e.g., 2x to 4x requests, likelimits.cpu: "400m"to"800m", andlimits.memory: "512Mi"to"1Gi"). Avoid excessive overcommit limits (likelimits.cpu: "4"for a100mrequest) to prevent severe CPU throttling and latency degradation under heavy scheduling load, particularly in environments without guaranteed node shares.Spot VMs for Staging/Dev: For non-production workloads (e.g., namespaces containing
-test,-dev, or-staging), or if the user requests cost optimization, automatically target GKE Spot VMs. This requires injecting both thenodeSelectortargeting Spot VMs AND the corresponding toleration to tolerate the Spot VM taint:nodeSelector: cloud.google.com/gke-spot: "true" tolerations: - key: "cloud.google.com/gke-spot" operator: "Equal" value: "true" effect: "NoSchedule"(On GKE Standard, this assumes a Spot node pool is configured).
3. Container Security Hardening (Pod Security Standards)
Non-Root Execution: Always configure
securityContextat the Pod level (and container level if overriding) to run as a non-root user (e.g.,runAsNonRoot: true,runAsUser: 10000,runAsGroup: 10000,fsGroup: 10000). This is strictly enforced on GKE Autopilot and is a critical security baseline for GKE Standard.Minimal Privileges: Always set
allowPrivilegeEscalation: falseandseccompProfile: {type: RuntimeDefault}.Read-Only Root Filesystem: Set
readOnlyRootFilesystem: trueto prevent modifications to the container image filesystem.Writable Directory Fallback: If
readOnlyRootFilesystemis enabled, mount a localemptyDirvolume to/tmpor/var/run/to allow applications (like Java/Nginx) to write temp files without crashing.
Secret Volume Mounting: Prefer mounting Secrets as read-only files (configured in the
volumesspec withdefaultMode: 0400) instead of mapping them as environment variables, unless the application framework exclusively supports env-var based configuration. This prevents secrets leaking into application logs.
4. Health Checking (Mandatory Probes)
Liveness & Readiness Probes: Every Deployment container must define both
livenessProbeandreadinessProbe.Web/API: Use
httpGetprobes.TCP Services: Use
tcpSocketprobes.Databases/Caches: Use command-based
execprobes (e.g.,exec.command: ["redis-cli", "ping"]).
Startup Probes for Slow-Starting Apps: For applications with slow boot times (e.g., Java spring boot, complex Python scripts, LLM model servers), you must also define a
startupProbe. When astartupProbeis defined, the liveness and readiness probes are disabled until it succeeds, preventing Kubernetes from prematurely killing the pod during startup:startupProbe: httpGet: path: /healthz port: 8080 failureThreshold: 30 periodSeconds: 10Sensible Defaults: Set
initialDelaySeconds: 5to15depending on startup time (e.g., Java requires a longer delay than Go/Nginx).
5. Services & Ingress Routing
Internal ClusterIP: Default all internal microservices to
type: ClusterIP. Never usetype: LoadBalancerorNodePortunless the workload is explicitly intended to be publicly accessible from the internet.Port Naming: Always assign clear, standard names to service and container ports (e.g.,
name: http-weborname: grpc-api) to enable automatic protocol discovery, tracing, and Web App routing.Prefer Gateway API: When exposing APIs externally, prioritize using GKE Gateway API (
GatewayandHTTPRouteresources) over legacyIngressobjects to enable advanced L7 routing and security features (e.g., Cloud Armor).
6. Volume Mounts, StorageClasses & subPath Safety
Avoid Directory Overwrites: When mounting a
ConfigMaporSecretto an application directory containing other files (like Nginx public directories), always usesubPathto overlay only the specific file. Caveat: Note that containers usingsubPathvolume mounts do not receive automatic configuration updates if the underlying ConfigMap or Secret is modified; pods must be restarted manually to pick up changes.StorageClass Selection: Use the correct GKE storage class in PersistentVolumeClaims:
CSI Driver Clusters (Autopilot & Modern Standard): Use
standard-rwo(default balanced PD) orpremium-rwo(SSD PD).Legacy Standard Clusters: Use
standard(default PD) orpremium(SSD PD) ifstandard-rwo/premium-rwoare not configured.Database rule: Use SSD storage classes (
premium-rwoorpremium) only when the prompt explicitly requests high IOPS, low latency, or database storage.
7. High Availability on GKE
Topology Spread: For deployments with >1 replica, use
podAntiAffinityortopologySpreadConstraintswithtopologyKey: "kubernetes.io/hostname"to distribute pods across GKE nodes and availability zones.PodDisruptionBudget: For deployments with >1 replica, declare a
PodDisruptionBudgetto guarantee minimum replica availability during voluntary GKE node upgrades and maintenance cycles.
8. Updates & Server-Side Apply Reconciliations
Stable List Keys: Under Kubernetes Server-Side Apply (SSA), elements in associative lists (like volumes, volume mounts, ports, and container definitions) are matched and merged by their unique identifier keys (typically
name). You must keep thenamekey stable when modifying properties of an existing list item. Renaming thenamekey will cause SSA to create a brand new entry and leave the old entry intact (orphaned) rather than modifying it.Minimal Diff: Make only the changes requested. Adhere closely to existing labels, annotations, and conventions.
Specialty Workloads: GKE AI/Inference Serving (vLLM, TGI, etc.)
For model serving workloads, prioritize using optimized tooling like GKE Inference Quickstart if available. If generating manually:
GPU Request & Allocation:
Always request
nvidia.com/gpuin bothrequestsandlimits.Add a
nodeSelectoror node affinity targeting the desired GKE accelerator tag (e.g.,cloud.google.com/gke-accelerator: nvidia-l4).
Shared Memory Boost:
Model servers require high shared memory (
/dev/shm) for inter-process communications. Always declare and mount anemptyDirvolume withmedium: Memoryto/dev/shm.
Weight Loading Optimization:
Mount model weight directories (like GCS buckets) using the GKE GCS Fuse CSI driver (
csi.storage.gke.io) asreadOnly: truefor efficient cold-starts.
Tooling & Grounding Guidelines
When generating manifests, you should leverage the following tooling to reduce hallucinations and optimize configurations:
Inference Workloads (GKE Inference Quickstart CLI):
Make sure you have the Google Cloud SDK installed.
For all AI/LLM inference workloads (e.g. model serving), you must prioritize using the
gcloudCLI GKE Inference Quickstart command to generate the optimized manifests instead of writing them manually:gcloud container ai profiles manifests create \ --model={model_name} \ --model-server={server_name} \ --accelerator-type={accelerator_type} \ --output=manifest \ --output-path={output_file_path}Constraint: You must include all resources returned by this command (Deployments, Services, PodMonitoring, etc.) without filtering.
Grounding in Official Documentation (Developer Knowledge API):
For GKE-specific features, API defaults, manifest examples, or security contexts, you must query Google's developer knowledge base to retrieve official GKE documentation:
answer_query: Use this to ask direct questions (e.g., "How to configure GCS Fuse CSI driver in GKE"). This is the preferred tool for general queries.search_documents: Use this to search for relevant GKE guides or examples when you don't have a specific question.get_document: Use this to fetch full document contents when you have a specific document ID.
Reference Examples
For detailed, production-ready manifest templates, consult the following reference guides:
Basic Hardened Nginx Workload: Production-ready deployment with dedicated service account, security contexts, probes, anti-affinity, and PodDisruptionBudget.
Network Policy: Default-deny ingress network policy and selective ingress allowance for specific apps.
AI/LLM Inference Workload: GPU resource allocation, Workload Identity, GCS FUSE CSI driver mounting,
/dev/shmshared memory boost, and startup probes.GKE Gateway API Routing: Exposing workloads using GKE L7 Gateway API (
GatewayandHTTPRouteresources).
Files
- ATTRIBUTION.mdAdded by AutoGineer864 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md12.5 KiB
- references/ai-inference.md3.0 KiB
- references/attribution.md1.9 KiB
- references/basic-workload.md3.4 KiB
- references/gateway-api.md906 B
- references/network-policy.md918 B
references/ai-inference.md
AI/LLM Inference Workload Example (vLLM & GCS FUSE)
This reference example demonstrates deploying an AI/LLM model serving workload (such as Gemma 2 27B) on GKE.
It includes:
Workload Identity annotation for GCP authentication
GPU resource allocation (
nvidia.com/gpu) andnodeSelectortargeting accelerator typesGCS FUSE CSI driver volume mount (
csi.storage.gke.io) for read-only model weight loadingShared memory volume mount at
/dev/shm(emptyDirwithmedium: Memory)Extended
startupProbefailure threshold to accommodate slow model initialization
apiVersion: v1
kind: Namespace
metadata:
name: gemma-ns
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gemma-sa
namespace: gemma-ns
annotations:
iam.gke.io/gcp-service-account: {gcp_service_account_email}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gemma-27b-deployment
namespace: gemma-ns
labels:
app.kubernetes.io/name: gemma-27b
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: gemma-27b
template:
metadata:
labels:
app.kubernetes.io/name: gemma-27b
annotations:
gke-gcsfuse/volumes: "true"
spec:
serviceAccountName: gemma-sa
securityContext:
runAsNonRoot: true
runAsUser: 10000
runAsGroup: 10000
seccompProfile:
type: RuntimeDefault
containers:
- name: gemma-server
image: vllm/vllm-openai:gemma2 # Example optimized image
args: ["--model", "/models", "--tensor-parallel-size", "4"]
ports:
- name: http-api
containerPort: 8000
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
resources:
requests:
cpu: "32"
memory: "128Gi"
nvidia.com/gpu: 4
limits:
cpu: "32"
memory: "128Gi"
nvidia.com/gpu: 4
livenessProbe:
httpGet:
path: /healthz
port: http-api
periodSeconds: 30
readinessProbe:
httpGet:
path: /healthz
port: http-api
periodSeconds: 10
startupProbe:
httpGet:
path: /healthz
port: http-api
failureThreshold: 60
periodSeconds: 10
volumeMounts:
- name: model-weights
mountPath: /models
readOnly: true
- name: dshm
mountPath: /dev/shm
nodeSelector:
cloud.google.com/gke-accelerator: "nvidia-l4"
volumes:
- name: model-weights
csi:
driver: gcsfuse.csi.storage.gke.io
readOnly: true
volumeAttributes:
bucketName: {gcs_bucket_name}
mountOptions: "implicit-dirs"
- name: dshm
emptyDir:
medium: MemoryRequirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool, Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/gke-manifest-generation · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gke-manifest-generation.zip