In the latest version of Kubernetes (around 1.25?), apiVersion: extensions/v1beta1
is no longer usable.
If you have written Ingress using extensions/v1beta1
, you will encounter the following error when applying with kubectl:
error: unable to recognize "ingress.yml": no matches for kind "Ingress" in version "extensions/v1beta1"
Therefore, you need to update it to apiVersion: networking.k8s.io/v1
.
Although I have not confirmed whether apiVersion: networking.k8s.io/v1beta1
is also unusable, it would be wise to similarly update to apiVersion: networking.k8s.io/v1
to avoid future issues.
When doing so, note that the way to write backend.service
has slightly changed.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
namespace: my-namespace
annotations:
ingress.kubernetes.io/ssl-redirect: "true"
spec:
tls:
- secretName: my-tls-cert-secrets
rules:
- host: my-app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app-service
port:
number: 80
In extensions/v1beta1
, what was written as backend.serviceName
and backend.servicePort
has now been changed to backend.service.name
and backend.service.port.number
.
You also need to specify pathType
. For the same behavior as before, use pathType: Prefix
.
Comments