Get error "unknown field "serviceName" in io.k8s.api.networking.v1.IngressBackend" when switch from v1beta1 to v1 in Kubernetes Ingress
I think that this PR contains the change you're asking about.
`Ingress` and `IngressClass` resources have graduated to `networking.k8s.io/v1`. Ingress and IngressClass types in the `extensions/v1beta1` and `networking.k8s.io/v1beta1` API versions are deprecated and will no longer be served in 1.22+. Persisted objects can be accessed via the `networking.k8s.io/v1` API. Notable changes in v1 Ingress objects (v1beta1 field names are unchanged):* `spec.backend` -> `spec.defaultBackend`* `serviceName` -> `service.name`* `servicePort` -> `service.port.name` (for string values)* `servicePort` -> `service.port.number` (for numeric values)* `pathType` no longer has a default value in v1; "Exact", "Prefix", or "ImplementationSpecific" must be specifiedOther Ingress API updates:* backends can now be resource or service backends* `path` is no longer required to be a valid regular expression
If you look in the 1.19 Ingress doc, it looks like the new syntax would be:
apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: minimal-ingress annotations: nginx.ingress.kubernetes.io/rewrite-target: /spec: rules: - http: paths: - path: /testpath pathType: Prefix backend: service: name: test port: number: 80
I unfortunately don't have a 1.19 cluster to test myself, but I think this is what you're running into.
networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
What would happen If I update the cluster to v1.22+, but the manifest of running services still uses the beta API?Would it be automatically migrated or will the service stop working?
Please try the following:
% minikube addons enable dashboard% minikube addons enable metrics-server
Then, change the apiVersion
in dashboard-ingress.yaml
to:
apiVersion: networking.k8s.io/v1beta1