<p>I'm trying to deploy Node.js code to a Kubernetes cluster, and I'm seeing that in my reference (provided by the maintainer of the cluster) that the <code>yaml</code> files are all prefixed by numbers:</p>

<pre><code>00-service.yaml
10-deployment.yaml
etc.
</code></pre>

<p>I don't think that this file format is specified by <code>kubectl</code>, but I found another example of it online: <a href="https://imti.co/kibana-kubernetes/" rel="nofollow noreferrer">https://imti.co/kibana-kubernetes/</a> (but the numbering scheme isn't the same).</p>

<p>Is this a Kubernetes thing? A file naming convention? Is it to keep files ordered in a folder?</p>

<p>This is to handle the resource creation order. There's an opened issue in kubernetes:
<a href="https://github.com/kubernetes/kubernetes/issues/16448#issue-113878195" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/16448#issue-113878195</a></p>

<p>tl;dr <code>kubectl apply -f k8s/*</code> should handle the order but it does not.</p>

<p>However, except the namespace, I cannot imagine where the order will matter. Every relation except namespace is handled by label selectors, so it fixes itself once all resources are deployed. You can just do 00-namespace.yaml and everything else without prefixes. Or just skip prefixes at all unless you really hit the issue (I never faced it).</p>
