Giter Club home page Giter Club logo

zsh-kubernetes-context-watcher's Introduction

Kubernetes Context Watcher ๐Ÿš€๐Ÿ”

Description ๐Ÿ“

Kubernetes Context Watcher is an open-source project designed to help engineers avoid accidental operations on production clusters. It changes the background color of your terminal based on the Kubernetes context you're currently using. This visual cue acts as a reminder, ensuring you're aware when you're operating in a production environment.

How it Works ๐Ÿ› ๏ธ

The project includes a set of scripts that interact with your Kubernetes configuration and iTerm2 terminal settings. When you switch your Kubernetes context, the scripts check if the new context is one of your specified "alert" contexts (like production). If it is, the script changes the iTerm2 background color to red. If not, it resets the background color to your default.

Installation ๐Ÿ“ฅ

  1. Clone the Kubernetes Context Watcher repository to your local machine.
  2. Navigate to the cloned directory.
  3. Run the install.sh script. This script will:
    • Check if kubectl is installed. If not, you'll be prompted to install it first.
    • Copy the change_background.sh script to your home directory and make it executable.
    • Get the list of Kubernetes contexts.
    • Prompt you to enter the contexts you want to use, separated by spaces.
    • Add the selected contexts to the main script.
    • Append the script content to your .zshrc file.
  4. Restart your shell to apply the changes.

Usage ๐Ÿš€

Once installed, the script will automatically run every time you switch your Kubernetes context using the kubectl config use-context command. If you switch to a context that you've specified as an "alert" context, your iTerm2 background color will change to red.

Contribute ๐Ÿค

We welcome contributions from the community. Feel free to submit issues, feature requests, and pull requests!

License ๐Ÿ“„

This project is open-source and is licensed under the MIT License.

Safety First! โš ๏ธ๐Ÿ”’

Remember, with great power comes great responsibility. Always double-check your Kubernetes context before performing operations, especially in production environments!

zsh-kubernetes-context-watcher's People

Contributors

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