https://github.com/kostiantyn-matsebora/helm-k8s-deployment-restarter
Restarts kubernetes deployment resource by schedule.
https://github.com/kostiantyn-matsebora/helm-k8s-deployment-restarter
cron cronjob cronjobs crontab deployments helm helm-chart kuberentes restart statefulset
Last synced: about 2 months ago
JSON representation
Restarts kubernetes deployment resource by schedule.
- Host: GitHub
- URL: https://github.com/kostiantyn-matsebora/helm-k8s-deployment-restarter
- Owner: kostiantyn-matsebora
- License: mit
- Created: 2024-01-31T15:35:03.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-02T18:04:50.000Z (7 months ago)
- Last Synced: 2025-01-13T15:16:43.387Z (4 months ago)
- Topics: cron, cronjob, cronjobs, crontab, deployments, helm, helm-chart, kuberentes, restart, statefulset
- Language: Smarty
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# k8s deployment restarter
[](https://sonarcloud.io/summary/new_code?id=kostiantyn-matsebora_helm-k8s-deployment-restarter)
Helm chart for restarting kubernetes deployment resource by schedule.
Supports two strategies:
* `restart` - using `kubectl` command `kubectl rollout restart deployment/daemonset`, supports deployments and daemonsets.
* `scaleDownUp` - scales down to zero and up to particular number of replicas, could be useful when destroying pod also requires release of some resources (for instance mounted volumes), supports deployments only.## Configuration
```yaml
restart:
- name: deployments-to-restart # name of batch
schedule: "7 */3 * * *" # cron schedule definition
deployments: # list of deployments needs to be restarted
- nginx-ingress
- oauth2-proxy
daemonSets: [] # list of daemonSets needs to be restartedscaleDownUp:
- name: deployments-to-scaledownup # name of batch
schedule: "7 */3 * * *" # cron schedule definition
sleepPeriodInSeconds: 30 # sleep period in seconds between scaling down and scaling up
deployments: # list of deployments needs to be restarted
- name: nginx-ingress # name of deployment resource
replicas: 1 # replicas number
- name: oauth2-proxy
replicas: 2
```## Usage
Add helm [repository](https://kostiantyn-matsebora.github.io/helm-charts/) first:
```bash
helm repo add kostiantyn-matsebora https://kostiantyn-matsebora.github.io/helm-charts/
```Install/upgrade helm chart using your custom values:
```bash
helm upgrade oauth2-proxy kostiantyn-matsebora/k8-deployment-restarter --install --values ./custom-values.yaml```
## Contributing
If you experience any issues, have a question or a suggestion, or if you wish
to contribute, feel free to [open an issue][issues] or
[start a discussion][discussions].[issues]: https://github.com/kostiantyn-matsebora/helm-k8s-deployment-restarter/issues
[discussions]: https://github.com/helm-k8s-deployment-restarter/discussions## License