Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

480
Visualizações
Kubernetes apiVersion: networking.k8s.io/v1 Issue with 'Ingress'

Wanted your guidance on an issue while executing a Kubernetes YAML file. My kubectl version is as follows:

    Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:59:43Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"windows/amd64"}
    Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.14", GitCommit:"89182bdd065fbcaffefec691908a739d161efc03", GitTreeState:"clean", BuildDate:"2020-12-18T12:02:35Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

This is the latest version downloaded from the Kubernetes site https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows

The YAML has apiVersion: networking.k8s.io/v1 kind: Ingress and the error on running the YAML is

    no matches for kind "Ingress" in version "networking.k8s.io/v1"

Kubernetes issue https://github.com/kubernetes/kubernetes/issues/90077 mentions that

  networking.k8s.io/v1beta1 == 1.14 to 1.18
  networking.k8s.io/v1 = 1.19+

So I guess it should be working right?

I have changed the API Version to

apiVersion: extensions/v1beta1 or
apiVersion: networking.k8s.io/v1beta1

but fail in another section of the YAML

backend:
  service:
    name: {{ template "fullname" $ }}-srv
     port:
       number: 80

with the error

error validating data: ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "service" in io.k8s.api.extensions.v1beta1.IngressBackend

I am informed that the same YAML works on macOS with the same kubectl version (I do not have access to verify that though). But any thoughts on where I could be going wrong?

Thanks, Prabal

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I would like to add that according to the K8 deprecation guide, the networking.k8s.io/v1beta1 API versions of Ingress is no longer served as of v1.22.

Changes include:

  1. The backend serviceName field is renamed to service.name
  2. Numeric backend servicePort fields are renamed to service.port.number
  3. String backend servicePort fields are renamed to service.port.name
  4. pathType is now required for each specified path. Options are Prefix, Exact, and ImplementationSpecific.

Meaning we need to make the following changes to go from this:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: stackoverflw
  namespace: stacker
spec:
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: stacker
          servicePort: 80

To this (example):

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: stackoverflw
  namespace: stacker
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: stacker
            port:
              number: 80
over 4 years ago · Santiago Trujillo Relatório

0

For networking.k8s.io/v1beta1 it should be

backend:
  serviceName: {{ template "fullname" $ }}-srv
  servicePort: 80

How to get documentation:

kubectl explain --api-version=networking.k8s.io/v1beta1 ingress.spec.rules.http.paths.backend
over 4 years ago · Santiago Trujillo Relatório

0

You can use below commands to check if kind Ingress in version networking.k8s.io/v1 is available or not in your cluster.

kubectl api-resources #List the API resources that are available.
kubectl api-versions  #List the API versions that are available.
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda