https://github.com/acanguven/kubernetes-configmap-update
Automatically updates environment values of your pods when you change configmap.
https://github.com/acanguven/kubernetes-configmap-update
configmap kubernetes reload update
Last synced: about 2 months ago
JSON representation
Automatically updates environment values of your pods when you change configmap.
- Host: GitHub
- URL: https://github.com/acanguven/kubernetes-configmap-update
- Owner: Acanguven
- License: mit
- Created: 2018-03-22T13:17:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T01:37:12.000Z (over 2 years ago)
- Last Synced: 2025-03-29T15:11:19.360Z (2 months ago)
- Topics: configmap, kubernetes, reload, update
- Language: JavaScript
- Size: 85.9 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Kubernetes Auto Config Updater
You can change your pods environment variables without creating new pods when you update your configmap. This package will update your environment on the fly!
### Install
* Using yarn
```
yarn add kubernetes-configmap-updater
```* Using npm
```
npm install kubernetes-configmap-updater
```### Usage
```js
const configUpdater = require('kubernetes-configmap-updater');
configUpdater({
updateUrl: 'https://127.0.0.1:6443/api/v1/namespaces/default/configmaps/example',
frequency: 1000 * 60 * 3,
overwriteExisting: true,
exclude: ['NODE_ENV', 'CUSTOM1','CUSTOM2'],
auth: {
username: 'username',
password: 'password',
token: 'token' // provide token or username/password
}
});
```* **updateUrl**: Kubernetes configmap api endpoint url
* **frequency**: (Optional) Update interval in ms. Default: `300000`
* **overwriteExisting**: (Optional) Change value of existing key. Default: `true`
* **exclude**: (Optional) Exclude keys from being updated. Default: []
* **auth**: (Optional) Most Kubernetes apis require basic auth. You can provide your username and password or token(for Bearer auth). **(Best practice: Use kubernetes secrets, don't write your username and password directly here)**### Refs
* Manually triggering update
```js
configUpdater.update([cb]);
```* Stop checking updates
```js
configUpdater.stop();
```