kubernetes-sigs / node-feature-discovery

Node feature discovery for Kubernetes
Apache License 2.0
775 stars 240 forks source link

topologyupdater: more graceful exit on error #617

Closed marquiz closed 2 years ago

marquiz commented 3 years ago

What would you like to be added:

Currently, nfd-topology-updater exits with a cryptic backtrace if KubeletPodResourcesGetAllocatable feature gate hasn't been enabled in kubelet. Instead of this, nfd-topology-updater should provide a human-understandable error message, exiting more gracefully.

Why is this needed:

Do not confuse users with backtraces

we4tech commented 3 years ago

Hi @marquiz, Do you have any suggestions on how I can reproduce this step locally? Thanks

marquiz commented 3 years ago

Do you have any suggestions on how I can reproduce this step locally?

  1. Run kubelet with --feature-gates=KubeletPodResourcesGetAllocatable=false (this is the default so with default k8s deployment you should be ok)
  2. (In cloned NFD repo) deploy topology-updater, e.g. with `kubectl apply -k deployment/overlays/topologyupdater-job/``
  3. See the logs with kubectl -n node-feature-discovery logs <pod-name> and you should see an ugly backtrace
we4tech commented 3 years ago

/assign

we4tech commented 3 years ago

Thanks @marquiz , I'll work on it.