Reputation: 103
I have a GKE Ingress, set up according to this tutorial. It worked great for a few weeks, till I wanted to add a new rule to the YAML configuration.
The following error is shown and no ingress is created anymore:
Error syncing to GCP: error running backend syncing routine: googleapi: Error 404: The resource 'projects/<project_id>/zones/<zone>/networkEndpointGroups/<my-service>' was not found, notFound
I've simplified the yaml to only a single service, which still does not work anymore:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: basic-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
networking.gke.io/managed-certificates: "cluster-certificate"
kubernetes.io/ingress.class: "gce"
spec:
defaultBackend:
service:
name: webserver
port:
number: 3007
In the example above, no rules are defined, just the defaultBackend. Adding rules does not change the error; sometimes it only shows a different service. It also does not matter what service is used, all of the resources cannot be found.
However, the dashboard of the Ingress shows no errors about the services (all health-checks seem to pass):
I have been struggling for a while now, trying to use different services, use different rules, but I think I am missing something.
I am aware more information might be needed to help me, but I am not sure what to provide as it feels like I am searching in the dark. Please let me know!
-Update-
As can be seen below, the 'webserver' service looks good.
I have deleted and re-created the Ingress multiple times, but this does not have an effect. kubectl describe Ingress basic-ingress
shows the following:
Name: basic-ingress
Namespace: production
Address:
Default backend: webserver:3007 (10.6.128.139:3007)
Rules:
Host Path Backends
---- ---- --------
* * webserver:3007 (10.6.128.139:3007)
Annotations: ingress.gcp.kubernetes.io/pre-shared-cert: mcrt-065ca8b6-e85b-42ad-9113-6babe367a2d8
kubernetes.io/ingress.class: gce
kubernetes.io/ingress.global-static-ip-name: web-static-ip
networking.gke.io/managed-certificates: cluster-certificate
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Sync 3m48s (x3 over 3m48s) loadbalancer-controller Scheduled for sync
Warning Sync 31s (x16 over 3m30s) loadbalancer-controller Error syncing to GCP: error running backend syncing routine: googleapi: Error 404: The resource 'projects/<project_id>/zones/<zone>/networkEndpointGroups/<my-service>' was not found, notFound
kubectl get ingress basic-ingress
shows:
NAME CLASS HOSTS ADDRESS PORTS AGE
basic-ingress <none> * 80 6m34s
In the Network Services menu/Backend Services, the following is shown:
All other tabs are empty (so no load balancer is seen). It says that the service is not in-use by anything (see picture above).
Upvotes: 2
Views: 2654
Reputation: 59
Referring to the gcp link below, it need's to be global static IP.
Use an Ingress
If you choose to expose your application using an Ingress, which creates an HTTP(S) Load Balancer, you must reserve a global static IP address. Regional IP addresses do not work with Ingress.
gcloud compute addresses create global-static-ip --global
Upvotes: 0
Reputation: 103
I still do not understand why this was broken, or why the following fixed it.
I simplified my Ingress to not have any annotations and applied that:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: basic-ingress
spec:
defaultBackend:
service:
name: webserver
port:
number: 3007
This resulted in a working Ingress! After this, I added the networking.gke.io/managed-certificates: "cluster-certificate"
annotation, which still worked. Finally, I added the kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
.
My dev-website worked again.
Somehow, it looks like something went wrong and simply removing and re-applying did not fix it. Applying a very simple Ingress did fix it.
Upvotes: 1