Summary
I am specifying an IngressClassName
without a corresponding IngressClass
resource and it is unexpectedly working fine; my understanding was you need to define the IngressClass
resource as well. Previously we were using the annotation based approach, kubernetes.io/ingress.class
, so I am migrating to the new way.
Details
My reading of the above doc makes me think if you set IngressClassName
as follows
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
labels:
app: example-service.example.com
manager: nginx-ingress-controller
name: example
spec:
ingressClassName: example-com-public
rules:
- host: example-service.example.com
http:
paths:
- backend:
serviceName: example-service
servicePort: 8080
path: /
Then there needs to be a IngressClass
with name example-com-public
. However, in our cluster, this is not the case since we are migrating from the old annotation-only approach. Yet everything works. It seems we may not need to have to create IngressClass resources?