GithubHelp home page GithubHelp logo

Cron jobs about kured HOT 4 CLOSED

kubereboot avatar kubereboot commented on September 21, 2024
Cron jobs

from kured.

Comments (4)

awh avatar awh commented on September 21, 2024

Hi @vitobotta - interesting question. Are these cron jobs configured at the OS level or are they kubernetes CronJob resources? If they're the latter, you can use the new blocking reboots via pods feature in kured 1.2.0. If it's the former, I'm not sure what will happen to be honest - kured just runs systemctl reboot, so unless that happens to interact gracefully with running cron jobs and lets them run to completion, they'll probably just get terminated.

from kured.

vitobotta avatar vitobotta commented on September 21, 2024

Hi @awh , I was referring to Kubernetes cron jobs since I prefer not doing anything outside K8S if I am using K8S for my apps. I checked that page but there would be a problem with the name of the pods used by cron jobs because they change. For example when MySQL jobs are running the jobs are named something like mysql-cluster-auto<timestamp>-backup. Any ideas of how to handle this? Thanks!

from kured.

awh avatar awh commented on September 21, 2024

@vitobotta great, that makes things much simpler. You can specify additional labels on the pods created by CronJob resources - you have to get them in the right place though:

apiVersion: batch/v1beta1
kind: CronJob
metadata:
    name: backup-cronjob
spec: # CronJobSpec
    jobTemplate: #JobTemplateSpec
        spec: #JobSpec
            template: # PodTemplateSpec
                metadata:
                    labels:
                        block-reboots: true
                spec:
                        ...

then add

--blocking-pod-selector=block-reboots=true

to your kured configuration.

from kured.

vitobotta avatar vitobotta commented on September 21, 2024

I will have to check if I can change the specs of the cron jobs but it seems a little complicated because they are created by the MySQL operator. I was actually mistaken in that they are not exactly cron jobs in Kubernetes terms, they are one-time jobs created by a separate scheduler which is in the operator, or at least I think it works this way more or less. I will have to investigate. Thanks for pointing me to the blocking option, I'm closing this one for now. :)

from kured.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.