如何使用configmap运行一次OpenShift作业 [英] How to run once an openshift job with configmap
本文介绍了如何使用configmap运行一次OpenShift作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经知道如何在OpenShift中运行一次性作业(停靠运行的替代方案):
oc run my-job --replicas=1 --restart=Never --rm -ti --command /bin/true --image busybox
如何将configmap装入作业容器?
推荐答案
可以使用--overrides
标志:
oc run my-job --overrides='
{
"apiVersion": "v1",
"kind": "Pod",
"spec": {
"containers": [
{
"image": "busybox",
"name": "mypod",
"volumeMounts": [
{
"mountPath": "/path",
"name": "configmap"
}
]
}
],
"volumes": [
{
"configMap": {
"name": "myconfigmap"
},
"name": "configmap"
}
]
}
}
' --replicas=1 --restart=Never --rm -ti --command /bin/true --image busybox
这篇关于如何使用configmap运行一次OpenShift作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文