Git Product home page Git Product logo

cp_k8s_secret's Introduction

Kubernetes Secret Watcher

This is a Go program that watches Kubernetes secrets and performs certain actions based on the type of the event.

Prerequisites

This program requires the following tools to be installed:

  • Go
  • Kubernetes cluster

Usage

To use this program, you must either build locally the Docker image from Dockerfile.

Or use the image present in the Docker Hub under bohunn/cp-k8s-secret

Next, you need to set up a configuration file. The configuration file should be in YAML format and contain the following fields:

secret_name: Comma-separated list of the names of the secrets to watch namespace: Namespace to watch for secrets deletion_policy: Policy to follow when a secret is deleted. The value can be ORPHAN or DELETE An example configuration file might look like this:

Copy code
secret_name: secret1,secret2
namespace: default
deletion_policy: DELETE

Once created mount it to your Deployment under /config.cfg

All example .yaml files for deployment on Kubernetes can be found in repo deploy/ order.

Actions

Create Secret

If a new secret is added to the namespace, the program will create a new secret with the same name in the target namespace. If a secret with the same name already exists in the target namespace, the program will update the existing secret.

Update Secret

If a secret is modified, the program will update the corresponding secret in the target namespace.

Delete Secret

If a secret is deleted, the program will delete the corresponding secret in the target namespace. The deletion policy is determined by the deletion_policy field in the configuration file. If the policy is set to DELETE, the secret will be deleted. If the policy is set to ORPHAN, the program will do nothing.

License

Kubernetes Secret Watcher is released under the MIT License.

License: MIT

cp_k8s_secret's People

Contributors

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