在Helm中,您可以定义探针(probes)吗?

huangapple go评论65阅读模式
英文:

Can you define probes in Helm?

问题

我正在尝试确定是否可以在Helm图表中配置Kubernetes探针。我看到了一些关于这个问题的Git问题,但它们涉及特定的项目。Helm是否有一种标准的方式允许配置探针?

英文:

I'm trying to figure out if you can configure Kubernetes probes in Helm charts. I've seen some Git issues about this, but they concerned specific projects. Is there a standard way in which Helm allows for the configuration of probes?

答案1

得分: 1

  1. Kubernetes探测可以通过在Helm图表中使用pod容器规范中的'livenessProbe''readinessProbe'字段来定义,如下所示:
  2. containers:
  3. - name: my-app
  4. image: my-app-image
  5. livenessProbe:
  6. httpGet:
  7. path: /healthz
  8. port: http
  9. initialDelaySeconds: 30
  10. periodSeconds: 10
  11. readinessProbe:
  12. httpGet:
  13. path: /readiness
  14. port: http
  15. initialDelaySeconds: 5
  16. periodSeconds: 5
英文:

Kubernetes probes can be defined in Helm charts by using the 'livenessProbe' and 'readinessProbe' fields in the pod's container spec like so:

  1. containers:
  2. - name: my-app
  3. image: my-app-image
  4. livenessProbe:
  5. httpGet:
  6. path: /healthz
  7. port: http
  8. initialDelaySeconds: 30
  9. periodSeconds: 10
  10. readinessProbe:
  11. httpGet:
  12. path: /readiness
  13. port: http
  14. initialDelaySeconds: 5
  15. periodSeconds: 5

huangapple
  • 本文由 发表于 2023年2月14日 18:57:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75446849.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定