无法解决 GKE 集群中托管的端口 3310、7357 上的 clamAV:1.2 部署的健康检查相关问题。
面对部分后端服务处于UNHEALTHY状态,在ingress后添加对服务定义的路由路径。
我已经通过以下方式在 GKE 集群中部署了 clamAV:1.2 docker 镜像部署文件。
apiVersion: apps/v1
kind: Deployment
metadata:
name: clam-av
spec:
replicas: 1
selector:
matchLabels:
run: clam-av
template:
metadata:
labels:
run: clam-av
spec:
nodeSelector:
cloud.google.com/gke-nodepool: XXX-XXX-pool
terminationGracePeriodSeconds: 60
containers:
- name: clamav-container
image: clamav/clamav:1.2
resources:
requests:
cpu: 200m
memory: 1Gi
imagePullPolicy: Always
ports:
- containerPort: 3310
# - containerPort: 7357
创建了一个服务文件对于此部署:
apiVersion: v1
kind: Service
metadata:
name: clam-av-service
annotations:
cloud.google.com/backend-config: '{"default": "backend-for-clamAV"}'
spec:
selector:
run: clam-av
ports:
- name: http3310
protocol: TCP
port: 80
targetPort: 3310
# - name: http7357
# protocol: TCP
# port: 80
# targetPort: 7357
type: ClusterIP
还创建了一个后端配置:
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: backend-for-clamAV
spec:
timeoutSec: 150
connectionDraining:
drainingTimeoutSec: 150
healthCheck:
checkIntervalSec: 15
port: 80
type: HTTP
requestPath: /
healthyThreshold: 1
unhealthyThreshold: 3
timeoutSec: 15
尝试将 spec.healthcheck.type 设置为 TCP,因为 clamAV 3310 是 TCP 连接。但 GCP 入口不支持 TCP。
任何解决此问题的建议都将受到赞赏。谢谢!