【发布时间】:2017-05-31 03:45:59
【问题描述】:
这是如何在 kubernetes yaml (helloworld.yaml) 中运行简单批处理:
...
image: "ubuntu:14.04"
command: ["/bin/echo", "hello", "world"]
...
在 Kubernetes 中我可以这样部署:
$ kubectl create -f helloworld.yaml
假设我有一个像这样的批处理脚本(script.sh):
#!/bin/bash
echo "Please wait....";
sleep 5
有没有办法将 script.sh 包含到kubectl create -f 中,以便它可以运行脚本。假设现在 helloworld.yaml 编辑如下:
...
image: "ubuntu:14.04"
command: ["/bin/bash", "./script.sh"]
...
【问题讨论】:
标签: openshift kubernetes openshift-origin