How to schedule clamdscan weekly (cron jobs on GKE)?

234 Views Asked by At

How to schedule "clamdscan" to run weekly on an GKE?

I am able to trigger the scan manually, but I am not able to find on a way how to schedule it?

1

There are 1 best solutions below

0
On

Have a Look at CronJobs on GKE:

  • Enable GKE API.
  • Ensure you have installed & configured Cloud SDK
  • Set up gcloud
  • Create CronJob

cronjob.yaml

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            args:
            - /bin/sh
            - -c
            - date; echo "Hello, World!"
     
  • Apply CronJob
kubectl apply -f filename