本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
将 JEG Pod 部署到节点组
JEG(Jupyter Enterprise Gateway)Pod 放置功能允许您在特定节点组上部署交互式端点。使用此功能,您可以为交互式端点配置 instance type
等设置。
将 JEG Pod 关联到托管式节点组
以下配置属性允许您指定 Amazon EKS 集群上的托管式节点组的名称,JEG Pod 将在此集群中部署。
//payload --configuration-overrides '{ "applicationConfiguration": [ { "classification": "endpoint-configuration", "properties": { "managed-nodegroup-name":
NodeGroupName
} } ] }'
节点组必须将 Kubernetes 标签 for-use-with-emr-containers-managed-endpoint-ng=
附加到属于该节点组的所有节点。要列出节点组中所有带有此标签的节点,请使用以下命令:NodeGroupName
kubectl get nodes --show-labels | grep for-use-with-emr-containers-managed-endpoint-ng=
NodeGroupName
如果上述命令的输出未返回属于托管式节点组的节点,则该节点组中没有附加了 for-use-with-emr-containers-managed-endpoint-ng=
Kubernetes 标签的节点。在这种情况下,请按照以下步骤将此标签附加到节点组中的节点。NodeGroupName
-
使用以下命令向托管式节点组
中的所有节点添加NodeGroupName
for-use-with-emr-containers-managed-endpoint-ng=
Kubernetes 标签:NodeGroupName
kubectl label nodes --selector eks:nodegroup-name=
NodeGroupName
for-use-with-emr-containers-managed-endpoint-ng=NodeGroupName
-
使用以下命令验证节点是否已正确标记:
kubectl get nodes --show-labels | grep for-use-with-emr-containers-managed-endpoint-ng=
NodeGroupName
托管式节点组必须与 Amazon EKS 集群的安全组关联,如果您使用 eksctl
创建集群和托管式节点组,通常会出现这种情况。您可以使用以下步骤在 Amazon 控制台中对此进行验证。
-
转到 Amazon EKS 控制台中的集群。
-
转到集群的“网络”选项卡,记下集群安全组。
-
转到集群的“计算”选项卡,然后单击托管式节点组名称。
-
在托管式节点组的详细信息选项卡下,验证您之前记下的集群安全组是否已列在安全组下。
如果托管式节点组未附加到 Amazon EKS 集群安全组,则需要将 for-use-with-emr-containers-managed-endpoint-sg=
标签附加到节点组安全组。使用以下步骤附加此标签。ClusterName
/NodeGroupName
-
前往 Amazon EC2 控制台,点击左侧导航窗格中的安全组。
-
单击复选框,选择托管式节点组的安全组。
-
在标签选项卡下,使用管理标签按钮添加标签
for-use-with-emr-containers-managed-endpoint-sg=
。ClusterName
/NodeGroupName
将 JEG Pod 关联到自托管式节点组
以下配置属性允许您指定 Amazon EKS 集群上的自托管式或非托管式节点组的名称,JEG Pod 将在此集群中部署。
//payload --configuration-overrides '{ "applicationConfiguration": [ { "classification": "endpoint-configuration", "properties": { "self-managed-nodegroup-name":
NodeGroupName
} } ] }'
节点组必须将 for-use-with-emr-containers-managed-endpoint-ng=
Kubernetes 标签附加到属于该节点组的所有节点。要列出节点组中所有带有此标签的节点,请使用以下命令:NodeGroupName
kubectl get nodes --show-labels | grep for-use-with-emr-containers-managed-endpoint-ng=
NodeGroupName
如果上述命令的输出未返回属于自托管式节点组的节点,则该节点组中没有附加了 for-use-with-emr-containers-managed-endpoint-ng=
Kubernetes 标签的节点。在这种情况下,请按照以下步骤将此标签附加到节点组中的节点。NodeGroupName
-
如果您使用
eksctl
创建自托管式节点组,请使用以下命令将for-use-with-emr-containers-managed-endpoint-ng=
Kubernetes 标签一次性添加到自托管式节点组NodeGroupName
中的所有节点。NodeGroupName
kubectl label nodes --selector alpha.eksctl.io/nodegroup-name=
NodeGroupName
for-use-with-emr-containers-managed-endpoint-ng=NodeGroupName
如果您没有使用
eksctl
创建自托管式节点组,则需要将上述命令中的选择器替换为附加到该节点组的所有节点的其他 Kubernetes 标签。 -
使用以下命令验证节点是否已正确标记:
kubectl get nodes --show-labels | grep for-use-with-emr-containers-managed-endpoint-ng=
NodeGroupName
自托管式节点组的安全组必须附加 for-use-with-emr-containers-managed-endpoint-sg=
标签。使用以下步骤将标签附加到 Amazon Web Services Management Console的安全组。ClusterName
/NodeGroupName
-
导航至 Amazon EC2 控制台。在左侧导航窗格中,选择安全组。
-
选中自托管式节点组的安全组旁边的复选框。
-
在标签选项卡下,使用管理标签按钮添加标签
for-use-with-emr-containers-managed-endpoint-sg=
。用适当的值替换ClusterName
/NodeGroupName
和ClusterName
。NodeGroupName
将 JEG Pod 关联到具有按需型实例的托管式节点组
您还可以定义其他标签(称为 Kubernetes 标签选择器),以指定在给定节点或节点组上运行交互式端点的其他约束或限制。以下示例展示了如何使用按需 Amazon EC2 实例来创建 JEG 容器。
--configuration-overrides '{ "applicationConfiguration": [ { "classification": "endpoint-configuration", "properties": { "managed-nodegroup-name":
NodeGroupName
, "node-labels": "eks.amazonaws.com/capacityType:ON_DEMAND" } } ] }'
注意
只能将 node-labels
属性与 managed-nodegroup-name
或 self-managed-nodegroup-name
属性一起使用。