【问题标题】:orientdb kubernetes readiness probe errored: gzip : invalid headerorientdb kubernetes 准备探测错误:gzip:无效标头
【发布时间】:2018-01-26 14:42:50
【问题描述】:

我正在尝试使用来自 docker hub 的 orientdb:2.125 docker 映像使用以下 yaml 文件在 kubernetes 集群上创建一个 orient db 部署。

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: orientdb
  namespace: default
  labels:
    name: orientdb
spec:
  replicas: 2
  revisionHistoryLimit: 100
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  minReadySeconds: 5
  template:
    metadata:
      labels:
        service: orientdb
    spec:
      containers:
        # Custom pod name.
      - name: orientdb-node
        image: orientdb:2.1.25
        imagePullPolicy: Always
        ports:
        - name: http-port
          containerPort: 2480 # WEB port number.
        - name: binary-port
          containerPort: 2424
        livenessProbe:
          httpGet:
            path: /
            port: http-port
          initialDelaySeconds: 60
          timeoutSeconds: 30
        readinessProbe:
          httpGet:
            path: /
            port: http-port
          initialDelaySeconds: 5
          timeoutSeconds: 5

但我收到以下消息

Readiness probe errored: gzip: invalid header
Liveness probe errored: gzip: invalid header

如何修复 orient db 的就绪和活跃度探测?

【问题讨论】:

    标签: docker kubernetes orientdb minikube


    【解决方案1】:

    orientdb web 应用程序在 2480 端口返回 gzip 后的 HTTP 响应,因此您应该添加自定义 HTTP 标头以支持此功能到您的 httpGet livenessProbe 和 readinessProbe:

    livenessProbe:
      httpGet:
        path: /
        port: http-port
        httpHeaders:
        - name: Accept-Encoding
          value: gzip
      initialDelaySeconds: 60
      timeoutSeconds: 30
    readinessProbe:
      httpGet:
        path: /
        port: http-port
        httpHeaders:
        - name: Accept-Encoding
          value: gzip
      initialDelaySeconds: 5
      timeoutSeconds: 5
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-19
      • 2018-07-10
      • 1970-01-01
      • 2018-11-27
      • 2023-03-18
      • 2022-07-28
      相关资源
      最近更新 更多