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

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

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

Kubernetes探测可以通过在Helm图表中使用pod容器规范中的'livenessProbe'和'readinessProbe'字段来定义,如下所示:

    containers:
      - name: my-app
        image: my-app-image
        livenessProbe:
          httpGet:
            path: /healthz
            port: http
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /readiness
            port: http
          initialDelaySeconds: 5
          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:

containers:
  - name: my-app
    image: my-app-image
    livenessProbe:
      httpGet:
        path: /healthz
        port: http
      initialDelaySeconds: 30
      periodSeconds: 10
    readinessProbe:
      httpGet:
        path: /readiness
        port: http
      initialDelaySeconds: 5
      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:

确定