[Feat] LMCache MP mode k8s operator#2701
Conversation
Signed-off-by: royyhuang <roy.y.huang@gmail.com>
Signed-off-by: royyhuang <roy.y.huang@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a Kubernetes operator for LMCache, addressing manual configuration complexities and enhancing deployment automation. The operator simplifies management, enforces best practices, and provides seamless integration with vLLM and Prometheus, improving the overall user experience and operational efficiency. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive Kubernetes operator for LMCache, including the controller implementation, CRD, RBAC, and extensive documentation. The overall structure and design are solid, following modern operator development practices. I've identified a few issues, primarily related to dependency pinning for reproducibility and a critical bug in the default container image used for the LMCache DaemonSet. Once these are addressed, this will be a great addition.
| type ImageSpec struct { | ||
| // repository is the container image repository. | ||
| // +optional | ||
| // +kubebuilder:default="lmcache/vllm-openai" |
There was a problem hiding this comment.
The default image repository is set to lmcache/vllm-openai. This seems incorrect for the LMCache server pods managed by this operator. Based on the design documents and sample manifests, the default should be lmcache/standalone. The lmcache/vllm-openai image is for vLLM deployments that connect to LMCache.
| // +kubebuilder:default="lmcache/vllm-openai" | |
| // +kubebuilder:default="lmcache/standalone" |
| podAnnotations := spec.PodAnnotations | ||
|
|
||
| serverPort := derefInt32(getServerPort(spec), 5555) | ||
| imgRepo := "lmcache/vllm-openai" |
There was a problem hiding this comment.
The image repository is hardcoded to lmcache/vllm-openai. This is incorrect for the LMCache DaemonSet, which should be running the LMCache server. The image should be lmcache/standalone to match the project's documentation and intended purpose.
| imgRepo := "lmcache/vllm-openai" | |
| imgRepo := "lmcache/standalone" |
| # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) | ||
| - module: "sigs.k8s.io/logtools" | ||
| import: "sigs.k8s.io/logtools/logcheck/gclplugin" | ||
| version: latest |
There was a problem hiding this comment.
| # Install kind | ||
| if ! command -v kind &> /dev/null; then | ||
| echo "Installing kind..." | ||
| curl -Lo /usr/local/bin/kind "https://kind.sigs.k8s.io/dl/latest/kind-linux-${ARCH}" |
There was a problem hiding this comment.
| @@ -0,0 +1,61 @@ | |||
| version: "2" | |||
Signed-off-by: royyhuang <roy.y.huang@gmail.com>
Signed-off-by: royyhuang <roy.y.huang@gmail.com>
Signed-off-by: royyhuang <roy.y.huang@gmail.com>
Signed-off-by: royyhuang <roy.y.huang@gmail.com>
…into feat/lmcache-operator
Signed-off-by: royyhuang <roy.y.huang@gmail.com>
* [feat] add k8s opeartor for MP mode Signed-off-by: royyhuang <roy.y.huang@gmail.com> * [misc] remove unncessary hostPID Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix false positive errors in precommit spellchecks Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix lint Signed-off-by: royyhuang <roy.y.huang@gmail.com> * skip python tests and builds for operator only changes Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix flaky e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> --------- Signed-off-by: royyhuang <roy.y.huang@gmail.com>
* [feat] add k8s opeartor for MP mode Signed-off-by: royyhuang <roy.y.huang@gmail.com> * [misc] remove unncessary hostPID Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix false positive errors in precommit spellchecks Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix lint Signed-off-by: royyhuang <roy.y.huang@gmail.com> * skip python tests and builds for operator only changes Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix flaky e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> --------- Signed-off-by: royyhuang <roy.y.huang@gmail.com> Signed-off-by: shaoxiawjc <wjc2800@163.com>
* [feat] add k8s opeartor for MP mode Signed-off-by: royyhuang <roy.y.huang@gmail.com> * [misc] remove unncessary hostPID Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix false positive errors in precommit spellchecks Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix lint Signed-off-by: royyhuang <roy.y.huang@gmail.com> * skip python tests and builds for operator only changes Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix flaky e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> --------- Signed-off-by: royyhuang <roy.y.huang@gmail.com> Signed-off-by: Aaron Wu <aaron.wu@dell.com>
* [feat] add k8s opeartor for MP mode Signed-off-by: royyhuang <roy.y.huang@gmail.com> * [misc] remove unncessary hostPID Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix false positive errors in precommit spellchecks Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix lint Signed-off-by: royyhuang <roy.y.huang@gmail.com> * skip python tests and builds for operator only changes Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix flaky e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> --------- Signed-off-by: royyhuang <roy.y.huang@gmail.com>
* [feat] add k8s opeartor for MP mode Signed-off-by: royyhuang <roy.y.huang@gmail.com> * [misc] remove unncessary hostPID Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix false positive errors in precommit spellchecks Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix lint Signed-off-by: royyhuang <roy.y.huang@gmail.com> * skip python tests and builds for operator only changes Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix flaky e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> * fix e2e tests Signed-off-by: royyhuang <roy.y.huang@gmail.com> --------- Signed-off-by: royyhuang <roy.y.huang@gmail.com>
Implementation PR for #2693: implementing K8s operator for LMCache multiprocess mode.
If applicable: