Kubernetes version: v1.33.1
Cloud being used: OKE - Cloud Oracle
This post is about migrating from ingress to gateway-api.
My problem is that the documentation says that if I don’t reference an address, a random public IP is assigned to my gateway…
Source: Gateway API | Kubernetes
Even with that reference, my gateway was created with 2 public IPs.
Below is my manifest file and a screenshot confirming the 2 IPs.
```yaml
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: loki-gateway
namespace: loki
spec:
addresses:
When I tested with your Gateway resource, it only added one IP address to my Service’s External IP list.
Lets run a test. If you delete loki-gateway from your cluster, will both External IPs be remove from the loki-gateway-nginx service? Or does the 162.x.104.14 address stay there?
@Gilberto_de_Oliveira Does the Service’s externalIPs field just have the single IP address that you specified in the Gateway? All that NGINX Gateway Fabric should be setting is that field.
If an additional IP address is being added, it tells me that the cloud provider is adding it. There may be a way to disable that, or you could try setting the following in the NginxProxy CRD
Did you happen to edit the NginxProxy resource as I suggested? I don’t see that configuration in your reply (it’s a little hard to read due to the formatting).
@sjberman
I tried editing, but right after applying it, it seems it wasn’t accepted, and it reverted to the previous IP, removing the lines I added.
The changes I sent in the comment were made via the manifest file.
Here’s a pastebin with better indentation.
Was there an error or something when you tried editing the NginxProxy CRD? This is the only way actually edit the NGINX Service with the loadBalancerIP field. Also be sure to check the status of your Gateway resource to see if there is any error messaging there regarding an Invalid NginxProxy configuration.
@sjberman
I believe that when you previously instructed me on how to edit the CRD, I did something wrong. I edited it correctly now, and it worked; the application only picked up one IP address, and it was the IP address I have reserved with my cloud provider.
Thank you very much for your support.
That’s correct, when you first install NGINX Gateway Fabric, this resource is also installed. You can also create your own and attach it directly to the Gateway (the default one is attached to the GatewayClass), but that’s really only useful if you plan on defining multiple Gateways with different settings.