Hi,
Using a helm chart that deploys a "service", a "deployment", and an "ingress".
Switch from "Ingress" to "Gateway API" .
Then, for the purposes of testing, I would like to go back to "Ingress". Run helm again.
After sufficient time, change it back again to "Gateway API" again. Deploy helm.
In other words, switch back and forth. "Ingress" "Gateway" "Ingress" "Gateway". But not very quickly.
However, it gets bungled up. You can not do this. The load balancer won't be provisioned.
"Translation failed: invalid ingress spec: service "my_namespace/my_service" is type "ClusterIP", expected "NodePort" or "LoadBalancer";
What seems to happen is that each of those two front-ends automatically modify the annotations of the "service".
Ingress adds these annotations:
cloud.google.com/neg: '{"ingress":true}'
cloud.google.com/neg-status: '{"network_endpoint_groups":{"80":"k8s1-a9f7cc..."},"zones":["us-central1-a","us-central1-b","us-central1-f"]}'
Gateway adds these annotations:
cloud.google.com/neg: '{"exposed_ports":{"80":{}}}'
cloud.google.com/neg-status: '{"network_endpoint_groups":{"80":"k8s1-a9f7cc-..."},"zones":["us-central1-a","us-central1-b","us-central1-f"]}'
Perhaps the problem is that Gateway doesn't understand the ingress's annotations, and vice versa. In both cases, GKE is adding those dynamically.
Has anyone tried this test, of changing from Gateway to Ingress, repeatedly? The process can be as slow as necessary though.
Hi @sdarwin ,
When you use Ingress, it sets up a load balancer as a "LoadBalancer" to make your service accessible. However, with Gateway API, it could have different rules for the service type.
Try modifying your Helm chart to set the service type explicitly to "LoadBalancer" or "NodePort" when deploying with Ingress and set it to the expected type when deploying with Gateway API. Refer to the YAML below:
apiVersion: v1
kind: Service
metadata:
name: my_service
namespace: my_namespace
spec:
type: LoadBalancer # or NodePort
ports:
- port: 80
targetPort: 8080 # replace with your target port
selector:
app: my_app
Then, make different files for Helm values—one for Ingress and another for Gateway. In each file, put the right notes and settings for that specific API.
# values-ingress.yaml
ingress:
enabled: true
annotations:
ingress.cloud.google.com/neg: '{"ingress":true}'
ingress.cloud.google.com/neg-status: '{"network_endpoint_groups":{"80":"k8s1-a9f7cc..."},"zones":["us-central1-a","us-central1-b","us-central1-f"]}'
# values-gateway.yaml
gateway:
enabled: true
annotations:
gateway.cloud.google.com/neg: '{"exposed_ports":{"80":{}}}'
gateway.cloud.google.com/neg-status: '{"network_endpoint_groups":{"80":"k8s1-a9f7cc-..."},"zones":["us-central1-a","us-central1-b","us-central1-f"]}'
Then, deploy:
helm install my-release -f values-ingress.yaml my-chart
Make sure that the resources created by the previous deployment are deleted, before switching between Ingress and Gateway API. Use command "helm delete my-release".
Let me know if this helps.