I have setup a CronJob in AKS and I'd like to test to make sure the CronJob works correctly. When I try to create the job, it always returns with:
error: from must be an existing cronjob: no kind "CronJob" is registered for version "batch/v1" in scheme "k8s.io/kubectl/pkg/scheme/scheme.go:28"
I ran kubectl api-versions and confirmed the api version is correct.
kubectl get cronjobs -n <my namespace>
and confirmed it's there but when running this command:
kubectl create job --from=cronjob/<my job> <my job name> --namespace <my namespace>
this error is always returned. Note that I am on kubernetes version 1.21.1.
My CronJob API version is: batch/v1
Any insight on what I'm doing wrong would be appreciated.