apache / apisix-helm-chart

Apache APISIX Helm Chart
https://apisix.apache.org/
Apache License 2.0
218 stars 208 forks source link

gateway.type is not working in helm upgrade operation #602

Open Yullin opened 10 months ago

Yullin commented 10 months ago

My command is

helm upgrade apisix apisix/apisix --set persistence.storageClass=apisix-etcd-nas --set persistence.enabled=true  --set gateway.type=LoadBalancer --set ingress-controller.enabled=true --set ingress-controller.config.apisix.serviceNamespace=apisix --namespace apisix

The gateway.type is LoadBalancer, But it's not working, still got the following response. It's bacame NODE_PORT.

Release "apisix" has been upgraded. Happy Helming!
NAME: apisix
LAST DEPLOYED: Mon Aug 28 14:36:40 2023
NAMESPACE: apisix
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
  export NODE_PORT=$(kubectl get --namespace apisix -o jsonpath="{.spec.ports[0].nodePort}" services apisix-gateway)
  export NODE_IP=$(kubectl get nodes --namespace apisix -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT

It caused my loadbalancer IP been changed(assigned by dhcp), how should I do to avoid this problem?

wahyudibo commented 10 months ago

I also have the same issue. my apisix helm chart value are:

gateway:
  type: LoadBalancer
  ingress:
    enabled: true

and if i run kubectl get service apisix-gateway after helm chart is applied, it always showing the apisix-gateway are using NodePort, not LoadBalancer.

Image 2023-09-04-11-50-21

I want to integrate my SLB with the apisix-gateway so then it can be exposed to external traffic via apisix router. Please help, thank you

ahululu commented 10 months ago

Chart version must be consistent.I resolve this by specify --version option.

wahyudibo commented 10 months ago

Right, they are use different terms for new version of the charts. For example in the documentation https://apisix.apache.org/docs/ingress-controller/deployments/aws/ and master branch the terms used are gateway but in the latest version of the chart, for example 2.2.0 as this time of writing, the terms are change to service instead of gateway. See : https://github.com/apache/apisix-helm-chart/blob/1c938e7f4a86f2e15bd4c0aba2f9f34405660391/charts/apisix/values.yaml#L154

so instead of:

gateway:
  type: LoadBalancer
  ingress:
    enabled: true

use

service:
  type: LoadBalancer
  ingress:
    enabled: true

or if you are using parameters, use --set service.type=LoadBalancer. It works for me and the apisix-gateway service is created with LoadBalancer type. Hope this helps.

nayavu commented 8 months ago

That's very confusing, since master branch still refers to gateway term in both values.yaml and template: https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L221 https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/templates/service-gateway.yaml#L31

But the latest 2.3.0 tag refers to service: https://github.com/apache/apisix-helm-chart/blob/apisix-2.3.0/charts/apisix/values.yaml#L160 https://github.com/apache/apisix-helm-chart/blob/apisix-2.3.0/charts/apisix/templates/service-gateway.yaml#L30

Routhinator commented 7 months ago

There are a lot of changes in 2.3.0 not reflected in master or the docs, which made this painful.

Be aware that dns, serviceMonitor have moved and service.tls.enabled is now under apisix.ssl.enabled

Docs update should have been a requirement gating this release, they are largely wrong now.

Routhinator commented 7 months ago

For anyone stuck here, this chart is suffering from bad use of SEMVER, the maintainers need to fix their versioning.

2.x is dev branch - these versions should ALL have rc or dev added to them.

The latest stable release appears to be 1.8.0, however the APSIX docs appear to still mention latest as 1.7.0

Routhinator commented 7 months ago

I take it back, 1.8.0 is not stable - some feature was added for adding a gateway to the ingress-controller, and now the ingress controller creates a second unwanted gateway that doesn't respect the gateway.type setting and causes ingress updates to break.

The last stable version I've been able to find that installs and behaves as per the public documentation is Chart version 1.6.2 - before the dependency for apisix-ingress-controller was updated to 12.2 and the undocumented+broken behaviour starts.

And even then, 1.6.2 requires an extra config variable that's not documented:

ingress-controller:
  config:
    ingressPublishService: ingress-apisix/apisix-gateway

Or else you will fail ingress updates with:

2023-12-07T01:03:42+08:00       error   ingress/ingress.go:502  failed to get APISIX gateway external IPs       {"error": "service \"\" not found"}
illflavored commented 4 months ago

A similar issue with solution is documented in https://github.com/apache/apisix-helm-chart/issues/620#issuecomment-1728170404