Kubernetes liveness probe logging recovery

后端 未结 1 1339
甜味超标
甜味超标 2021-01-26 09:59

I am trying to test a liveness probe while learning kubernetes. I have set up a minikube and configured a pod with a liveness probe.

Testing the script (E.g. via docker

相关标签:
1条回答
  • 2021-01-26 10:10

    I have been trying to increase the log level with no success by running variations like:

    minikube start --extra-config=apiserver.v=4
    minikube start --extra-config=kubectl.v=4
    minikube start --v=4
    

    @Bruce, none of the options mentioned by you will work as they are releted with other components of Kubernetes cluster and in the answer you referred to it was clearly said:

    The output of successful probes isn't recorded anywhere unless your Kubelet has a log level of at least --v=4, in which case it'll be in the Kubelet's logs.

    So you need to set -v=4 specifically for kubelet. In the official docs you can see that it can be started with specific flags including the one, changing default verbosity level of it's logs:

    -v, --v Level
    number for the log level verbosity
    

    Kubelet runs as a system service on each node so you can check it's status by simply issuing:

    systemctl status kubelet.service
    

    and if you want to see it's logs issue the command:

    journalctl -xeu kubelet.service
    

    Try:

    minikube start --extra-config=kubelet.v=4
    

    however I'm not 100% sure if Minikube is able to pass this parameter so you'll need to verify it on your own. If it doesn't work you should still be able to add it in kubelet configuration file, specifying parameters with which it is started (don't forget to restart your kubelet.service after submitting the changes, you simply need to run systemctl restart kubelet.service)

    Let me know if it helps and don't hesitate to ask additional questions if something is not completely clear.

    0 讨论(0)
提交回复
热议问题