* cmd/k8s-operator/deploy: deploy a Tailscale IngressClass resource.
Some Ingress validating webhooks reject Ingresses with
.spec.ingressClassName for which there is no matching IngressClass.
Additionally, validate that the expected IngressClass is present,
when parsing a tailscale `Ingress`.
We currently do not utilize the IngressClass,
however we might in the future at which point
we might start requiring that the right class
for this controller instance actually exists.
Updates tailscale/tailscale#10820
Signed-off-by: Irbe Krumina <irbe@tailscale.com>
Co-authored-by: Anton Tolchanov <anton@tailscale.com>
name:tailscale# class name currently can not be changed
annotations:{}# we do not support default IngressClass annotation https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class
spec:
controller:tailscale.com/ts-ingress# controller name currently can not be changed
# parameters: {} # currently no parameters are supported
tailscaleIngressClassName="tailscale"// ingressClass.metadata.name for tailscale IngressClass resource
tailscaleIngressControllerName="tailscale.com/ts-ingress"// ingressClass.spec.controllerName for tailscale IngressClass resource
ingressClassDefaultAnnotation="ingressclass.kubernetes.io/is-default-class"// we do not support this https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class
returnfmt.Errorf("Tailscale Ingress class controller name %s does not match tailscale Ingress controller name %s. Ensure that you are using 'tailscale' IngressClass from latest Tailscale installation manifests",ic.Spec.Controller,tailscaleIngressControllerName)
returnfmt.Errorf("%s annotation is set on 'tailscale' IngressClass, but Tailscale Ingress controller does not support default Ingress class. Ensure that you are using 'tailscale' IngressClass from latest Tailscale installation manifests",ingressClassDefaultAnnotation)