首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >dask-kubernetes:创建用户名为大写的pod时出现问题

dask-kubernetes:创建用户名为大写的pod时出现问题
EN

Stack Overflow用户
提问于 2020-03-13 09:59:35
回答 1查看 171关注 0票数 1

我正在GKE上学习dask-kubernetes

我偶然发现了一个asyncio错误(错误:asyncio:任务异常从未被检索过)。

有关此问题,请参阅以下步骤。

然而,更多关于使用远程Kubernetes集群部署dask-kubernetes的指导是值得感谢的(注意,我在这里使用了helm,有很好的经验,但我想像can't scale the helm approach一样尝试本机方法)。

创建集群:

代码语言:javascript
复制
$ gcloud container clusters create --machine-type n1-standard-2 --num-nodes 2 --zone us-central1-b --cluster-version latest k8scluster

创建新的python环境:

代码语言:javascript
复制
$ conda create -n daskk8s python=3.8
$ conda activate daskk8s

安装程序包:

代码语言:javascript
复制
$ conda install -c conda-forge dask-kubernetes

通过在我的.bash_profile中添加以下内容来验证项目:

代码语言:javascript
复制
$ export GOOGLE_APPLICATION_CREDENTIALS="/Users/Ray/Downloads/daskk8s-f92d8191517a.json"

启动笔记本:

代码语言:javascript
复制
$ jupyter notebook

运行命令并使用示例here

代码语言:javascript
复制
from dask_kubernetes import KubeCluster, make_pod_spec

pod_spec = make_pod_spec(image='daskdev/dask:latest',
                         memory_limit='4G', memory_request='4G',
                         cpu_limit=1, cpu_request=1,
                         env={'EXTRA_PIP_PACKAGES': 'fastparquet git+https://github.com/dask/distributed'})

cluster = KubeCluster(pod_spec)

cluster.scale(1)
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-8' coro=<_wrap_awaitable() done, defined at /opt/anaconda3/envs/daskk8s/lib/python3.8/asyncio/tasks.py:677> exception=ApiException()>
Traceback (most recent call last):
  File "/opt/anaconda3/envs/daskk8s/lib/python3.8/asyncio/tasks.py", line 684, in _wrap_awaitable
    return (yield from awaitable.__await__())
  File "/opt/anaconda3/envs/daskk8s/lib/python3.8/site-packages/distributed/deploy/spec.py", line 50, in _
    await self.start()
  File "/opt/anaconda3/envs/daskk8s/lib/python3.8/site-packages/dask_kubernetes/core.py", line 78, in start
    raise e
  File "/opt/anaconda3/envs/daskk8s/lib/python3.8/site-packages/dask_kubernetes/core.py", line 68, in start
    self._pod = await self.core_api.create_namespaced_pod(
  File "/opt/anaconda3/envs/daskk8s/lib/python3.8/site-packages/kubernetes_asyncio/client/api_client.py", line 162, in __call_api
    response_data = await self.request(
  File "/opt/anaconda3/envs/daskk8s/lib/python3.8/site-packages/kubernetes_asyncio/client/rest.py", line 224, in POST
    return (await self.request("POST", url,
  File "/opt/anaconda3/envs/daskk8s/lib/python3.8/site-packages/kubernetes_asyncio/client/rest.py", line 181, in request
    raise ApiException(http_resp=r)
kubernetes_asyncio.client.rest.ApiException: (422)
Reason: Unprocessable Entity
HTTP response headers: <CIMultiDictProxy('Audit-Id': '89b614f5-2e9c-46bd-8d7d-b834e1a18f1a', 'Content-Type': 'application/json', 'Date': 'Fri, 13 Mar 2020 01:21:14 GMT', 'Content-Length': '1607')>
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Pod \"dask-Ray-ece943dc-8lj4mj\" is invalid: [metadata.generateName: Invalid value: \"dask-Ray-ece943dc-8\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.name: Invalid value: \"dask-Ray-ece943dc-8lj4mj\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')]","reason":"Invalid","details":{"name":"dask-Ray-ece943dc-8lj4mj","kind":"Pod","causes":[{"reason":"FieldValueInvalid","message":"Invalid value: \"dask-Ray-ece943dc-8\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')","field":"metadata.generateName"},{"reason":"FieldValueInvalid","message":"Invalid value: \"dask-Ray-ece943dc-8lj4mj\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')","field":"metadata.name"}]},"code":422}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-13 10:23:56

指定要KubeCluster的小写名称

KubeCluster(pod_spec, name='ray')

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60663930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档