使用以下命令在本地机器上运行docker映像(根据提供的参数执行性能测试)这样的
然而,satheeshpandianj/my-perf-app是我的映像名称,rest (QA Commerce ListMarkets 15 Volvo)是传递给该映像以运行的参数。我已经把这个图像推送到docker hub了。我想在kubernetes中运行这个docker镜像。我编写的部署yaml文件如下所示:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: perf
name: perf
spec:
replicas: 1
selector:
matchLabels:
app: perf
template:
metadata:
labels:
app: perf
spec:
containers:
image: docker.io/satheeshpandianj/my-perf-app
name: perf
args: ["QA", "Commerce", ListMarkets", 1, 5, "Volvo"]
当我执行"kubectl apply -f performance .yaml",我得到一个下面误差
有人能帮我解决这个错误吗?或者请纠正我在我的yaml文件中需要做哪些更改。提前谢谢。
你得到这个错误,因为规范容器,期望一个列表。你必须将你的yaml更新为:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: perf
name: perf
spec:
replicas: 1
selector:
matchLabels:
app: perf
template:
metadata:
labels:
app: perf
spec:
containers:
- image: docker.io/satheeshpandianj/my-perf-app
name: perf
args: ["QA", "Commerce", ListMarkets", 1, 5, "Volvo"]
是的,只有-
缺失