schedule-pod-restart
by Codit
A Helm chart for automatically restarting pods with labels based on a cron schedule.
About this chart
Schedule Pod Restart
Automatically restarting pods with labels based on a cron schedule.
TL;DR
helm repo add coditeu https://coditeu.github.io/charts
helm repo update
helm install coditeu/cronjob-pod-restart
Introduction
Installing the Chart
To install the chart with the release name schedule-pod-restart:
$ helm install schedule-pod-restart coditeu/schedule-pod-restart --set cronjob.schedule="0 1 * * *" --set cronjob.podLabels="app=example"
Uninstalling the Chart
To uninstall the schedule-pod-restart deployment:
helm uninstall schedule-pod-restart
The command removes all the Kubernetes components associated with the chart and deletes the release.
Configuration
The following table lists the configurable parameters of the chart and their default values.
| Parameter | Description | Default |
|---|---|---|
nameOverride | Name of the cronjob that will be created | Chart Name schedule-pod-restart |
serviceAccount.name | Name of the service account to use | operations-pod-restart |
serviceAccount.annotations | Annotations for the service account | None |
role.name | Name of the role to create | manage-pods-role |
bindings.role.name | Name of the role binding | manage-pods-role-binding |
cronjob.schedule | A cronjob expression that defines the schedule when the job should run. Learn more about the format in the official documentation. | 0 0 * * * |
cronjob.podLabels | One or more labels on the pods that need to be restarted. Use format key1=value1,key2=value2 | None |
image.tagname | Tag of container image that contains kubectl | Version of the Kubernetes cluster where the chart will be deployed |
Deploy schedule-pod-restart with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has schedule-pod-restart on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartschedule-pod-restart is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply