
GKE Service Networking
FreeStreamline GKE networking and security configurations.
Free · Opens the source repo
What GKE Service Networking does
The GKE Service Networking skill provides a comprehensive set of workflows designed to simplify the process of exposing applications running on Google Kubernetes Engine (GKE) to both internal and external networks. This skill is particularly useful for developers and DevOps engineers who need to configure advanced networking features such as Gateway API, standard Ingress, and Cloud Armor for their GKE applications. By following the provided workflows, users can efficiently set up secure access to their services with minimal manual configuration.
One of the primary workflows includes configuring the Gateway API, which is the recommended approach for managing routing in Kubernetes. The skill outlines the prerequisites, such as enabling the Gateway API on the cluster, and provides example manifests to help users get started quickly. Additionally, it covers standard Ingress configurations for simpler use cases, ensuring that users have options depending on their specific requirements.
Security is a key focus of this skill, with workflows dedicated to integrating Cloud Armor for web application firewall (WAF) and DDoS protection. Users can easily create and manage security policies to protect their public-facing endpoints. Furthermore, the skill includes steps for configuring Google-managed SSL certificates, allowing for automatic provisioning and renewal of SSL, which is essential for maintaining secure connections.
For those looking to enhance performance, the skill also addresses container-native load balancing, which targets Kubernetes Pods directly, improving latency and traffic distribution. Lastly, it covers Private Service Connect, enabling secure service exposure across different VPCs without the need for VPC peering. Overall, this skill is a valuable resource for anyone working with GKE networking configurations.
When to use it
Use this skill when you need to configure advanced networking and security for applications running on GKE, especially when using Gateway API or Cloud Armor.
When not to use it
Avoid this skill for core cluster IP planning or Dataplane V2 network policies, as it is not designed for those use cases.
What you can build with it
Configuring Gateway API
Set up routing for your GKE applications using the modern Gateway API, enabling advanced traffic management.
Implementing Cloud Armor
Protect your public-facing services with Cloud Armor by creating security policies directly from your GKE configurations.
Managing SSL Certificates
Automatically provision and renew SSL certificates for your applications, ensuring secure connections without manual intervention.
How to install GKE Service Networking
View source1. Install with the skills CLI
npx skills add google/skills/gke-service-networking --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by googleGKE Service Networking Skill
This skill provides workflows for exposing applications running on GKE securely to the internet or internal networks.
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 in GKE 1.24+).
Example Gateway Manifest:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: {gateway_name}
namespace: {namespace}
spec:
gatewayClassName: gke-l7-global-external-managed # GKE managed external L7 load balancer
listeners:
- name: http
protocol: HTTP
port: 80
Example HTTPRoute Manifest:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {route_name}
namespace: {namespace}
spec:
parentRefs:
- name: {gateway_name}
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: {service_name}
port: 80
2. Configure Standard GKE Ingress
Use standard Ingress for simpler use cases or legacy setups.
Example Ingress Manifest:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {ingress_name}
namespace: {namespace}
annotations:
kubernetes.io/ingress.class: "gce"
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {service_name}
port:
number: 80
3. Secure with Cloud Armor
Cloud Armor provides WAF and DDoS protection.
Enable Cloud Armor via BackendConfig:
- Create a Security Policy in Cloud Armor (usually via gcloud or Terraform).
- Reference it in a
BackendConfigin GKE.
Example BackendConfig:
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: {backend_config_name}
namespace: {namespace}
spec:
securityPolicy:
name: {security_policy_name}
-
Associate
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.
Example ManagedCertificate (Legacy Ingress):
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
name: {certificate_name}
spec:
domains:
- {domain_name}
Reference it in Ingress annotations: networking.gke.io/managed-certificates: {certificate_name}.
Gateway API Approach: For standard Certificate Manager integration, create a
CertificateMap and reference it directly in the Gateway metadata annotations
using networking.gke.io/cert-map: {certificate_map_name}, or reference a
Kubernetes Secret in the HTTPS listener:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: {gateway_name}
namespace: {namespace}
annotations:
networking.gke.io/cert-map: {certificate_map_name} # For Certificate Manager maps
spec:
gatewayClassName: gke-l7-global-external-managed
listeners:
- name: https
protocol: HTTPS
port: 443
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: {secret_name} # Or directly reference a Kubernetes Secret
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:
- For GKE Ingress and Gateway API, container-native load balancing is enabled by default via Network Endpoint Groups (NEGs).
- To verify or explicitly enable it for a Service, use the
cloud.google.com/negannotation.
Example Service Manifest:
apiVersion: v1
kind: Service
metadata:
name: {service_name}
annotations:
cloud.google.com/neg: '{"ingress": true}' # Enabled for Ingress
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
selector:
app: {app_name}
type: ClusterIP
6. Configure Private Service Connect (PSC)
Private Service Connect allows you to expose services in one VPC to consumers in another VPC securely, without VPC peering.
Steps:
- Create an internal load balancer for your service.
- Create a
ServiceAttachmentreferencing the load balancer.
Example ServiceAttachment Manifest:
apiVersion: networking.gke.io/v1
kind: ServiceAttachment
metadata:
name: {attachment_name}
namespace: {namespace}
spec:
connectionPreference: ACCEPT_AUTOMATIC
natSubnets:
- {nat_subnet_name} # Subnet dedicated for PSC NAT
resourceRef:
kind: Service
name: {service_name}
Share the ServiceAttachment URI with consumers to create a PSC endpoint in
their VPC.
Best Practices
- Prefer Gateway API: It offers more flexibility and role separation than Ingress.
- Enable Cloud Armor: Always protect public-facing endpoints with Cloud Armor.
- Use Managed Certificates: Avoid managing certificate renewals manually.
- Use Container-Native Load Balancing: Always use NEGs for HTTP(S) load balancing to reduce latency and improve traffic distribution.
Frequently asked questions about GKE Service Networking
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
