Skip to content

dougsland/kubectl-grab-resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 

Repository files navigation

KUBECTL GRAB RESOURCES

kubectl grab-resources command collects all resources from the cluster based on label input and export to a single YAML file.

Table of Contents

  1. Why?
  2. Requirements
  3. How to install?
  4. How to use?
  5. Export your entire deployment
  6. Restore your deployment
  7. Demo

Why

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.

Requirements

How to install?

After installing krew and neat plugin, just copy kubectl-grab_resources to your $PATH/bin

How to use?

$ kubectl grab-resources -l LABEL_NAME -o OUTPUT_FILENAME.yaml

Restore your resources

$ 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

Demo

grab-resources argocd

asciicast

grab-resources Kibana

asciicast