risail
risail

Reputation: 537

EKS ingress resource

I'm trying to configure an Ingress resource in an EKS cluster running v1.18 using the below configuration. after running kubectl apply -f blah.yaml I'm returned error: unable to recognize "blah.yaml": no matches for kind "Ingress" inversion "networking.k8s.io/v1" I think it's an apiversion mismatch. What am I missing?

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo
spec:
  rules:
  - http:
      paths:
      - path: /boom
        pathType: Prefix
        backend:
          service:
            name: foo
            port:
              number: 80

Upvotes: 0

Views: 297

Answers (2)

sai
sai

Reputation: 349

You can check what is the apiVersions are present for networking.k8s.io resource in your system using

kubectl api-versions  | grep networking.k8s.io

Check if you have networking.k8s.io/v1 in the output.

Upvotes: 1

risail
risail

Reputation: 537

It was a version problem the below works.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: foo
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /boom
        backend:
          serviceName: foo
          servicePort: 80

Upvotes: 1

Related Questions