Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 1 month ago
JSON representation

Restarts kubernetes deployment resource by schedule.

Awesome Lists containing this project

README

        

# k8s deployment restarter

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=kostiantyn-matsebora_helm-k8s-deployment-restarter&metric=alert_status)](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 restarted

scaleDownUp:
- 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