Add helm installation for volcano-global#49
Add helm installation for volcano-global#49FAUST-BENCHOU wants to merge 1 commit intovolcano-sh:mainfrom
Conversation
Signed-off-by: zhoujinyu <2319109590@qq.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello @FAUST-BENCHOU, 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 enhances the deployment experience for 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. 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 Helm chart for deploying volcano-global, which is a valuable addition for simplifying the installation process. The overall structure of the chart is good, but I have identified several areas for improvement concerning Helm best practices, consistency, and security. Specifically, there is a critical issue in how container arguments are specified that will likely cause container startup failures. I've also noted security concerns regarding the default container security context and the use of the latest image tag. Furthermore, the chart's maintainability can be enhanced by consistently applying the provided Helm template helpers for labels and selectors. My detailed comments below provide specific suggestions to address these points.
| - --feature-gates={{ .Values.custom.feature_gates }} | ||
| {{- end }} | ||
| - -v={{ .Values.custom.controller_log_level }} | ||
| - 2>&1 |
There was a problem hiding this comment.
The argument 2>&1 is a shell redirection operator. When specified in the args list of a container spec, it is passed as a literal string argument to the entrypoint rather than being interpreted by a shell. This will likely cause the application to fail since it is not a valid argument. The --logtostderr flag is already in use, which should correctly handle directing logs to stderr. Please remove this line.
| {{- end }} | ||
| - --port={{ .Values.custom.webhook_port }} | ||
| - -v={{ .Values.custom.webhook_log_level }} | ||
| - 2>&1 |
There was a problem hiding this comment.
The argument 2>&1 is a shell redirection operator. When specified in the args list of a container spec, it is passed as a literal string argument to the entrypoint rather than being interpreted by a shell. This will likely cause the application to fail since it is not a valid argument. The --logtostderr flag is already in use, which should correctly handle directing logs to stderr. Please remove this line.
| webhook_image_name: "volcanosh/volcano-global-webhook-manager" | ||
| image_pull_secret: "" | ||
| image_pull_policy: "IfNotPresent" | ||
| image_tag_version: "latest" |
There was a problem hiding this comment.
Using the latest tag for container images is not recommended as it is mutable and can lead to unpredictable behavior and difficulties in tracking the version of the running code. It is a best practice to use a specific, immutable version tag. Since the appVersion in Chart.yaml is 1.0.0, I recommend using that as the default.
image_tag_version: "1.0.0"| capabilities: | ||
| add: ["DAC_OVERRIDE"] | ||
| drop: ["ALL"] |
There was a problem hiding this comment.
The DAC_OVERRIDE capability in the default security context allows the container to bypass file read, write, and execute permission checks, which poses a significant security risk. If this capability is not strictly necessary, it should be removed to adhere to the principle of least privilege. If file access is needed for mounted volumes like secrets, consider using fsGroup in the pod's securityContext as a more secure alternative.
capabilities:
drop: ["ALL"]| @@ -0,0 +1,12 @@ | |||
| apiVersion: v1 | |||
| {{/* | ||
| Controller labels | ||
| */}} | ||
| {{- define "volcano-global.controllerLabels" -}} | ||
| {{ include "volcano-global.labels" . }} | ||
| app: volcano-global-controller-manager | ||
| {{- if .Values.custom.controller_labels }} | ||
| {{- toYaml .Values.custom.controller_labels }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Webhook labels | ||
| */}} | ||
| {{- define "volcano-global.webhookLabels" -}} | ||
| {{ include "volcano-global.labels" . }} | ||
| app: volcano-global-webhook-manager | ||
| {{- if .Values.custom.webhook_labels }} | ||
| {{- toYaml .Values.custom.webhook_labels }} | ||
| {{- end }} | ||
| {{- end }} |
| app: volcano-global-controller-manager | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: volcano-global-controller-manager | ||
| {{- if .Values.custom.controller_podLabels }} | ||
| {{- toYaml .Values.custom.controller_podLabels | nindent 8 }} | ||
| {{- end }} |
There was a problem hiding this comment.
To align with Helm best practices and ensure consistency across the chart, it's recommended to use the volcano-global.selectorLabels helper for defining selectors and pod labels. This helper provides standard labels such as app.kubernetes.io/name and app.kubernetes.io/instance, which are part of the Kubernetes recommended labels.
{{- include "volcano-global.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "volcano-global.selectorLabels" . | nindent 8 }}
{{- if .Values.custom.controller_podLabels }}
{{- toYaml .Values.custom.controller_podLabels | nindent 8 }}
{{- end }}| matchLabels: | ||
| app: volcano-global-webhook-manager | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: volcano-global-webhook-manager | ||
| {{- if .Values.custom.webhook_podLabels }} | ||
| {{- toYaml .Values.custom.webhook_podLabels | nindent 8 }} | ||
| {{- end }} |
There was a problem hiding this comment.
To align with Helm best practices and ensure consistency across the chart, it's recommended to use the volcano-global.selectorLabels helper for defining selectors and pod labels. This helper provides standard labels such as app.kubernetes.io/name and app.kubernetes.io/instance, which are part of the Kubernetes recommended labels.
{{- include "volcano-global.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "volcano-global.selectorLabels" . | nindent 8 }}
{{- if .Values.custom.webhook_podLabels }}
{{- toYaml .Values.custom.webhook_podLabels | nindent 8 }}
{{- end }}|
/cc |
Closes #30
Installed via Helm:
Controller Manager Deployment、Webhook Manager Deployment、Webhook Service、Webhook initialization(SA + ClusterRole + ClusterRoleBinding + Job)