Skip to content

Commit 93c98bd

Browse files
committed
fix: replace deprecated Ingress annotation
Before the IngressClass resource and ingressClassName field were added in Kubernetes 1.18, Ingress classes were specified with a kubernetes.io/ingress.class annotation on the Ingress. This annotation was never formally defined, but was widely supported by Ingress controllers. The newer ingressClassName field on Ingresses is a replacement for that annotation, but is not a direct equivalent. While the annotation was generally used to reference the name of the Ingress controller that should implement the Ingress, the field is a reference to an IngressClass resource that contains additional Ingress configuration, including the name of the Ingress controller. Cf. https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation
1 parent 1392456 commit 93c98bd

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

controllers/controller/devworkspacerouting/solvers/basic_solver.go

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ var routeAnnotations = func(endpointName string) map[string]string {
3131

3232
var nginxIngressAnnotations = func(endpointName string) map[string]string {
3333
return map[string]string{
34-
"kubernetes.io/ingress.class": "nginx",
3534
"nginx.ingress.kubernetes.io/rewrite-target": "/",
3635
"nginx.ingress.kubernetes.io/ssl-redirect": "false",
3736
constants.DevWorkspaceEndpointNameAnnotation: endpointName,

controllers/controller/devworkspacerouting/solvers/common.go

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ func getIngressForEndpoint(routingSuffix string, endpoint controllerv1alpha1.End
223223
Annotations: nginxIngressAnnotations(endpoint.Name),
224224
},
225225
Spec: networkingv1.IngressSpec{
226+
IngressClassName: "nginx",
226227
Rules: []networkingv1.IngressRule{
227228
{
228229
Host: hostname,

0 commit comments

Comments
 (0)