本文介绍了安装Eclipse CHE后,GKE上的inress-nginx-Controller返回状态302 err_Too_My_Redirects的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Helm在生成的URL上请求CHE-Dashboard时,我收到302个ERR_TOO_MANY_REDIRECTS。

我已使用以下链接安装了Eclipse CHE:

https://www.eclipse.org/che/docs/che-7/installation-guide/installing-che-on-google-cloud-platform/

这将安装多个服务,如仪表盘、键盘遮盖、插件注册表等。其中仅有CHE仪表板返回302ERR_TOO_MANY_REDIRECTS,URL的睡觉运行正常。

che-dashboard服务返回200 OK,但inress-nginx-Controller返回302重定向。PFB日志和YAML文件。

车载仪表板服务日志:

2021-06-21 15:06:05.531 IST10.112.3.1 - - [21/Jun/2021:09:36:05 +0000] "GET /dashboard/ HTTP/1.1" 200 696
Info
2021-06-21 15:06:08.233 IST10.112.3.1 - - [21/Jun/2021:09:36:08 +0000] "GET /dashboard/ HTTP/1.1" 200 696
Info
2021-06-21 15:06:15.532 IST10.112.3.1 - - [21/Jun/2021:09:36:15 +0000] "GET /dashboard/ HTTP/1.1" 200 696
Info
2021-06-21 15:06:18.233 IST10.112.3.1 - - [21/Jun/2021:09:36:18 +0000] "GET /dashboard/ HTTP/1.1" 200 696
Info
2021-06-21 15:06:25.531 IST10.112.3.1 - - [21/Jun/2021:09:36:25 +0000] "GET /dashboard/ HTTP/1.1" 200 696
Info
2021-06-21 15:06:28.233 IST10.112.3.1 - - [21/Jun/2021:09:36:28 +0000] "GET /dashboard/ HTTP/1.1" 200 696

车-仪表板YAML:

apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: che
    meta.helm.sh/release-namespace: eclipse-che
  creationTimestamp: "2021-06-07T17:57:40Z"
  labels:
    app: che
    app.kubernetes.io/managed-by: Helm
    component: che-dashboard
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:meta.helm.sh/release-name: {}
          f:meta.helm.sh/release-namespace: {}
        f:labels:
          .: {}
          f:app: {}
          f:app.kubernetes.io/managed-by: {}
          f:component: {}
      f:spec:
        f:ports:
          .: {}
          k:{"port":8080,"protocol":"TCP"}:
            .: {}
            f:name: {}
            f:port: {}
            f:protocol: {}
            f:targetPort: {}
        f:selector:
          .: {}
          f:app: {}
          f:component: {}
        f:sessionAffinity: {}
        f:type: {}
    manager: Go-http-client
    operation: Update
    time: "2021-06-07T17:57:40Z"
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:spec:
        f:ports:
          k:{"port":443,"protocol":"TCP"}:
            .: {}
            f:name: {}
            f:port: {}
            f:protocol: {}
            f:targetPort: {}
    manager: GoogleCloudConsole
    operation: Update
    time: "2021-06-13T04:44:42Z"
  name: che-dashboard
  namespace: eclipse-che
  resourceVersion: "6305578"
  selfLink: /api/v1/namespaces/eclipse-che/services/che-dashboard
  uid: cf8c6e75-1153-43db-b7f2-678f6bb927b9
spec:
  clusterIP: 10.115.242.109
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 8080
  - name: https
    port: 443
    protocol: TCP
    targetPort: 443
  selector:
    app: che
    component: che-dashboard
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

inress-nginx-Controller日志:

2021-06-21 13:47:18.499 IST171.61.57.210 - - [21/Jun/2021:08:17:18 +0000] "GET /dashboard/ HTTP/2.0" 302 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36" 22 0.001 [eclipse-che-che-host-8080] [] 10.112.4.3:8080 0 0.001 302 e9ffe655a67304f9a34ad623f1b2cfb1
Info
2021-06-21 13:47:18.707 IST171.61.57.210 - - [21/Jun/2021:08:17:18 +0000] "GET /dashboard/ HTTP/2.0" 302 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36" 22 0.001 [eclipse-che-che-host-8080] [] 10.112.4.3:8080 0 0.001 302 db12deeebd652964501ed94de4f8804b
Info
2021-06-21 13:47:18.911 IST171.61.57.210 - - [21/Jun/2021:08:17:18 +0000] "GET /dashboard/ HTTP/2.0" 302 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36" 22 0.001 [eclipse-che-che-host-8080] [] 10.112.4.3:8080 0 0.000 302 af3de97363a4912f8e1f24f0bbd51913

