Kubernetes nginx入口控制器在尝试获取服务的端点时抛出错误

Kubernetes nginx入口控制器在尝试获取服务的端点时抛出错误,kubernetes,google-cloud-platform,google-kubernetes-engine,kubernetes-ingress,nginx-ingress,Kubernetes,Google Cloud Platform,Google Kubernetes Engine,Kubernetes Ingress,Nginx Ingress,我试图在谷歌云平台上的Kubernetes上设置微服务。我已经创建了部署、集群和入口配置文件 首先,在创建集群之后,我运行这个命令来安装nginxingres helm install my-nginx stable/nginx-ingress --set rbac.create=true 我使用helmv3 然后应用部署和集群配置 部署和群集配置: apiVersion: apps/v1 kind: Deployment metadata: name: app-production-de

我试图在谷歌云平台上的Kubernetes上设置微服务。我已经创建了
部署
集群
入口
配置文件

首先,在创建集群之后,我运行这个命令来安装
nginx
ingres

helm install my-nginx stable/nginx-ingress --set rbac.create=true
我使用
helmv3

然后应用部署和集群配置

部署和群集配置:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-production-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      component: app-production
  template:
    metadata:
      labels:
        component: app-production
    spec:
      containers:
        - name: app-production
          image: eu.gcr.io/my-project/app:1.0
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: app-production-cluser-ip-service
spec:
  type: ClusterIP
  selector:
    component: app-production
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
我的入口配置是:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - host: app.example.com
      http:
        paths:
          - path: /
            backend:
              serviceName: app-production-cluster-ip-service
              servicePort: 80
我从使用ingress controller的Google云平台日志中获得此错误:

Error obtaining Endpoints for Service "default/app-production-cluster-ip-service": no object matching key "default/app-production-cluster-ip-service" in local store
但当我执行
kubectl get endpoints
命令时,输出如下:

NAME                                          ENDPOINTS                     AGE
app-production-cluser-ip-service              10.60.0.12:80,10.60.1.13:80   17m

我真的不确定我做错了什么。

入口中提到的服务名称不匹配。请重新创建服务并检查

    apiVersion: v1
    kind: Service
    metadata:
      name: app-production-cluster-ip-service
    spec:
      type: ClusterIP
      selector:
        component: app-production
      ports:
        - port: 80
          targetPort: 80
          protocol: TCP

入口中提到的服务名称不匹配。请重新创建服务并检查

    apiVersion: v1
    kind: Service
    metadata:
      name: app-production-cluster-ip-service
    spec:
      type: ClusterIP
      selector:
        component: app-production
      ports:
        - port: 80
          targetPort: 80
          protocol: TCP
这可能是简单的输入错误“应用程序生产群集ip服务”与“应用程序生产群集ip服务”(缺少t)?这可能是简单的输入错误“应用程序生产群集ip服务”与“应用程序生产群集ip服务”(缺少t)?