<p>I need to issue a command <code>&quot;python manage.py rebuild_index&quot;</code> for rebuilding index of apache solr in my app deployment. But i get the following error:</p>
<pre><code>The Deployment &quot;test-app&quot; is invalid: spec.template.spec.initContainers[5].name: Invalid value: &quot;rebuild_index&quot;: a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
</code></pre>

devcloud
<p>As per your error message I don't think the error is due to '_' in command, I guess you have named <strong>initContainers name as well &quot;rebuild_index&quot;</strong> that is where the error has been generated.</p>
<p>Object Name in k8s should be an alphanumeric character where only <strong>&quot;.&quot; and &quot;-&quot;</strong> special characters are allowed. You can read more on this <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" rel="nofollow noreferrer">documentation link</a>. <strong>Please change the initContainer name to &quot;rebuild-index&quot;</strong> which will resolve your issue.</p>
<p>Thanks,</p>
