Google cloud platform 无法创建gcp入口-同步期间出错:运行后端同步例程时出错:googleapi:获取HTTP响应代码404,正文:未找到

Google cloud platform 无法创建gcp入口-同步期间出错:运行后端同步例程时出错:googleapi:获取HTTP响应代码404,正文:未找到,google-cloud-platform,kubernetes-ingress,pulumi,Google Cloud Platform,Kubernetes Ingress,Pulumi,我正在尝试一个简单的gke入门。 仿效 吊舱已启动并运行,服务处于活动状态。当我创建入口时,我会 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal ADD 48m loadba

我正在尝试一个简单的gke入门。 仿效

吊舱已启动并运行,服务处于活动状态。当我创建入口时,我会

Events:
  Type     Reason  Age                  From                     Message
  ----     ------  ----                 ----                     -------
  Normal   ADD     48m                   loadbalancer-controller  default/my-ingress
  Warning  Sync    2m32s (x25 over 48m)  loadbalancer-controller  Error during sync: Error running backend syncing routine: googleapi: got HTTP response code 404 with body: Not Found
我找不到问题的根源。有没有关于去哪里找的建议

我已检查群集加载项和权限
httploadbalanced已启用

  - https://www.googleapis.com/auth/compute
  - https://www.googleapis.com/auth/devstorage.read_only
  - https://www.googleapis.com/auth/logging.write
  - https://www.googleapis.com/auth/monitoring
  - https://www.googleapis.com/auth/servicecontrol
  - https://www.googleapis.com/auth/service.management.readonly
  - https://www.googleapis.com/auth/trace.append

看起来您缺少默认入口控制器的默认后端(L7-HTTTP LoadBalancer)。从我观察到的情况来看,当您在GKE集群中启用了Istio插件时,它不会部署(Istio有自己的默认入口/出口网关)

请验证它是否已在群集中启动并运行:

kubectl get pod -n kube-system | grep l7-default-backend 

这篇文章的作者最终发现,这个问题只有在集群使用引导时才会存在。

您的GKE集群中是否配置了任何其他入口控制器(如nginx入口)?您是否自行为“我的入口”资源创建了“kubernetes.io/ingres.class:gce”注释,还是自动创建的?它是入口定义的一部分<代码>apiVersion:extensions/v1beta1种类:入口元数据:名称:我的入口注释:kubernetes.io/ingres.class:“gce”没有其他入口控制器。注释是入口定义的一部分。使用/不使用相同的结果进行了尝试。它存在,但是没有看到任何日志
rg-dev-europe-west4-1>kubectl get pod-n kube system | grep l7 default backend l7-default-backend-7ff48cffd7-rk4mq 1/1运行0 1h
在loadbalancer pod内是否观察到任何错误?(kubectl日志l7-default-backend-7ff48cffd7-rk4mq)请在下面找到gce入口故障排除指南的链接。不幸的是,我没有看到任何日志,继续四处挖掘,谢谢。我忘了提到最重要的事情,这个GKE教程中的ingress示例对我来说很好。请尝试创建以下入口资源,仅使用基于原始清单文件示例的单路径声明(对于我来说,loadbalancer后端启动需要几分钟)。输出:你好,世界!版本:2.0.0主机名:hello-world-deployment-5cfbc486f-295hn问题似乎在我创建集群的方式上。如果我使用console创建集群,那么ingress可以正常工作。如果使用pulumi构建集群,则会失败。
Name:                     hello-world
Namespace:                default
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"hello-world","namespace":"default"},"spec":{"ports":[{"port":6000...
Selector:                 department=world,greeting=hello
Type:                     NodePort
IP:                       10.59.254.88
Port:                     <unset>  60000/TCP
TargetPort:               50000/TCP
NodePort:                 <unset>  30418/TCP
Endpoints:                10.56.2.7:50000,10.56.3.6:50000,10.56.6.4:50000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>
Name:                     hello-kubernetes
Namespace:                default
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"hello-kubernetes","namespace":"default"},"spec":{"ports":[{"port"...
Selector:                 department=kubernetes,greeting=hello
Type:                     NodePort
IP:                       10.59.251.189
Port:                     <unset>  80/TCP
TargetPort:               8080/TCP
NodePort:                 <unset>  32464/TCP
Endpoints:                10.56.2.6:8080,10.56.6.3:8080,10.56.8.6:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>
Name:             my-ingress
Namespace:        default
Address:
Default backend:  default-http-backend:80 (10.56.0.9:8080)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *
        /*      hello-world:60000 (<none>)
        /kube   hello-kubernetes:80 (<none>)
Annotations:
  kubectl.kubernetes.io/last-applied-configuration:  {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{"kubernetes.io/ingress.class":"gce"},"name":"my-ingress","namespace":"default"},"spec":{"rules":[{"http":{"paths":[{"backend":{"serviceName":"hello-world","servicePort":60000},"path":"/*"},{"backend":{"serviceName":"hello-kubernetes","servicePort":80},"path":"/kube"}]}}]}}

  kubernetes.io/ingress.class:  gce
Events:
  Type     Reason  Age                  From                     Message
  ----     ------  ----                 ----                     -------
  Normal   ADD     107s                 loadbalancer-controller  default/my-ingress
  Warning  Sync    66s (x15 over 107s)  loadbalancer-controller  Error during sync: Error running backend syncing routine: googleapi: got HTTP response code 404 with body: Not Found
                {
                    "name": "test-cluster",
                    "region": "europe-west4",
                    "addonsConfig": {
                        "httpLoadBalancing": {
                            "disabled": false
                        },
                        "kubernetesDashboard": {
                            "disabled": false
                        }
                    },
                    "ipAllocationPolicy": {},
                    "pools": [
                        {
                            "name": "default-pool",
                            "initialNodeCount": 1,
                            "nodeConfig": {
                                "oauthScopes": [
                                    "https://www.googleapis.com/auth/compute",
                                    "https://www.googleapis.com/auth/devstorage.read_only",
                                    "https://www.googleapis.com/auth/service.management",
                                    "https://www.googleapis.com/auth/servicecontrol",
                                    "https://www.googleapis.com/auth/logging.write",
                                    "https://www.googleapis.com/auth/monitoring",
                                    "https://www.googleapis.com/auth/trace.append",
                                    "https://www.googleapis.com/auth/cloud-platform"
                                ],
                                "machineType": "n1-standard-1",
                                "labels": {
                                    "pool": "api-zero"
                                }
                            },
                            "management": {
                                "autoUpgrade": false,
                                "autoRepair": true
                            },
                            "autoscaling": {
                                "minNodeCount": 1,
                                "maxNodeCount": 20
                            }
                        },
                        {
                            "name": "outbound",
                            "initialNodeCount": 2,
                            "nodeConfig": {
                                "machineType": "custom-1-1024",
                                "oauthScopes": [
                                    "https://www.googleapis.com/auth/compute",
                                    "https://www.googleapis.com/auth/devstorage.read_only",
                                    "https://www.googleapis.com/auth/service.management",
                                    "https://www.googleapis.com/auth/servicecontrol",
                                    "https://www.googleapis.com/auth/logging.write",
                                    "https://www.googleapis.com/auth/monitoring",
                                    "https://www.googleapis.com/auth/trace.append",
                                    "https://www.googleapis.com/auth/cloud-platform"
                                ],
                                "labels": {
                                    "pool": "outbound"
                                }
                            },
                            "management": {
                                "autoUpgrade": false,
                                "autoRepair": true
                            }
                        }
kubectl get pod -n kube-system | grep l7-default-backend