-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Doc]: Add deploying_with_k8s guide #8451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,173 @@ | ||||
| .. _deploying_with_k8s: | ||||
|
|
||||
| Deploying with Kubernetes | ||||
| ========================== | ||||
|
|
||||
| Using Kubernetes to deploy vLLM is a scalable and efficient way to serve machine learning models. This guide will walk you through the process of deploying vLLM with Kubernetes, including the necessary prerequisites, steps for deployment, and testing. | ||||
|
|
||||
| Prerequisites | ||||
| ------------- | ||||
| Before you begin, ensure that you have the following: | ||||
|
|
||||
| - A running Kubernetes cluster | ||||
| - NVIDIA Kubernetes Device Plugin (`k8s-device-plugin`): This can be found at `https://github.com/NVIDIA/k8s-device-plugin/` | ||||
| - Available GPU resources in your cluster | ||||
|
|
||||
| Deployment Steps | ||||
| ---------------- | ||||
|
|
||||
| 1. **Create a PVC , Secret and Deployment for vLLM** | ||||
|
|
||||
| Create a Kubernetes deployment file that includes a PersistentVolumeClaim (PVC) and a Secret necessary for pulling the Hugging Face token. Here is an example deployment file: | ||||
|
|
||||
| .. code-block:: yaml | ||||
|
|
||||
| apiVersion: v1 | ||||
| kind: PersistentVolumeClaim | ||||
| metadata: | ||||
| name: mistral-7b | ||||
| namespace: llm | ||||
|
||||
| spec: | ||||
| accessModes: | ||||
| - ReadWriteOnce | ||||
| resources: | ||||
| requests: | ||||
| storage: 50Gi | ||||
| storageClassName: default | ||||
| volumeMode: Filesystem | ||||
| --- | ||||
| apiVersion: v1 | ||||
| kind: Secret | ||||
| metadata: | ||||
| name: hf-token-secret | ||||
| namespace: llm | ||||
| type: Opaque | ||||
| data: | ||||
| token: ******* | ||||
| --- | ||||
| apiVersion: apps/v1 | ||||
| kind: Deployment | ||||
| metadata: | ||||
| name: mistral-7b | ||||
| namespace: llm | ||||
| labels: | ||||
| app: mistral-7b | ||||
| spec: | ||||
| replicas: 1 | ||||
| revisionHistoryLimit: 1 | ||||
|
||||
| revisionHistoryLimit: 1 |
this is extra and we don't need this, let's remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment saying this is needed by vLLM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you comment this out, these are optional, since they really do help us prioritize or deprecate features 🥹
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these so they are left to default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a note saying this is useful for prefix caching feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need port-forward here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to use port forwarding because I am accessing the LLM in the Kubernetes cluster via mistral-7b.llm.svc.cluster.local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, update the docs for the PVC & Secret.