CmdID / kubectl / kubectl set
kubectl set serviceaccount
Update the service account of a resource kubectl reference
12 options
Also kubectl set sa
Its page in the kubectl reference
Options
--allSelect all resources, in the namespace of the specified resource types--allow-missing-template-keysIf true, ignore any errors in templates when a field or map key is missing in the template.--dry-runMust be "none", "server", or "client".--field-managerName of the manager used to track field ownership.--filename, -fFilename, directory, or URL to files identifying the resource to get from a server.--help, -hhelp for serviceaccount--kustomize, -kProcess the kustomization directory.--localIf true, set serviceaccount will NOT contact api-server but run locally.--output, -oOutput format.--recursive, -RProcess the directory used in -f, --filename recursively.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--templateTemplate string or path to template file to use when -o=go-template, -o=go-template-file.