kubectl create deployment terraform --image=hashicorp/terraform:light -n test -- sleep 3600
$ kubectl get po -n test
NAME READY STATUS RESTARTS AGE
terraform-5f7bfdc955-95pt6 1/1 Running 0 25s
$ kubectl exec -it terraform-5f7bfdc955-95pt6 -n test sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
/ # terraform -version
Terraform v0.15.3
on linux_amd64
1条答案
按热度按时间camsedfj1#
hashicorp/terraform:light
容器的入口点是terraform
。因此,在启动容器时必须提供有效的参数。(You可以找到,如果你检查崩溃的吊舱的日志。)
您可以在命令行中覆盖docker
ENTRYPOINT
以保持pod运行。