<p>I have a nested maven project structure, several of the Maven Artefacts contains also Kubernetes configurations, when I do the complete deployment of the projects, I want to combine all Kubernetes configuration and run it centrally.</p>

<p>It is something like Spring Application Context 'import' statements, of course I can take this small configurationx and copy/paste to one big file but then I have to maintain changes at 2 different places, which I don't want to...</p>

<p>I can't find an 'import' mechanism similar to Spring one in Kubernetes documentation, I can write something with Maven and Groovy, to combine all these small configuration files to one big one, but that some direction I really don't want to go.</p>

<p>Code Snippet from a configuration would be something like this..</p>

<pre>
<code>
kind: Deployment
apiVersion: apps/v1beta2
metadata:
 name: apimanagementstore-deployment
 namespace: api-management
spec:
  replicas: 1
  selector:
   matchLabels:
    k8s-app: api-management-store
  template:
   metadata:
    labels:
     k8s-app: api-management-store
   spec:
    containers:
    - name: apimanagementstore
      image: localhost:5000/api_management_store
      ports:
      - containerPort: 8383
        protocol: TCP

---
#------------ Service ----------------#

kind: Service
apiVersion: v1
metadata:
 labels:
  k8s-app: api-management-store
 name: api-management-store
 namespace: api-management
spec:
 ports:
  - port: 8383
    targetPort: 8383
 selector:
  k8s-app: api-management-store

 </code>
</pre>

<p>I have several snippets (they all lie under a seperate Maven Project) like this and I want to combine those to one big one.</p>

posthumecaver
<p>There is no option to use something like include in Kubernetes right now. Maybe in the future, they will add such an option.</p>

<p>You are right that you can create one big file and use '---' delimiters for each new configuration.</p>

<p>However, you also have another option: use -f key, for example:</p>

<pre><code>kubectl apply -f ./file1 ./file2 ./file3 etc 
</code></pre>

<p>For more details please refer to <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply" rel="nofollow noreferrer">Kubernetes documentation</a></p>
