kubectl grab-resources command collects all resources from the cluster based on label input and export to a single YAML file.
- Why?
- Requirements
- How to install?
- How to use?
- Export your entire deployment
- Restore your deployment
- Demo
Simple command to collect all resources related to a specific label saving the output to a single YAML file.
Later, users can just use kubectl apply -f filename.yaml to restore the resources.
After installing krew and neat plugin, just copy kubectl-grab_resources to your $PATH/bin
$ kubectl grab-resources -l LABEL_NAME -o OUTPUT_FILENAME.yaml
$ kubectl grab-resources -l app=kibana -o kibana-2020-09-16-00:10:25.yaml
Example(s):
- user deleted kibana resources by mistake
Restoring:
$ kubectl apply -f kibana-2020-09-16-00:10:25.yaml