I’ve talked to the team here who have a lot more experience in this area than I do, they can’t see anything out of place either. Suspicion is that it is something environmental or something odd ending up in the file somehow.
A suggestion was to try using a K8S script step with a script something like the follow:
$myYaml = @"
kind: CronJob
apiVersion: batch/v1beta1
metadata:
name: test-cron-job
spec:
jobTemplate:
spec:
template:
spec:
containers:
- image: busybox:latest
imagePullPolicy: Always
name: test-job
args:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: Never
schedule: "*/1 * * * *"
successfulJobsHistoryLimit: 5
failedJobsHistoryLimit: 5
concurrencyPolicy: Forbid
"@
$myYaml | Set-Content "file.yaml"
kubectl apply -f file.yaml
I’ve tried this and it works in the same context I was using previously. Can you give that a try and see if you get different behavior?
Regards
Shannon