Ëæ×ÅDeepSeekµÄ¿ªÔ´£¬AI¿ª·¢ÓÀ´Á˸ü¹ã·ºµÄÆÕ¼°¡£DeepSeek-R1²ÉÓÃÁË˼άÁ´£¨CoT£©ÍÆÀí¼¼Êõ£¬Äܹ»½«¸´ÔÓÎÊÌâ²ð½âΪһϵÁиüС¡¢¸üÒ×´¦ÀíµÄ²½Ö裬Òò¶øÌáÉýÁËÄ£ÐÍÔÚ½â¾öÊýѧÎÊÌâ¡¢Âß¼ÃÕÌâµÈÈÎÎñʱµÄÄÜÁ¦¡£½èÖúAmazon EKS Auto ModeÍйÜDeepSeek£¬¾ÍÎÞÐèÔÙΪ¹ÜÀíµ×²ãµÄKubernetes»ù´¡¼Ü¹¹¶ø·³ÄÕ£¬¿ÉÒÔ½«¸ü¶à¾«Á¦Í¶È뵽ģÐ͵IJ¿ÊðÓëÓ¦ÓÃÉÏ¡£±¾ÎĽ«Ïêϸ½éÉÜÈçºÎʹÓÃÑÇÂíÑ·ÔÆ¿Æ¼¼Amazon EKSÍйÜDeepSeek-R1Ä£ÐÍ¡£
ÑÇÂíÑ·ÔÆ¿Æ¼¼¹ÙÍø£ºµã»÷·ÃÎÊ£¨×¢²áÁ¢Ïí40+Ãâ·ÑÔÆ²úÆ·£©
ÒÔÏÂÑ¡ÓÃDeepSeek-R1-Distill-Llama-8BÕôÁóÄ£ÐÍ¡£ÓëÓµÓÐ671B²ÎÊýµÄÍêÕûDeepSeek-R1Ä£ÐÍÏà±È£¬¸ÃÕôÁóÄ£ÐͶÔ×ÊÔ´µÄÐèÇóÏÔÖø½µµÍ£¬ËäÈ»¹¦ÄÜÉÏÉÔÑ·Ò»³ï£¬µ«ÌṩÁ˸üΪÇáÁ¿¼¶µÄ²¿ÊðÑ¡Ôñ¡£Èç¹ûÄúÏ£Íû²¿ÊðÍêÕûµÄDeepSeek – R1Ä£ÐÍ£¬Ö»ÐèÔÚvLLMÅäÖÃÖÐÌæ»»µôÕôÁóÄ£Ðͼ´¿É¡£
Ò»¡¢°²×°PreReqs
ΪÁ˼ò»¯ÉèÖÃÁ÷³Ì£¬±¾ÎĽ«½èÖúAmazon CloudShell½øÐвÙ×÷¡£
¶þ¡¢Ê¹ÓÃTerraform´´½¨ÆôÓÃAuto ModeµÄAmazon EKS¼¯Èº# Installing kubectl
curl -LO “https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl”
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl# Install Terraform
sudo yum install -y yum-utils
sudo yum-config-manager –add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
sudo yum -y install terraform
ÀûÓÃTerraform¿ÉÒÔÇáËÉÍê³É»ù´¡¼Ü¹¹µÄÅäÖ㬰üÀ¨Amazon VPC¡¢Amazon ECR´æ´¢¿âÒÔ¼°ÆôÓÃAuto ModeµÄAmazon EKS¼¯Èº¡£
Èý¡¢´´½¨Ò»¸öÖ§³ÖGPUµÄ×Ô¶¨ÒåNodePool# Clone the GitHub repo with the manifests
git clone -b v0.1 https://github.com/aws-samples/deepseek-using-vllm-on-eks
cd deepseek-using-vllm-on-eks# Apply the Terraform configuration
terraform init
terraform apply -auto-approve# After Terraform finishes, configure kubectl with the new EKS cluster
$(terraform output configure_kubectl | jq -r)
# Create a custom NodePool with GPU supportkubectl apply -f manifests/gpu-nodepool.yaml
ËÄ¡¢²¿ÊðDeepSeekÄ£ÐÍ# Check if the NodePool is in ‘Ready’ statekubectl get nodepool/gpu-nodepool
Ϊ¼ò»¯Ê¹ÓÃvLLM²¿ÊðDeepSeek – R1 – Distill – Llama – 8BÄ£Ð͵Ĺý³Ì£¬±¾ÑÝʾÌṩÁËÒ»¸ö sedÃüÁ¿ÉÇáËÉÉèÖÃÄ£ÐÍÃû³ÆºÍ²ÎÊý¡£
# Use the sed command to replace the placeholder with the model name and configuration parameters
sed -i “s|__MODEL_NAME_AND_PARAMETERS__|deepseek-ai/DeepSeek-R1-Distill-Llama-8B –max_model 2048|g” manifests/deepseek-deployment-gpu.yaml# Deploy the DeepSeek model on Kubernetes
kubectl apply -f manifests/deepseek-deployment-gpu.yaml# Check the pods in the ‘deepseek’ namespace
kubectl get po -n deepseek
Æð³õµ±Amazon EKS Auto ModeΪµ×²ãAmazon EC2ʵÀýÅäÖÃËùÐèµÄGPUÇý¶¯³ÌÐòʱPod¿ÉÄܻᴦÓÚPending£¨´ý´¦Àí£©×´Ì¬¡£ÈôPodÔÚPending״̬ͣÁôÁ˼¸·ÖÖÓ£¬ÇëÈ·ÈÏÑÇÂíÑ·ÔÆ¿Æ¼¼ÕË»§ÓÐ×ã¹»µÄ·þÎñÅä¶îÀ´Æô¶¯ËùÐèµÄʵÀý£¬ÄúÐèÒª¼ì²éG»òPʵÀýµÄÅä¶îÏÞÖÆÇé¿ö¡£
×¢Ò⣺ÕâЩÅä¶îÊÇ»ùÓÚvCPU¶ø·ÇʵÀýÊýÁ¿£¬Òò´ËÇëÎñ±Ø°´ÒªÇóÉêÇëÅä¶î¡£
# Wait for the pod to reach the ‘Running’ state
watch -n 1 kubectl get po -n deepseek# Verify that a new Node has been created
kubectl get nodes -l owner=data-engineer# Check the logs to confirm that vLLM has started
kubectl logs deployment.apps/deepseek-deployment -n deepseek
²¿Êð×¼±¸¾ÍÐ÷ºó£¬ÈÕÖ¾ÌõÄ¿½«ÏÔʾ¡°Ó¦ÓóÌÐòÆô¶¯Íê³É¡±¡£
Îå¡¢ÓëDeepSeek LLM½»»¥½ÓÏÂÀ´£¬´´½¨Ò»¸ö±¾µØ´úÀí£¬Í¨¹ýcurlÇëÇóÓëÄ£ÐͽøÐн»»¥¡£
# Set up a proxy to forward the service port to your local terminal
kubectl port-forward svc/deepseek-svc -n deepseek 8080:80 > port-forward.log 2>&1 &# Send a curl request to the model
curl -X POST “http://localhost:8080/v1/chat/completions” -H “Content-Type: application/json” –data ‘{
“model”: “deepseek-ai/DeepSeek-R1-Distill-Llama-8B”,
“messages”: [
{
“role”: “user”,
“content”: “What is Kubernetes?”
}
]
}’
¸ù¾ÝÄ£ÐÍÊä³öµÄ¸´Ôӳ̶ȣ¬ÏìÓ¦¿ÉÄÜÐèÒª¼¸ÃëÖÓʱ¼ä£¬¿ÉÒÔͨ¹ýdeepseek – deploymentÈÕÖ¾¼à¿Ø½ø¶È¡£
Áù¡¢ÎªÄ£Ð͹¹½¨ÁÄÌì»úÆ÷ÈËUI½çÃæÖ±½ÓʹÓÃAPIÇëÇó¹ÌÈ»¿ÉÐУ¬µ«¹¹½¨Ò»¸ö¸üÓѺõÄÁÄÌì»úÆ÷ÈËUI½çÃæÀ´ÓëÄ£Ðͽ»»¥»á´øÀ´¸üºÃµÄÌåÑé¡£¸Ã½çÃæµÄÔ´´úÂëÒÑÔÚGitHubÖÐÌṩ¡£
# Retrieve the ECR repository URI created by Terraform
export ECR_REPO=$(terraform output ecr_repository_uri | jq -r)# Build the container image for the Chatbot UI
docker build -t $ECR_REPO:0.1 chatbot-ui/application/.# Login to ECR and push the image
aws ecr get-login-password | docker login –username AWS –password-stdin $ECR_REPO
docker push $ECR_REPO:0.1# Update the deployment manifest to use the image
sed -i “s#__IMAGE_DEEPSEEK_CHATBOT__#$ECR_REPO:0.1#g” chatbot-ui/manifests/deployment.yaml# Generate a random password for the Chatbot UI login
sed -i “s|__PASSWORD__|$(openssl rand -base64 12 | tr -dc A-Za-z0-9 | head -c 16)|” chatbot-ui/manifests/deployment.yaml# Deploy the UI and create the ingress class required for load balancers
kubectl apply -f chatbot-ui/manifests/ingress-class.yaml
kubectl apply -f chatbot-ui/manifests/deployment.yaml# Get the URL for the load balancer to access the application
echo http://$(kubectl get ingress/deepseek-chatbot-ingress -n deepseek -o json | jq -r ‘.status.loadBalancer.ingress[0].hostname’)
µÈ´ý¼¸ÃëÖÓ£¬ÒÔ±ã¸ºÔØ¾ùºâÆ÷Íê³ÉÅäÖá£Òª·ÃÎÊÁÄÌì»úÆ÷ÈËUI½çÃæ£¬ÐèҪʹÓô洢ÔÚKubernetesÃÜÔ¿ÖеÄÓû§ÃûºÍÃÜÂë¡£
echo -e “Username=$(kubectl get secret deepseek-chatbot-secrets -n deepseek -o jsonpath='{.data.admin-username}’ | base64 –decode)\nPassword=$(kubectl get secret deepseek-chatbot-secrets -n deepseek -o jsonpath='{.data.admin-password}’ | base64 –decode)”
µÇ¼ºó£¬½çÃæ½«ÏÔʾһ¸öеġ°ÁÄÌì»úÆ÷ÈË¡±Ñ¡Ï£¬¿ÉÒÔÔÚÆäÖÐÓëÄ£ÐͽøÐн»»¥¡£
Ïà¹ØÍÆ¼ö£º
¡¶DigitalOcean GPU Droplets²¿ÊðDeepSeek AIÄ£Ðͽ̡̳·
¡¶Hostinger VPSÔËÐÐDeepSeekʹÓÃÖ¸ÄÏ¡·
(±¾ÎÄÓÉÖÇËãÔÆÔ´´£¬×ªÔØÇë×¢Ã÷³ö´¦¡°ÖÇËãÔÆ¡±ºÍÔÎĵØÖ·£¡)

΢ÐÅɨÂë¼ÓºÃÓѽøÈº
Ö÷»úÓÅ»ÝÂë¼°Ê±ÕÆÎÕ

QQȺºÅ£º938255063
Ö÷»úÓŻݷ¢²¼Óë½»Á÷