在我的项目中,GKE 每天运行许多作业。有时我看到一个作业运行了两次:第一次部分运行,第二次完全运行,尽管定义了“restartPolicy: Never”。它很少发生(大约每 200 - 300 次运行一次)。
这是一个例子:
I 2020-12-03T00:12:45Z Started container mot-test-deleteoldvalidations-container
I 2020-12-03T00:12:45Z Created container mot-test-deleteoldvalidations-container
I 2020-12-03T00:12:45Z Successfully pulled image "gcr.io/xxxxx/mot-del-old-validations:v16"
I 2020-12-03T00:12:40Z Pulling image "gcr.io/xxxxx/mot-del-old-validations:v16"
I 2020-12-03T00:12:39Z Stopping container mot-test-deleteoldvalidations-container
I 2020-12-03T00:01:59Z Started container mot-test-deleteoldvalidations-container
I 2020-12-03T00:01:59Z Created container mot-test-deleteoldvalidations-container
I 2020-12-03T00:01:59Z Successfully pulled image "gcr.io/xxxx/mot-del-old-validations:v16"
I 2020-12-03T00:01:40Z Pulling image "gcr.io/xxxxx/mot-del-old-validations:v16"
来自工作的 YAML:
spec:
backoffLimit: 0
completions: 1
parallelism: 1
resources:
limits:
cpu: "1"
memory: 2500Mi
requests:
cpu: 500m
memory: 2Gi
nsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
停止容器的原因是“杀死”。我怎样才能避免这种行为?