1,报错如下

Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
deployment "nginx-deployment" configured

 是个警告,可以忽略,参考:https://my.oschina.net/u/2306127/blog/1647246  

2.如何使用Kubernetes在一个yaml文件中设置多个命令?

command: ["/bin/sh","-c"] 
args: ["command one; command two && command three"]

说明:的command ["/bin/sh", "-c"]说: “运行shell,并执行下列指令”。这些参数然后作为命令传递给shell。在shell脚本中,分号分隔命令,如果第一个成功,则有条件地运行以下命令。在上面的示例中,它总是运行command one,然后是command two,如果command two成功,则只运行command three

替代方案:在很多情况下,您想要运行的某些命令可能会设置最终的命令来运行。在这种情况下,建立你自己的Dockerfile是要走的路。尤其要看RUN指令。

相关文章:

  • 2021-11-15
  • 2022-02-24
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-05-11
猜你喜欢
  • 2021-09-27
  • 2021-11-21
  • 2021-11-15
  • 2021-07-23
  • 2021-04-05
  • 2021-11-18
相关资源
相似解决方案