I'm trying to create a migration but it's failing with the below error:
Error from server (BadRequest): error when creating "kubernetes/migration-job.yaml": Job in version "v1" cannot be handled as a Job: v1.Job: Spec: v1.JobSpec:
What is the cause of this error?
To manually run a CronJob as a Job you run the kubectl create job command. You then specify the CronJob to base the job off of using the --from flag. Lastly, you specify a unique name for the job.
A Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate. As pods successfully complete, the Job tracks the successful completions.
The issue was to do with one of the yaml fields:
env:
- name: DB_HOST
value: "mysql"
- name: DB_PORT
value: 3306
3306
should be a string ("3306
") instead...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With