Welcome to the Linux Foundation Forum!

5.4.7 - unable to edit deployment try1

I'm unable to edit the try1 deployment and change image to
10.106.50.123:5000/simpleapp:v3. Has anyone else had this problem?

sudo kubectl edit deployment try1 doesn't seem to work either

Answers

  • Hi @tstaffordsmith,

    Since there are no instructions to configure kubectl for root, using sudo will not help with kubectl commands.

    Such errors are not common, but they do happen every now and then.

    You could make a copy of the tmp yaml manifest, then delete the original try1 deployment, recreate the try1 deployment with the first/original simpleapp image, then cleanup the backed up tmp file and (if it includes the desired v2 or v3 image) use it to trigger an update.

    If this approach fails, and the kubectl edit deployment is still not successful, you could try the kubectl set image command instead, to trigger the update:

    kubectl set image deployment try1 simpleapp=10.106.50.123:5000/simpleapp:v3 --record=true

    Regards,
    -Chris

  • lf1d
    lf1d Posts: 13

    I just completed this lab yesterday and the same thing happened to me.

    For whatever reason, when using kubectl edit, the line being modified while shift to the right 2 spaces, making the YAML invalid. The solution for me was to move the cursor to the beginning of the line and remove those two additional spaces.

  • The configuration in Vim (I'm using Ubuntu 22.04 LTS in GCE) is problematic in that it alters your indentation most unhelpfully.

    I put the following in ~/.vimrc

    autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
    

Categories

Upcoming Training