I want to run multiple commands line
first is deleting an exicting pod then apply the new pod x1and apply other pod.
Actually each time I excute apply cmd it brings me a new pod where I want it to replace the existing one.
G'day!
To run multiple commands within kubectl, you would specify this within your YML configuration using the following syntax inside the specification of the pods contents when listing commands to execute:
<span style="border: 0px; margin: 0px; padding: 0px;">command:</span> [<span style="border: 0px; margin: 0px; padding: 0px;">"/bin/sh"</span>,<span style="border: 0px; margin: 0px; padding: 0px;">"-c"</span>] <span style="border: 0px; margin: 0px; padding: 0px;">args:</span> [<span style="border: 0px; margin: 0px; padding: 0px;">"command one; command two && command three"</span>]
I believe this StackOverflow discussion which I have found will also help to point you in the right direction:https://stackoverflow.com/questions/33887194/how-to-set-multiple-commands-in-one-yaml-file-with-kubernetes
Hope this helps.
Cheers!
- Ben (Bitbucket Cloud Support)
Hi ,
When I push the image to the server it creates a new pod X-ID1 or I already have pod X-ID2 with diferent ID let's say.
So is there a way to prevent that to happen?
It looks like you're new here. Sign in or register to get started.