Este tópico descreve como implantar um pod em um nó da série de contêineres RDS Custom (nó de IA ou Node Lingjun) utilizando uma imagem de contêiner privada.
Pré-requisitos
Uma instância Enterprise Edition do Container Registry (ACR) deve estar ativada. Para mais informações, consulte Crie uma instância do Container Registry.
As tarefas prévias para utilizar uma instância ACR Enterprise Edition precisam estar concluídas, incluindo o vínculo com uma plataforma de código-fonte, a criação de um namespace e a criação de um repositório de imagens. Consulte as etapas 1 a 3 em Build an image using an Enterprise Edition instance para obter detalhes.
Um ACK managed cluster Pro Edition já foi criado. Veja mais em Crie um ACK managed cluster.
Um nó da série de contêineres RDS Custom foi provisionado e adicionado a um ACK managed cluster Pro Edition. Para instruções completas, acesse RDS Custom container series node user guide.
Procedimento
Conecte-se ao cluster ACK usando kubectl. Para mais informações, consulte Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
-
Execute o comando abaixo para criar um Secret do Kubernetes:
kubectl create secret docker-registry acr-secret-inner \ --docker-server=beijing-acr-registry-vpc.cn-beijing.cr.aliyuncs.com \ --docker-username=ACK@rctest \ --docker-password=Testpassword@123Notaregsecret: Nome personalizado do secret.--docker-server: Endereço do repositório Docker.--docker-username: Nome de usuário para acesso ao repositório Docker.--docker-password: Senha correspondente ao repositório Docker.
-
Verifique se o Secret foi criado corretamente executando este comando:
kubectl get secrets acr-secret-inner -o yaml -
Prepare o arquivo de configuração do pod.
Salve o conteúdo a seguir como
pod.yaml.apiVersion: v1 kind: Pod metadata: name: sglang-qwen3 # The name of the pod. spec: containers: - command: - sh - -c - echo hello world; sleep infinity; # The command to run after the container starts. This is an example. image: beijing-acr-registry-vpc.cn-beijing.cr.aliyuncs.com/testvnode/acr-beijing:sglang_v1 # The address of the private image. imagePullPolicy: IfNotPresent # Pulls the image only if it is not present locally. In a production environment, set this parameter to Always. name: sglang # The name of the container. ports: - containerPort: 8000 # The port that the container listens on. name: restful protocol: TCP resources: requests: cpu: "80" memory: "300Gi" nvidia.com/gpu: "8" limits: cpu: "80" memory: "300Gi" nvidia.com/gpu: "8" restartPolicy: Always # Restarts the pod if it fails. imagePullSecrets: # The Secret used to pull the private image. - name: acr-secret-inner nodeSelector: # Schedules the pod to a node with the specified label (a virtual node). alibabacloud.com/virtual-node: "true" tolerations: # Tolerates the taints of the virtual node. - effect: NoSchedule key: virtual-kubelet.io/provider value: aliclouddb -
Implante o pod com o seguinte comando:
kubectl apply -f pod.yaml