Helm upgrade command error for field kubernetes.io/ingress.class

11/26/2019

Why do I get this error while running the helm upgrade command? I see my Ingress controller running fine

Error: UPGRADE FAILED: error validating "": error validating data: [ValidationError(Ingress.metadata): unknown field "kubernetes.io/ingress.class" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta, ValidationError(Ingress.metadata): unknown field "nginx.ingress.kubernetes.io/enable-cors" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta]

Below is my helm version

version.BuildInfo{Version:"v3.0.0", GitCommit:"e29ce2a54e96cd02ccfce88bee4f58bb6e2a28b6", GitTreeState:"clean", GoVersion:"go1.13.4"}

I do not get and server and client separately for helm version? Not sure if its because due to the latest helm version installed.

Any suggestion for my helm error?

-- Harish
kubectl
kubernetes
kubernetes-helm
kubernetes-ingress
minikube

1 Answer

11/26/2019

you are missing the annotation scope:

metadata:
  annotations:
    kubernetes.io/ingress.class: <whatever>

to debug such issues in the future, you can use kubectl explain which provides you with the optional fields: try

kubectl explain ingress.metadata
-- Efrat Levitan
Source: StackOverflow