Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing manifest file from remote url with kubectl command

I am trying to submit the resource to Container using Kubernetes CLI.

The below is what I use to submit jobs.

kubectl -n namespace create -f <manifest file PATH>

I am actually running this on a LINUX server which would meet application team requirement and provide this service for the users to use it.

The Challenge is I don't want to store the application teams Configuration files(.yml/.json) in the LINUX server and call it from the LOCALPATH instead call the configuration file remotely.

I think of BITBUCKET. Can someone please assist me on how we can call the file from remote location so that kubectl can accept it?

Appreciate your time and effort.

like image 864
Ram Avatar asked Oct 17 '25 18:10

Ram


1 Answers

You can use pipe with kubectl command to achieve it.

For example,

curl <your file url> | kubectl apply -f -

Here is a working example:

curl https://gist.githubusercontent.com/hossainemruz/7926eb2660cc8a1bb214019b623e72ea/raw/d9505d06aee33e0144d9f2f9107290f1aba62cd5/mysql-initialization-with-init-container.yaml | kubectl apply -f -
like image 107
Emruz Hossain Avatar answered Oct 19 '25 12:10

Emruz Hossain