devfullcycle / FC3-kong-automation

11 stars 24 forks source link

Error no KongIngress "do-not-preserve-host" #6

Open ianmateusES opened 4 months ago

ianmateusES commented 4 months ago

Seguindo as aulas do módulo "API Gateway com Kong e Kubernetes", ao aplicar a configuração no Kubernetes usando o seguinte comando:

kubectl apply -f infra/kong-k8s/misc/apis/king.yaml -n bets

Encontrei o seguinte erro:

O KongIngress "do-not-preserve-host" é inválido: : Valor inválido: "object": o campo 'route' não é mais suportado, utilize as anotações do Ingress em seu lugar.

Como solução, o Copilot sugeriu a seguinte correção:

apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
  name: do-not-preserve-host
  annotations:
    configuration.konghq.com/preserve-host: "false"
upstream:
  host_header: bets.bets.svc

Esta configuração resolveu o problema.

gabrielcjr commented 4 months ago

Olá @ianmateusES. Por favor, entre em contato comigo no discord pra vermos isto mais de perto. Meu user é gabrielcjr

leandro-careplus commented 3 months ago

Conseguiram resolver esse problema?

leandro-careplus commented 3 months ago

Para conhecimento. Resolvi esse problema instalando um CRD indicado no material abaixo:

https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-dbless.yaml

Generated by build-single-manifest.sh. DO NOT EDIT.

#

DEPRECATED

#

For Kong Ingress Controller 3.0+, please use Helm instead:

#

$ helm repo add kong https://charts.konghq.com

$ helm repo update

$ helm install kong/kong --generate-name --set ingressController.installCRDs=false

#

If you intend to use an older version, Helm is recommended but you still have the option

to install using manifests. In that case, replace the 'main' branch in your link with the

KIC tag. For example:

kubectl apply -f https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/v2.12.0/deploy/single/all-in-one-dbless.yaml

#

apiVersion: please-use-helm-to-install-kong kind: Deprecated