无法在kubernetes部署中使用下划线内部命令?

无法在kubernetes部署中使用下划线内部命令?,kubernetes,deployment,Kubernetes,Deployment,我需要发出命令“python manage.py rebuild_index”,以便在我的应用程序部署中重建apache solr的索引。但我得到了以下错误: The Deployment "test-app" is invalid: spec.template.spec.initContainers[5].name: Invalid value: "rebuild_index": a DNS-1123 label must consist of lowe

我需要发出命令
“python manage.py rebuild_index”
,以便在我的应用程序部署中重建apache solr的索引。但我得到了以下错误:

The Deployment "test-app" is invalid: spec.template.spec.initContainers[5].name: Invalid value: "rebuild_index": 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])?')

根据您的错误消息,我认为该错误不是由于命令中的“\u”引起的,我猜您还将initContainers名称命名为“rebuild\u index”,这就是产生错误的地方

k8s中的对象名称应为字母数字字符,其中只允许使用“”和“-”特殊字符。你可以阅读更多关于这方面的内容请将initContainer名称更改为“重建索引”,这将解决您的问题


谢谢,

根据您的错误消息,我不认为该错误是由于命令中的“\u”引起的,我猜您已经将initContainers名称命名为“rebuild\u index”,这就是产生错误的地方

k8s中的对象名称应为字母数字字符,其中只允许使用“”和“-”特殊字符。你可以阅读更多关于这方面的内容请将initContainer名称更改为“重建索引”,这将解决您的问题

谢谢