0

我有一个 Angular 应用程序,它部署在 Kubernetes 上运行的 apache 容器上。我想为 pod 设置活跃度和就绪性探测,但我没有想法。任何帮助将不胜感激。

4

1 回答 1

2

根据您提供的链接,您可以使用以下内容作为开始:

apiVersion: v1
kind: Pod
...
spec:
  ...
  containers:
  - name: ...
    ...
    livenessProbe:
      tcpSocket:
        port: 80               # <-- live when your web server is running
      initialDelaySeconds: 5   # <-- wait 5s before starting to probe
      periodSeconds: 20        # <-- do this probe every 20 seconds
    readinessProbe:
      httpGet:
        path: /                # <-- ready to accept connection when your home page is serving
        port: 80
      initialDelaySeconds: 15
      periodSeconds: 10
      failureThreshold: 3      # <-- must not fail > 3 probes
于 2022-02-11T11:11:19.117 回答