The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Run more than one kubectl commands in a pipe atlassian/kubectl-run:3.2.0

yosser.mahfoudh
April 22, 2022

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.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 25, 2022

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:

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

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)



 

0 votes
yosser.mahfoudh
April 26, 2022

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?

TAGS
AUG Leaders

Atlassian Community Events