Comments (3)
Yes, cronjobs in Kubernetes aren't exactly like cronjobs on a server. I'm thinking you might need to read up on sidecar containers. But having never used them myself, that's as far as my recommendation goes.
My tool of choice in Linux is a BASH script
so I tend to tackle all manner of problems in kubernetes with scripts. To that end, I'd get the Dockerfile
used to build Matomo and add a script just before going to the Entrypoint
. Say you want to run a cleanup
process every hour, I'd do this:
CMD [ "while true; do cleanup; sleep 3600; done" ]
NOTE: This is untested code but I hope you get the gist.
from kubernetes.
@ak2766 Thank you for your reply. It really helped me to get closer to the answer. I used command: [] (i.e. CMD [] as you mentioned) in my CRON job to get it done.
I also got to know that we cannot create a cron job for a running pod. But we can reuse the PVC used by the running pod by setting a POD AFFINITY rule in the CRON JOB which matches the label of the same pod.
from kubernetes.
@ak2766 thanks for helping.
from kubernetes.
Related Issues (20)
- Feed-back, would you be kind enough to use nginx external load balancer? HOT 1
- unable to install istiod HOT 2
- Since i don't find where i can contact you personally HOT 6
- Internet connection HOT 1
- Can't setup HA Cluster with 1.24.6 HOT 15
- Containers unstable HOT 1
- not able to run vagrant up on ubuntu 22.04 using the vagrant file HOT 1
- LXD provisioning for kubernetes isnt working HOT 2
- ingress-nginx define the localhost ip as ingress address instead of IP from metallb addresspool HOT 7
- Internet issue when running cluster in corporate network HOT 2
- ingress-nginx get 400 HOT 2
- bootstrap_kmaster task 1 is not able to pull HOT 4
- kmaster: [TASK 4] Generate and save cluster join command to /joincluster.sh step return a non-zero exit status HOT 4
- LXC/LXD - Kubernetes Cluster created but not working HOT 3
- ClusterAPI HOT 2
- Create Kubernetes cluster using Vagrant. HOT 2
- LXD Provisioning HOT 1
- lxc.mount.auto=proc:rw sys:rw freezes archlinux HOT 5
- vagrant provisioning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubernetes.