I went through the documentation to edit kubernetes resource using kubectl edit
command. Once I execute the command, the file in YAML-format is opened in the editor where I can change the values as per requirement and save it. I am trying to execute these steps by means of sed
. How can the following steps be achieved?
- Execute
kubectl edit
for a deployment resource - Set a value from
true
tofalse
(using sed) - Save the changes
I tried to achieve this in the following way :
$ kubectl edit deployment tiller-deploy -n kube-system | \
sed -i "s/\(automountServiceAccountToken:.*$\)/automountServiceAccountToken: true/g"`