Got this error while creating pods from nginx-ingress controller. The ingress-class.yaml file structure is as follows-
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: nginx
# annotations:
# ingressclass.kubernetes.io/is-default-class: "true"
spec:
controller: k8s.io/ingress-nginx