Nagaraj
Nagaraj

Reputation: 31

Cronjob not scheduling in Kubernetes

Hi i'm new to this please someone help in this. thanks in advance I want to schedule a job for deleting a pod for every 3 days in midnight. Manually script is working fine but scheduling with crontab is not wokring. note:- deployment is statefulset

#!/bin/bash
kubectl delete pod keycloak-server-0

gave permission to execute with chmod +x <sh file name>

scheduling script with cron 00 00 */3 * * <path of the script>

Upvotes: 0

Views: 180

Answers (1)

Nagaraj
Nagaraj

Reputation: 31

figuredout what i did wrong in scheduling job.

while scheduling we need to specify the **SHELL=/bin/sh** and **PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin** in cron.

Upvotes: 1

Related Questions