Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何在kubernetes的liveness/redinessprobe中检查多个健康检查路径_Linux_Kubernetes_Devops_Health Check - Fatal编程技术网

Linux 如何在kubernetes的liveness/redinessprobe中检查多个健康检查路径

Linux 如何在kubernetes的liveness/redinessprobe中检查多个健康检查路径,linux,kubernetes,devops,health-check,Linux,Kubernetes,Devops,Health Check,我在kubernetes吊舱内运行4个服务,所有服务都在同一端口上运行,但每个服务的健康检查点都不同。我想在liveness/readiness probe中添加多个路径。 目前,我正在使用以下配置检查一个服务的运行状况。我想添加更多路径。我该怎么做?我尝试过使用二进制运算符(“/service1/health&&/service2/health&&/service3/health”),但这对我不起作用 livenessProbe: httpGet:

我在kubernetes吊舱内运行4个服务,所有服务都在同一端口上运行,但每个服务的健康检查点都不同。我想在liveness/readiness probe中添加多个路径。 目前,我正在使用以下配置检查一个服务的运行状况。我想添加更多路径。我该怎么做?我尝试过使用二进制运算符(“/service1/health&&/service2/health&&/service3/health”),但这对我不起作用

livenessProbe:
            httpGet:
              path: /service1/health 
              port: 8080
              httpHeaders:
              - name: Custom-Header
                value: iamalive
            initialDelaySeconds: 60
            failureThreshold: 5
            periodSeconds: 60
            timeoutSeconds: 120

你不能。我的意思是,从技术上讲,你可以使用exec探测器,在其中编写你自己的逻辑,但实际上你真的不需要这样做。如果您的4个服务是独立的,您应该为它们进行4个单独的部署。Kubernetes有时确实会强迫你重新构建你的系统,但每次这样做都会把你推向一个更好的系统:)

你有点做不到。我的意思是,从技术上讲,你可以使用exec探测器,在其中编写你自己的逻辑,但实际上你真的不需要这样做。如果您的4个服务是独立的,您应该为它们进行4个单独的部署。Kubernetes有时会强迫您重新构建系统,但每次这样做都会推动您朝着更好的系统迈进:)

我们通常在不同的容器或吊舱中运行不同的服务。我们通常在不同的容器或吊舱中运行不同的服务。