Welcome to the new Linux Foundation Forum!

Lab 15.1 helm - error updating the tiller-deploy deployment to have the service account

At step 7:
Update the tiller-deploy deployment to have the service account.
[email protected]:~$ kubectl -n kube-system patch deployment \
tiller-deploy -p \
’{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}’

Will produce error as JSON string incorrectly specified.
[email protected]:~$ kubectl -n kube-system patch deployment \

      tiller-deploy -p \
      ’{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}’

Error from server (BadRequest): json: cannot unmarshal string into Go value of type map[string]interface {}

Correct way to specify JSON:
kubectl -n kube-system patch deployment tiller-deploy -p "{\"spec\":{\"template\":{\"spec\":{\"serviceAccount\":\"tiller\"}}}}"

Comments

  • LOL the formatting of the above message is wonky, but the point is the quotes on the original lab command are wrong.
    You can't simply use single quotes around the whole string and double quotes within the JSON.
    You have to use double quotes everywhere and escape the ones that are part of the JSON.

  • chrispokornichrispokorni Posts: 104

    Hi, if you notice the single curly quotes in the pdf and also in the code snippet above, those are known to cause issues. By replacing the single curly quotes with single quote/apostrophe also solves the issue - this is what worked for me in several labs.

    Regards,
    -Chris

Sign In or Register to comment.