我正在尝试使用以下yaml文件在kubernetes集群上使用orientdb:2.125来自docker hub的docker镜像在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的“就绪性和活跃性”探针?
最佳答案
端口2480上的orientdb Web应用程序返回gzip压缩的HTTP响应,因此您应在httpGet
livenessProbe和readinessProbe中添加自定义HTTP header 以支持此操作:
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
关于docker - orientdb kubernetes准备就绪探针错误:gzip:无效的 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48451003/