Code Monkey home page Code Monkey logo

kubernetes-manifest-exporter's Introduction

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.

kubernetes-manifest-exporter's People

Contributors

jonchen727 avatar

Stargazers

Sascha Hesse avatar Julius Oh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.