Skip to content

Scripts to export all kubernetes manifests from your cluster.

Notifications You must be signed in to change notification settings

jonchen727/kubernetes-manifest-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-manifest-exporter

Scripts to export all kubernetes manifests from your cluster.

This comes in handy when you want to migrate a cluster, or use a gitbased config management tool such as kpt-config-sync or Anthos Config Management

Reqirements

Ensure that you have kubectl and are on the correct context for the cluster you want to export

You will need kubectl neat, this cleans the manifest files from excess metadata.

kubectl krew install neat

Visit the kubectl-neat repo page for more information on kubectl-neat.

Usage

Non-namespaced Resources

./nonnamespacebackup.sh

What it does

  1. Creates a folder named cluster
  2. Grabs all non-namespaced api resources
  3. Iterates through the resources to get names per resource
  4. Iterates through named resources and grabs the yaml output piping through kubectl neat
  5. Saves the yaml file to cluster/[resource]/[resource name].yaml

Name-spaced Resources

./namespacebackup.sh

What it does

  1. Creates a folder named namespaces
  2. Grabs all namespaced api resources
  3. Grabs all namespaces
  4. Iterates through each namespace
  5. Iterates through the resources to get names per resource
  6. Iterates through named resources and grabs the yaml output piping through kubectl neat
  7. Saves the yaml file to namespaces/[namespace name]/[resource]/[resource name].yaml

Note some kube api resources are deprecated/cannot be gotten with the kubectl get command.

About

Scripts to export all kubernetes manifests from your cluster.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages