On Windows, you can do a patch , but since it shows a JSON error, you should do this trick (using PowerShell):
> $imgsec= '{"imagePullSecrets": [{"name": "myregistrykey"}]}' | ConvertTo-Json > kubectl patch serviceaccount default -p $imgsec
Also, if you want to update / add imagePullSecret, you should use something like this:
> $imgsec= '[{"op":"add","path":"/imagePullSecrets/-","value":{"name":"myregistrykey2"}}]' | ConvertTo-Json > kubectl patch serviceaccount default --type='json' -p $imgsec
,
Paras patidar
source share