I am hosting my application using GKE and configured Ingress using YAML to create load balancing and redirect HTTP to HTTPS using FrontendConfig. The configuration has been working well for the past year. However, a couple of months ago, I noticed that the HTTP to HTTPS redirection stopped working.
Here are the steps I’ve taken to troubleshoot the issue:
Checked my load balancer’s health checks, and all were green.
Reviewed the Ingress logs but did not find anything abnormal.
Tried deleting the FrontendConfig and recreating it. However, I wasn’t able to achieve this because the Ingress automatically recreates them. When I try to edit them, I receive an error stating that the static IP is invalid because it is used by another resource. I understand that the Ingress keeps reserving it even if the FrontendConfig is deleted.
Deleted and reapplied the Ingress configuration, but the issue persists.
Note: The Service’s annotation, cloud.google.com/neg: ‘{“ingress”: true}’, enables container-native load balancing. However, the load balancer is not created until you create an Ingress for the Service.
Cabianca, Dario. Google Cloud Platform (GCP) Professional Cloud Network Engineer Certification Companion: Learn and Apply Network Design Concepts to Prepare for the Exam (Certification Study Companion Series) (p. 387). Apress. Kindle Edition.
You should run the aforementioned command one for your deployment, one for your service and one for your ingress resource kinds.
Upon completing you should have:
A global external HTTP(S) load balancer (classic). 2. A target HTTP(S) proxy. 3. A backend service in each zone. 4. A global health check attached to the backend service. 5. A Network Endpoint Group (NEG). The endpoints in the NEG and the endpoints of the Service are kept in sync.
A detailed walkthrough of this setup is described in my book:
Cabianca, Dario. Google Cloud Platform (GCP) Professional Cloud Network Engineer Certification Companion: Learn and Apply Network Design Concepts to Prepare for the Exam (Certification Study Companion Series) (p. 388). Apress. Kindle Edition.