Home > Enterprise >  What could be causing the following error in my ingress-srv.yaml file
What could be causing the following error in my ingress-srv.yaml file

Time:04-21

Building a Microservices app(Node/React) with docker and kubernetes and I keep getting the following error when I run the skaffold dev command.

- stderr: "error: unable to recognize ~/infra/k8s/ingress-srv.yaml\": no matches for kind \"Ingress\" in version \"extensions/v1beta1\"\n"

This is my ingress-srv.yaml file:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-serv
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  rules:
    - host: ticketing.dev
      http:
        paths:
          - pathType: Prefix
          - path: "/api/users/?(.*)"
            backend:
              service:
                name: auth-srv
                port:
                  number: 3000

And this is my skaffold.yaml file

apiVersion: skaffold/v2alpha3
kind: Config
deploy:
  kubectl:
    manifests:
      - ./infra/k8s/*
build:
  local:
    push: false
  artifacts: 
    - image: mutuadocker/auth
      context: auth
      docker:
        dockerfile: Dockerfile
      sync: 
        manual: 
          - src: "src/**/*.ts"
            dest: .

CodePudding user response:

You should change apiVersion: extensions/v1beta1 to apiVersion: networking.k8s.io/v1 so your file would look like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-serv
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  rules:
    - host: ticketing.dev
      http:
        paths:
          - pathType: Prefix
          - path: "/api/users/?(.*)"
            backend:
              service:
                name: auth-srv
                port:
                  number: 3000

Refer to this documentation.

CodePudding user response:

The apiVersion: extensions/v1beta1 has depreciate instead use apiVersion: extensions/v1beta1

  • Related