Does Kubernetes have the option to have a main manifest file which references all the other manifest files

4/28/2019

Currently, I have a number of Kubernetes manifest files which define service's or deployment's. When I do an kubectl apply I need to include -all- the files which have changes and need to be applied.

Is there a way to have a main manifest file which references all the other files so when I do kubectl apply i just have to include the main manifest file and don't have to worry manually adding each file that has changed, etc.

Is this possible?

I did think of making an alias or batch file or bash file that has the apply command and -all- the files listed .. but curious if there's a 'kubernetes' way ....

-- Pure.Krome
kubernetes

1 Answer

4/28/2019

You may have a directory with manifests and do the following:

kubectl apply -R -f manifests/

In this case kubectl will recursively traverse the directory and apply all manifests that it finds.

-- Vasily Angapov
Source: StackOverflow