l7mp/stunner

Cannot apply GatewayClass from README.md on K8s v1.27

Schille opened this issue · 2 comments

Applying this GatewayClass from your README.md

kubectl apply -f - <<EOF
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GatewayClass
metadata:
  name: stunner-gatewayclass
spec:
  controllerName: "stunner.l7mp.io/gateway-operator"
  parametersRef:
    group: "stunner.l7mp.io"
    kind: GatewayConfig
    name: stunner-gatewayconfig
    namespace: stunner
  description: "STUNner is a WebRTC media gateway for Kubernetes"
EOF

raises a webhook error on GKE Autopilot 1.27

Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "gateway-api-alpha-deprecated-use-beta-version.gke.io": failed to call webhook: Post "https://gateway-api-alpha-deprecated-use-beta-version.kube-system.svc:443/?timeout=1s": service "gateway-api-alpha-deprecated-use-beta-version" not found

Using apiVersion: gateway.networking.k8s.io/v1beta1 works.

The same is with Gateway.
However, UDPRoute only works with v1alpha2.

kubectl version --short

Client Version: v1.26.3
Kustomize Version: v4.5.7
Server Version: v1.27.3-gke.100
rg0now commented

Thanks for the report. We are aware of the situation: GKE seems be advancing the supported Gateway API versions fairly rapidly (too rapidly, if you ask me).

Anyway, we have upgraded STUNner to the new version of the Kubernetes Gateway API. Let me quickly summarize the new rules in the hope that people hitting the same issue will find it useful:

  • Currently you have to install STUNner from the dev channel; this restriction will go away once we get to release STUNner v0.16 (1-2 weeks).
  • If you are on GKE Autopilot then you must to use the v1beta1 version of GatewayClass and Gateway resources (GatewayConfigs remain at v1alpha1 and UDPRoutes at v1alpha2 though). This is done by rewriting the first line of GatewayClass and Gateway YAMLs from apiVersion: gateway.networking.k8s.io/v1alpha2 to apiVersion: gateway.networking.k8s.io/v1beta1 and things should go fine.
  • Anyone else may still use the v1alpha2 version of GatewayClass and Gateway resources, but Kubernetes will silently rewrite the API version to v1beta1 on both types of resource. Our current understanding is that this may cause problems with ArgoCD (not tested), so the safest bet at this point is to likewise rewrite all Gateways and GatewayClasses to v1beta1.

This subtlety will stay with us until the Gateway API goes GA (hopefully this year), but then we'll have to make another API version upgrade (from v1beta1 to v1). This is the price we pay for STUNner tracking a beta Kubernetes API: once things settle upstream we'll release STUNner v1 and then that should settle API versioning troubles for the foreseeable time. Please report any breakage you encounter meanwhile.

Closing this since this is not a STUNner issue. Let's hope Google will update GKE to the Gateway API v1 soon.