Skip to main content

Enable Gateway API in GKE

warning

The following guide is for demonstration purposes only and is not designed for production purposes.

info

Expose with GKE Gateway API in ShamanOps is only designed for gke-l7-global-external-managed GatewayClass.

If you are going to use a GKE Gateway API you can take as a reference the following enabling steps:

1. In GCloud console select the project of GKE cluster

gcloud config set project PROJECT_ID

2. Enable Gateway Controller in you existing GKE cluster

gcloud container clusters update CLUSTER_NAME \
--location=CLUSTER_LOCATION \
--gateway-api=standard

3. Log in to the GKE cluster as user kubeadmin

gcloud container clusters get-credentials CLUSTER_NAME \
--zone CLUSTER_LOCATION

4. Apply the following YAML containing the GatewayClass and a Self-Signed SSL certificate

gkeGatewayAPI-example.yaml
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: external-gateway
namespace: kube-system
spec:
gatewayClassName: gke-l7-global-external-managed
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
kinds:
- kind: HTTPRoute
namespaces:
from: All
- name: https
protocol: HTTPS
port: 443
allowedRoutes:
kinds:
- kind: HTTPRoute
namespaces:
from: All
tls:
mode: Terminate
certificateRefs:
- group: ""
kind: Secret
name: selfsigned-cert-secret
---
apiVersion: v1
kind: Secret
metadata:
name: selfsigned-cert-secret
namespace: kube-system
type: kubernetes.io/tls
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVDVENDQXZHZ0F3SUJBZ0lVSDg3Y0h5SmlnK0ErS2ltY3BObDJuS0wzZm9Nd0RRWUpLb1pJaHZjTkFRRUwKQlFBd2daTXhDekFKQmdOVkJBWVRBbGhZTVJNd0VRWURWUVFJREFwVFpXeG1VMmxuYm1Wa01STXdFUVlEVlFRSApEQXBUWld4bVUybG5ibVZrTVJNd0VRWURWUVFLREFwVFpXeG1VMmxuYm1Wa01STXdFUVlEVlFRTERBcFRaV3htClUybG5ibVZrTVJJd0VBWURWUVFEREFsc2IyTmhiR2h2YzNReEhEQWFCZ2txaGtpRzl3MEJDUUVXRFc1dmJtV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