Page MenuHomePhabricator

Tools with names longer than 24 characters cannot start kubernetes webservices
Closed, ResolvedPublic

Description

My tool "not-in-the-other-language" can't run under kubernetes, because... the name is too long.

tools.not-in-the-other-language@tools-bastion-03:~$ webservice --backend=gridengine stop ; webservice --backend=kubernetes start
Stopping webservice.
Traceback (most recent call last):
  File "/usr/local/bin/webservice", line 122, in <module>
    start(job, 'Starting webservice')
  File "/usr/local/bin/webservice", line 30, in start
    job.request_start()
  File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 282, in request_start
    pykube.Service(self.api, self._get_svc()).create()
  File "/usr/lib/python2.7/dist-packages/pykube/objects.py", line 76, in create
    self.api.raise_for_status(r)
  File "/usr/lib/python2.7/dist-packages/pykube/http.py", line 104, in raise_for_status
    raise HTTPError(payload["message"])
pykube.exceptions.HTTPError: Service "not-in-the-other-language" is invalid: metadata.name: Invalid value: "not-in-the-other-language": must be no more than 24 characters

Event Timeline

This would also affect:

scfc@tools-bastion-03:~$ getent passwd | sed -ne 's/^tools\.\([^:]\{25,\}\):.*$/\1/p;'
not-in-the-other-language
citation-template-filling
perfect-venn-diagram-generator
local-wikipedia-library-reference
livingstyleguide-prototype
templatetransclusioncheck
wikipedia-contributor-locations
wikidata-redirects-conflicts-reports
articles-by-lat-lon-without-images
hoo-propertysuggester-test
wikipedia-zh-message-transport
scfc@tools-bastion-03:~$
bd808 renamed this task from Tool name too long to Tools with names longer than 24 characters cannot start kubernetes webservices.Apr 18 2017, 4:52 AM

This limitation was removed in kubernetes 1.4. The services now use an RFC for name limits (more like 63 char) https://github.com/kubernetes/kubernetes/pull/29523

Tested in toolforge this morning. If webservice does this, it's webservice's pykube library incorrectly suggesting the limit. We need to upgrade that to using the "native" kubernetes python client.

bd808 claimed this task.
bd808 subscribed.

Closing this as "resolved". There may be a few legacy tools with names which do now work with Kubernetes namespace limitations, but T176681: Striker should not allow tool names to include '_' for Kubernetes compatibility should have made it so that new tool creations are forced to fit with the upstream constraints.

bd808 removed bd808 as the assignee of this task.Feb 12 2021, 7:20 PM