canonical / k8s-snap

Canonical Kubernetes is an opinionated and CNCF conformant Kubernetes operated by Snaps and Charms, which come together to bring simplified operations and an enhanced security posture on any infrastructure.
GNU General Public License v3.0
64 stars 25 forks source link

duplicate GatewayClass #1331

Closed dulmandakh closed 2 weeks ago

dulmandakh commented 4 weeks ago

Summary

I see 2 same GatewayClass resources when I enter below command, except helm install name and namespace. We would need some explanation about propose of having 2 GatewayClasses.

k get gatewayclass -o yaml

One in kube-system namespace

kind: GatewayClass
metadata:
  annotations:
    meta.helm.sh/release-name: ck-network
    meta.helm.sh/release-namespace: kube-system
  creationTimestamp: "2025-04-21T07:39:47Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
  name: cilium
  resourceVersion: "628"
  uid: ea1b3bfd-349c-4032-9bb8-de9451887fa5
spec:
  controllerName: io.cilium/gateway-controller
  description: The default Cilium GatewayClass

Another in default namespace

kind: GatewayClass
metadata:
  annotations:
    meta.helm.sh/release-name: ck-gateway-class
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2025-04-21T07:39:37Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
  name: ck-gateway
  resourceVersion: "629"
  uid: b2ebc2ca-9664-4d21-9fc9-e5e35e03da96
spec:
  controllerName: io.cilium/gateway-controller

What Should Happen Instead?

I expect to see one or default gatewayclass.

Reproduction Steps

  1. run kubectl get gatewayclass -o yaml command
  2. compare two GatewayClasses

System information

inspection-report-20250422_012741.tar.gz

Can you suggest a fix?

Add more documentation about Gateway and explain if there is a distinction.

Are you interested in contributing with a fix?

No response

berkayoz commented 4 weeks ago

Hey @dulmandakh ,

Thank you for reporting this issue. This seems like a bug. ck-gateway is the class managed by the k8s-snap and should be the default, it seems that cilium also creates a gateway class automatically which is unintentional.

I'll raise a PR and keep updating here, thanks!