-
Notifications
You must be signed in to change notification settings - Fork 493
[helm]: Include default helpers, rename using fullname #1828
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @cabrinha, 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 significantly refactors the Helm chart's helper templates and resource naming conventions. The primary goal is to standardize how names, labels, and other common attributes are generated for Kubernetes resources, moving away from hardcoded values and inconsistent patterns. By introducing a comprehensive set of new helper functions and applying them throughout the chart, this change enhances the chart's maintainability, flexibility, and adherence to Helm best practices, making deployments more robust and easier to manage. Highlights
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors Helm templates by introducing new aibrix.* helpers for consistent and dynamic naming of Kubernetes resources, replacing older chart.* helpers. The changes update resource names, labels, and image pull secret references across various components including the controller-manager, gateway-instance, gateway-plugin, GPU optimizer, metadata service, Prometheus, and webhooks. Review comments indicate several areas needing further attention: specifically, some resource name references (like RouteConfiguration in gateway.yaml, serverName in monitor.yaml, and a webhook secret in controller-manager/deployment.yaml) were not fully updated to the new dynamic naming, a static Redis host name in values.yaml is still referenced by multiple deployments, the newly introduced aibrix.serviceAccountName helper is not yet utilized, and an indentation error was found in controller-manager/deployment.yaml for imagePullSecrets. However, the correction of a hardcoded webhook-service name to a dynamic one was noted as a positive improvement.
| namespace: {{ .Release.Namespace }} | ||
| {{- include "aibrix.labels" . | nindent 4 }} | ||
| app.kubernetes.io/component: aibrix-metadata-service | ||
| name: {{ include "aibrix.fullname" . }}-redis-master |
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.
While it's correct to rename the Redis service to use fullname, the Redis host is configured in values.yaml with the old static name (aibrix-redis-master). Several deployments (gateway-plugin, gpu-optimizer, metadata-service) use this static value from values.yaml, which will now be incorrect and break communication with Redis. The templates should be updated to construct the Redis host name dynamically (e.g., {{ include "aibrix.fullname" . }}-redis-master) instead of relying on values.yaml.
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.
Actually, we should replace this implementation of redis with something better maintained and also with support for HA, like: https://github.com/DandyDeveloper/charts/tree/master/charts/redis-ha -- This should be pulled in as a chart dependency.
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.
For now, I'll name the redis components based off {{ .Values.gatewayPlugin.dependencies.redis.host }}, but I'll quickly follow up with another PR to replace this implementation of redis with an HA option which can be enabled/disabled with a bool.
b4003a2 to
70b25b9
Compare
|
please help check the critical comments. I will help review this PR later. Thanks for the contribution! |
4706eed to
bde2885
Compare
|
/gemini review |
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.
Code Review
This pull request is a great step towards standardizing the Helm chart by introducing common helpers from helm create and using fullname for resource naming. This significantly improves consistency and maintainability. The removal of hardcoded namespaces is also a welcome change.
My review has found a few issues:
- A critical misconfiguration in an RBAC
ClusterRoleBindingthat would prevent it from working correctly. - Inconsistent resource naming for the Redis sub-component, which doesn't follow the new
fullnameconvention. - A minor label inaccuracy on the Redis service.
I've provided specific comments and suggestions to address these points. Once these are fixed, the chart will be in a much better state.
ff2cdaa to
f00a1f6
Compare
|
/gemini review |
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.
Code Review
This pull request introduces two main changes. First, it refactors the Helm chart to use standard helpers and naming conventions, which is a great improvement for maintainability and multi-release deployments. The changes are mostly correct and follow best practices. However, I've found a critical bug related to imagePullSecrets and a design flaw in the new serviceAccountName helper that will limit its usability.
Second, it adds a comprehensive integration test suite for vLLM's LoRA functionality. This is a very valuable addition, and the tests are well-structured and cover many important scenarios and edge cases. This part of the PR looks excellent.
Please address the two issues I've raised in the Helm chart templates.
Signed-off-by: cabrinha <[email protected]>
* Add vLLM Lora testing scripts * Address code review feedback --------- Signed-off-by: Jiaxin Shan <[email protected]> Signed-off-by: cabrinha <[email protected]>
Signed-off-by: Jiaxin Shan <[email protected]> Signed-off-by: cabrinha <[email protected]>
Signed-off-by: cabrinha <[email protected]>
2a7d9f5 to
7838814
Compare
Signed-off-by: cabrinha <[email protected]>
|
/gemini review |
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.
Code Review
This pull request does a great job of refactoring the Helm chart to align with standard practices. Introducing a _helpers.tpl file with common helpers like aibrix.fullname and aibrix.labels, and using them to name and label resources consistently is a significant improvement for maintainability. Removing the hardcoded namespace from templates is also a welcome change.
My review focuses on the new helper templates. I've found a critical issue in the service account name generation logic that could cause template rendering to fail under certain conditions. I've also pointed out a minor copy-paste error in a comment. I've provided suggestions to fix these issues and simplify the logic.
Overall, this is a very positive change for the Helm chart. Once the identified issues are addressed, this will be ready to merge.
Signed-off-by: cabrinha <[email protected]>
|
/gemini review |
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.
Code Review
This pull request significantly improves the Helm chart by adopting standard practices, such as using _helpers.tpl for resource naming and labels, which makes the chart more reusable and maintainable. The removal of unnecessary namespace fields and the introduction of configurable service accounts are also great enhancements. I've identified one critical bug where a secret name remains hardcoded, which could break deployments. I've also suggested an improvement to the naming of RBAC resources for better clarity. Overall, this is a very positive and well-executed refactoring.
| kind: ClusterRole | ||
| metadata: | ||
| name: aibrix-controller-manager-clusterrole | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager |
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.
While it's valid to have a ClusterRole and ClusterRoleBinding with the same name, it can be confusing. The previous naming convention used suffixes like -clusterrole and -clusterrolebinding which improved clarity. It's a good practice to use distinct names for different resource kinds.
This pattern of identical names for different kinds appears throughout the RBAC files in this PR. For example, the leader-election Role and RoleBinding in this file also share a name.
Could you re-introduce suffixes for clarity across all RBAC resources? For this ClusterRole, I suggest:
name: {{ include "aibrix.fullname" . }}-controller-manager-clusterroleThere 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.
This is redundant because you can clearly see the differences between objects without the object type as a suffix on the name.
kubectl get role
kubectl get clusterrole
kubectl get rolebinding
kubectl get clusterrolebinding
Imagine if every k8s object had a suffix of it's kind. aibrix-deployment, aibrix-service, etc. So, I disagree 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.
It works, we just need to make sure that upgrade experiences still smooth. Consider it will create new objects, I do not have concerns here
Signed-off-by: cabrinha <[email protected]>
Done, ready for review. I'm available in the vLLM slack for discussion. |
| name: aibrix-controller-manager | ||
| namespace: {{ .Release.Namespace }} | ||
| {{- include "aibrix.labels" . | nindent 4 }} | ||
| name: {{ include "aibrix.fullname" . }}-controller-manager |
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.
any concerns to use fixed component name?
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.
If anyone wants to deploy more than 1 instance of aibrix chart to their cluster or rename it to something like aibrix-dev or something else, the fullname helper works here. Most helm charts use the fullname helper, which defaults the the chart name or the helm release name.
| affinity: {} | ||
| redis: | ||
| host: aibrix-redis-master | ||
| host: "" # aibrix-redis-master |
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're test errors seems related to redis, please help take a look
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.
Oh, I see here. The init containers are looking for that redis-host value.
I also see another issue is with this:
Line 29 in c3e63f9
| secretName = "aibrix-webhook-server-cert" |
The rotator.go file is expecting a hard-coded name for the certificate, and the helm release installed was named: aibrix-r8crnksvwc, which is actually good because users should be able to choose their own helm release name.
I'll push a commit to set the webhook-server-cert name back to a hardcoded value to see if that fixes the test, but I think the code should be more flexible to reference the secret somehow, possibly using label selectors and namespace? Not sure.
Signed-off-by: cabrinha <[email protected]>
Signed-off-by: cabrinha <[email protected]>
Signed-off-by: cabrinha <[email protected]>
d1927fe to
d80781c
Compare
Pull Request Description
The current helm chart includes
namespace: {{ .Release.Namespace }} everywhere, which is unnecessary. It also lacks default_helpers.tploften found when usinghelm create ` which means labels and selector labels would be non-standard.Related Issues
Resolves: #[Insert issue number(s)]
Contribution Guidelines (Expand for Details)
We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:
Pull Request Title Format
Your PR title should start with one of these prefixes to indicate the nature of the change:
[Bug]: Corrections to existing functionality[CI]: Changes to build process or CI pipeline[Docs]: Updates or additions to documentation[API]: Modifications to aibrix's API or interface[CLI]: Changes or additions to the Command Line Interface[Misc]: For changes not covered above (use sparingly)Note: For changes spanning multiple categories, use multiple prefixes in order of importance.
Submission Checklist
By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.