Welcome to the Linux Foundation Forum!

Exercise 5.6

I try to edit kube-apiserver.yaml as instructed in the lab manual. I find out that whenever I try to add a new and valid entry into the yaml, apiserver will fail to startup. Did you come across this? Any hints to me here? thx a lot

Comments

  • chrispokorni
    chrispokorni Posts: 1,608

    Hi @vwong,

    I have run into a similar issue recently, and it took me several attempts at the same exercise to get the kube-apiserver to start after editing its YAML definition file. Backing up the original YAML file helps also to be able to re-start the process from a working config file.

    Regards,
    -Chris

  • dnx
    dnx Posts: 30
    edited October 2021

    If there is an error starting the API server try checking the logs:

    sudo cat /var/log/containers/kube-apiserver-*
    

    Creating a copy to restore to is a great practice.

  • vwong
    vwong Posts: 16

    thx Chris, dnx; i used to have vi as editor; I just use vim to try again, and the apiserver works now. I think it is some "hidden" characters when editing by vi

  • serewicz
    serewicz Posts: 997

    Great point dnx! Logs from the container perspective as well as journalctl -u kubelet output can be very helpful in figuring out where an issue may be.

    As well, as Chris mentioned, a good practice is to copy a file prior to editing so you have something to go back to if you are several edits in, and lose track of what may have happened, or insert a non-printable character.

    If you ever want to view and check for a non-printable character you can examine the text with cat -vet

    Regards,

Categories

Upcoming Training