首页 > 解决方案 > 当容器遇到设备错误时,它告诉 kubernetes 的最佳方法是什么?

问题描述

给定一个运行中的容器,该容器已分配给一个到多个 SRIOV 设备,由集群主控器上的调度程序在启动期间分配,如果使用该设备的容器应用程序遇到设备超时,它应该如何报告错误到 Kubernetes?

这几乎就像一个 HA 事件之类的事情......所以从应用程序的角度来看,也许有最好的方法来做到这一点?

标签: kubernetes

解决方案


Kubernetes Liveness 和 Readiness Probes可用于执行此操作:

    livenessProbe:
      exec:
        command:
        - <command or HTTP GET to check SRIOV device timeout>
      initialDelaySeconds: 5
      periodSeconds: 5

    readinessProbe:
      exec:
        command:
        - <command or HTTP GET to check SRIOV device timeout>
      initialDelaySeconds: 5
      periodSeconds: 5

以下是检查 pod 运行状况的更多链接:


推荐阅读