I am trying to use kubectl run command to pull an image from private registry and run a command from that. But I don\'t see an option to specify image pull secret. It looks
On Windows, you can do patch, but as it shows a JSON error, you have to do this trick (using PowerShell):
> $imgsec= '{"imagePullSecrets": [{"name": "myregistrykey"}]}' | ConvertTo-Json
> kubectl patch serviceaccount default -p $imgsec
Also , if you want to update/ append imagePullSecret , then you should be using something like this :
> $imgsec= '[{"op":"add","path":"/imagePullSecrets/-","value":{"name":"myregistrykey2"}}]' | ConvertTo-Json
> kubectl patch serviceaccount default --type='json' -p $imgsec
.