Indranil Dey:
Hi,
I have a question regarding updating deployments.Suppose, there is pod configured in a deployment file with default serviceaccount.I have a created another service account,say X and now want to use it in the pod in the deployment file.
So, what i did i created a deployment file from the deployment using,
kubectl get deployment d -o yaml>deploy.yaml and then added,
the service account X under the spec.template.spec.serviceAccountName.
Now trying to run deploy.yaml,i get the error :
kubectl apply -f deployment.yaml
error: error parsing deployment.yaml: error converting YAML to JSON: yaml: line 43: found character that cannot start any token.
I have checked multiple times but not able to remove the error.
So,how to tackle such error efficiently with time or is there a better way to solve it using imperative commands?
todoriri:
it would be helpful if you paste the deployment yaml file contents here
unnivkn:
Hi…Please try this:
vim deploy.yaml
:43
:set list
you can find some junk character … remove it , save and try again.
if there are many junk character, then try this(replacing TAB character with 2-space’s from the entire file):
:%s/\t/ /g
1 Like