502 Bad gateway: Hazelcast Management Center via GCE Ingress

Đang mở
#331 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
gcp, kubernetes
Lĩnh vực
cloud, infrastructure

Hướng nghiên cứu

Bắt đầu với Kubernetes YAML inline và tái tạo Management Center deployment phía sau một GCE Ingress, kiểm tra readiness response và trạng thái health của ingress backend. Hoàn tất khi service cung cấp một health check được GCE Ingress chấp nhận và backend được báo là healthy mà không phụ thuộc vào chuyển hướng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

For those of you who will be exposing Hazelcast Management Center (MC) via Google's Ingress GCE controller - be aware that GCE Ingress is expecting a working (should be 200 OK) readiness probe from the Service backing the MC Deployment.

I tried with the defaults and got 502 Bad gateway when accessing the exposed MC service. You can read about similar experience here.

Note also, that the default endpoint /hazelcast-mancenter returns 302 Found, which is ok for the readiness probe, but apparently not for GCE Ingress. The quick hack would be to use either /hazelcast-mancenter/index.html or /hazelcast-mancenter/. But in the long term I would propose to implement a dedicated health probe, e.g. /health or /healthz, etc.

So 302 Found is ok for checking the readiness of the Service, but if you check the status of the ingress, you will probably see the UNHEALTHY status:

k describe ing mc-ingress
Name:             mc-ingress
Namespace:        default
Address:          34.98.YYY.2
Default backend:  mc-service:8080 (10.52.2.23:8080)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *     *     mc-service:8080 (10.52.2.23:8080)
Annotations:  
  ingress.kubernetes.io/backends:  {"k8s-be-32517--47d3253409234a5d":"UNHEALTHY"}
Events:                            <none>

Here is a working yaml:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mc-volume
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mc
  labels:
    app: hazelcast
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hazelcast
  template:
    metadata:
      labels:
        app: hazelcast
    spec:
      containers:
        - name: mc
          image: hazelcast/management-center
          resources:
            limits:
              memory: 1Gi
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /hazelcast-mancenter/
              port: 8080
          readinessProbe:
            httpGet:
              path: /hazelcast-mancenter/
              port: 8080
          volumeMounts:
            - name: mc-storage
              mountPath: /data
      volumes:
        - name: mc-storage
          persistentVolumeClaim:
            claimName: mc-volume
---
apiVersion: v1
kind: Service
metadata:
  name: mc-service
spec:
  type: NodePort
  selector:
    app: hazelcast
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mc-ingress
  labels:
    app: hazelcast
spec:
  backend:
    serviceName: mc-service
    servicePort: 8080

P.S. Nginx Ingress doesn't have such issue. But a dedicated health endpoint is a nice to have non the less.

Ngôn ngữ chính
Java
Star
558
Fork
599
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hazelcast/hazelcast-code-samples

Tất cả issue của hazelcast/hazelcast-code-samples

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.