Reputation: 33921
How can I export a single kubectl context?
My current kubectl config file has multiple contexts defined, and it would be tedious manual process to try isolate the single context from the rest.
Is this supported?
Upvotes: 6
Views: 5321
Reputation: 1344
I find the previous answer incomplete. To extract a context fron the current configuration file you may use the following command and flags.
kubectl config view --minify --flatten --context=mycontext > mycontext.ctx
Upvotes: 6
Reputation: 18373
kubectl config view --minify
will remove all information not used by current-context from the output
Upvotes: 19