Hello @Greg Van Riper ,
Can you try using apiVersion: "batch/v1beta1"
Sample YAML file:
apiVersion: "batch/v1beta1"
kind: "CronJob"
metadata:
name: "sample-cron-job-nn"
spec:
concurrencyPolicy: "Forbid"
schedule: "* * * * *"
suspend: false
jobTemplate:
spec:
template:
spec:
containers:
- image: "mcr.microsoft.com/powershell"
name: "sample-cron-job-nn-container"
command: ["pwsh"]
args: ["-Command","echo 'Hello World!!!'; exit 0"]
restartPolicy: "OnFailure"
//////////////////////////
Sometimes you will get this error due to kubectl incompatible version.
For example this is my local version :
PS C:\aks> kubectl version
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:59:43Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.17", GitCommit:"68e3e47dad98b808ba41087c0c62e80cd4fcec36", GitTreeState:"clean", BuildDate:"2021-05-25T02:41:29Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Let me know how it goes.
Regards,
Shiva.