Kubernetes version: 1.17.0
Cloud being used: bare-metal
Installation method: apt-get?
Host OS: Debian 10
CNI and version: flannel:v0.11.0
CRI and version:
I want a cron job to run on a specific node. I tried to place the nodeSelector in my kubernetes manifest file but I get an error saying that it doesn’t know what the nodeSelector field is.
error: error validating “highres-backup.yaml”: error validating data: ValidationError(CronJob): unknown field “nodeSelector” in io.k8s.api.batch.v1beta1.CronJob; if you choose to ignore these errors, turn validation off with --validate=false
I have tried putting nodeSelector on various indentation levels but got the same errors.
I am posting my mildly sensored yaml file. Essentially, I’m trying to schedule files written on a specific node to be transferred to an nfs-volume at regular intervals.
That was actually my initial guess, but I still get the same api error
raphaelc@tpnotc:~/site_atlas$ kubectl apply -f highres-backup.yaml
Error from server (BadRequest): error when creating "highres-backup.yaml": CronJob in version "v1beta1" cannot be handled as a CronJob: v1beta1.CronJob.Spec: v1beta1.CronJobSpec.JobTemplate: v1beta1.JobTemplateSpec.Spec: v1.JobSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.NodeSelector: ReadString: expects " or n, but found t, error found in #10 byte of ...|_backup":true},"rest|..., bigger context ...|e":"nfs-volume"}]}],"nodeSelector":{"nfs_backup":true},"restartPolicy":"OnFailure","volumes":[{"host|...
Do you know what could be wrong? I’m posting my manifest file now.