我想出了如何在openshift中运行一次作业(替代docker run):
oc run my-job --replicas=1 --restart=Never --rm -ti --command /bin/true --image busybox
如何将configmap装入作业容器?
答案 0 :(得分:0)
您可以使用--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