Coder Social home page Coder Social logo

aland-zhang / k8s-env-applier Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 8 KB

This simple script applies all the YAML files in the current dir and environment specific patches. It also sets the image for one container.

License: MIT License

Shell 100.00%

k8s-env-applier's Introduction

k8s-env-applier

This simple bash script applies all the YAML files in the current dir and environment specific patches. It can also set the image for one container.

It allows one to manage environment specific configuration in a unified and simple way. One may have a different storage class between dev and prod, or different ingress between minikube and one's cloud provider. It allows one to apply certain YAML files only in certain environments, and to patch common configurations per environment. All patches are done before applying the result to the environment.

Download

wget --quiet https://raw.githubusercontent.com/foundery-rmb/k8s-env-applier/master/apply-all-yamls-with-patches.sh -O apply-all-yamls-with-patches.sh && \
  chmod u+x apply-all-yamls-with-patches.sh

# OR

curl -s -o apply-all-yamls-with-patches.sh https://raw.githubusercontent.com/foundery-rmb/k8s-env-applier/master/apply-all-yamls-with-patches.sh && \
  chmod u+x apply-all-yamls-with-patches.sh

Usage

Run either with parameters or environment variables set. To see detailed usage info, simply run

./apply-all-yamls-with-patches.sh

If no environment patches are to be applied, provide a non-existent directory.

Features

  • Apply *.yaml in the working directory to a namespace using kubectl
  • Apply *.yaml in the environment specific patch directory
  • Perform a merge patch on a resource
  • Perform a json patch on a resource
  • Update the image tag in a spec

Requirements

  • Exactly one object per YAML file is expected
  • In the environment patch directory exactly zero or one json patch file with the form "patch-resource-name.json" is expected
  • In the environment patch directory exactly zero or one merge patch file with the form "patch-resource-name.yaml" is expected

Limitations

  • Only one image tag can be updated at a time

k8s-env-applier's People

Contributors

nieldw 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.