环境:Ubuntu20.04
- 使用minikube创建node
minikube start --nodes 2 -p multinode-demo
创建完成之后使用下面的命令查看
kubectl get nodes #查看创建的node
minikube status -p multinode-demo #查看multinode-demo的状态
- 创建cronjob.yaml
apiVersion: batch/v1
kind: CronJob
metadata:
name: hello
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox:1.28
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
标签:cronjob,minikube,demo,multinode,创建,Usage,K8s,spec
From: https://www.cnblogs.com/attack204/p/16649043.html