inress-nginx-Controller YAML

apiVersion: v1
kind: Service
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"app.kubernetes.io/component":"controller","app.kubernetes.io/instance":"ingress-nginx","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"ingress-nginx","app.kubernetes.io/version":"0.41.0","helm.sh/chart":"ingress-nginx-3.8.0"},"name":"ingress-nginx-controller","namespace":"ingress-nginx"},"spec":{"externalTrafficPolicy":"Local","ports":[{"name":"http","port":80,"protocol":"TCP","targetPort":"http"},{"name":"https","port":443,"protocol":"TCP","targetPort":"https"}],"selector":{"app.kubernetes.io/component":"controller","app.kubernetes.io/instance":"ingress-nginx","app.kubernetes.io/name":"ingress-nginx"},"type":"LoadBalancer"}}
  creationTimestamp: "2021-06-02T08:12:38Z"
  finalizers:
  - service.kubernetes.io/load-balancer-cleanup
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/version: 0.41.0
    helm.sh/chart: ingress-nginx-3.8.0
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:kubectl.kubernetes.io/last-applied-configuration: {}
        f:labels:
          .: {}
          f:app.kubernetes.io/component: {}
          f:app.kubernetes.io/instance: {}
          f:app.kubernetes.io/managed-by: {}
          f:app.kubernetes.io/name: {}
          f:app.kubernetes.io/version: {}
          f:helm.sh/chart: {}
      f:spec:
        f:externalTrafficPolicy: {}
        f:ports:
          .: {}
          k:{"port":80,"protocol":"TCP"}:
            .: {}
            f:name: {}
            f:port: {}
            f:protocol: {}
            f:targetPort: {}
          k:{"port":443,"protocol":"TCP"}:
            .: {}
            f:name: {}
            f:port: {}
            f:protocol: {}
            f:targetPort: {}
        f:selector:
          .: {}
          f:app.kubernetes.io/component: {}
          f:app.kubernetes.io/instance: {}
          f:app.kubernetes.io/name: {}
        f:sessionAffinity: {}
        f:type: {}
    manager: kubectl-client-side-apply
    operation: Update
    time: "2021-06-02T08:12:38Z"
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:finalizers:
          .: {}
          v:"service.kubernetes.io/load-balancer-cleanup": {}
      f:status:
        f:loadBalancer:
          f:ingress: {}
    manager: kube-controller-manager
    operation: Update
    time: "2021-06-02T08:13:27Z"
  name: ingress-nginx-controller
  namespace: ingress-nginx
  resourceVersion: "3164"
  selfLink: /api/v1/namespaces/ingress-nginx/services/ingress-nginx-controller
  uid: 17eb1fd5-fbbc-40aa-a0c9-d1020f21e635
spec:
  clusterIP: 10.115.245.45
  externalTrafficPolicy: Local
  healthCheckNodePort: 31646
  ports:
  - name: http
    nodePort: 30508
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 31341
    port: 443
    protocol: TCP
    targetPort: https
  selector:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/name: ingress-nginx
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: 34.76.122.126

如果需要,我可以提供更多详细信息。提前感谢

推荐答案

该问题似乎已在最新版本中修复https://github.com/eclipse/che/issues/19914

修复方法是将入口路径从/dashboard/*修复为/dashboard/。请参见https://github.com/eclipse-che/che-server/pull/20

我不确定您需要的入口控制器,以上是针对nginx的,如果您有不同的入口控制器,您可能需要配置您的值。

如果对您无效,请通知我们。

这篇关于安装Eclipse CHE后,GKE上的inress-nginx-Controller返回状态302 err_Too_My_Redirects的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-20 23:16