Skip to content

Custom Kubernetes Controller to reload pods automatically if configmaps are changed/ updated. πŸ”„

License

Notifications You must be signed in to change notification settings

shivanshthapliyal/k8s-reload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

k8s-reload

Custom Kubernetes Controller to reload pods automatically if configmaps are changed/ updated. πŸ”„

Quickstart

Install Controller via helm chart:

## Clone the repository.
git clone https://github.com/shivanshthapliyal/k8s-reload.git
cd k8s-reload/chart

## Install Helm chart
helm upgrade --install k8s-reload-controller-helm . -f values.yaml

Build k8s-reload controller image:

cd controller
docker build -t k8s-reload:1.0 -f k8s-reload-controller.dockerfile . --no-cache

Run a demo application to test controller's functionality:

cd demo-manifests
docker build -t demo-frontend-app:1.0 -f demo-frontend-app.dockerfile . --no-cache
kubectl apply -f demo-deployment.yaml demo-configmap.yaml

Now, try modifying the configmap and see the controller automatically recreate the pods!

$ k logs -f k8s-reload-controller-helm-5d9cb7bb74-kzcgl k8s-reload-controller
2022-04-11 17:33:10,638 Starting the service
2022-04-11 17:33:30,145 Modification detected on configmap - with label
2022-04-11 17:33:30,194 demo-frontend-app-b75647989-4g5vs was deleted successfully

Usecases

One usecase is while using secrets-store-csi-driver-provider-aws, when you change the parameter or secret in Parameter Store or Secret Manager, the configmap changes in the env but the pods/ deployments don't reload on their own and need to be deleted manually.

About

Custom Kubernetes Controller to reload pods automatically if configmaps are changed/ updated. πŸ”„

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published