Git Product home page Git Product logo

configmap_update_controller's Introduction

Hot update controller

监听k8s configmap变化事件关联应用到该configmap的pod进行相关操作

项目背景

configmap更新触发业务热加载

原理

configmap env形式注入变量容器内部是无法进行重载的
挂载Volume形式则相关pod 10s后会又kubelet进行周期性检测和更新
当监听到configmap更新事件后和pod内挂载的文件进行比对
如果pod的volume已经被kubelet更新则触发业务热更新

如何使用

定义annotations reloader/check|reloader/command

apiVersion: v1
kind: Pod
metadata:
  labels:
    name: busybox
    role: master
  name: busybox
  annotations:
    reloader/command: '你可以设置你要触发的操作'
日志输出
####################################################################################################
2020-12-23 23:28:01,290 controler wait_and_reload INFO    : Reload in busybox succeeded
2020-12-23 23:28:35,172 controler watch INFO    : Event: MODIFIED cmtest in namespace default
####################################################################################################

configmap_update_controller's People

Stargazers

RichZhou avatar

Watchers

James Cloos avatar RichZhou avatar  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.