Search code examples
dockerkubernetesorientdbminikube

orientdb kubernetes readiness probe errored: gzip : invalid header


I am trying to create an orient db deployment on kubernetes cluster using the following yaml file using the orientdb:2.125 docker image from docker hub.

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

But I am getting the following message

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

How do I fix the readiness and liveness probe for orient db?


Solution

  • orientdb web application on port 2480 returns gzipped HTTP response, so you should add custom HTTP headers to support this into your httpGet livenessProbe and 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