-
Notifications
You must be signed in to change notification settings - Fork 64
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
fix uploading vm images using virtctl #422
Conversation
WalkthroughThe changes involve significant updates to the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: Andrei Kvapil <[email protected]>
Signed-off-by: Andrei Kvapil <[email protected]>
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
packages/system/kubevirt-cdi/values.yaml (1)
1-2
: Consider expanding the configuration file.The current configuration file only contains two parameters. Depending on the requirements of your KubeVirt CDI setup, you might need to include additional configuration options.
Consider adding other common CDI configuration parameters, such as:
- Resource limits and requests
- Storage class configurations
- Networking policies
- Security settings
If these are defined elsewhere or use default values, it might be helpful to add comments explaining this.
packages/system/kubevirt-cdi/templates/ingress.yaml (1)
10-22
: Ingress specification is properly configured.The Ingress specification is well-structured:
- The
ingressClassName
is dynamically set using the provided value.- The host is set using the
uploadProxyHost
value.- The backend service and port are correctly specified.
- The path and pathType are appropriately set for routing all traffic to the service.
However, there's one potential improvement to consider:
Consider adding TLS configuration to the Ingress spec for enhanced security. This would typically involve adding a
tls
section underspec
. For example:spec: tls: - hosts: - {{ .Values.uploadProxyHost }} secretName: cdi-uploadproxy-tlsNote that you'd need to ensure the TLS secret is created separately.
packages/apps/tenant/templates/networkpolicy.yaml (1)
162-171
: LGTM! Consider adding a comment for clarity.The new 'allow-to-cdi-upload-proxy' policy is well-structured and aligns with the PR objective of fixing VM image uploading using virtctl. It correctly allows egress traffic to the CDI upload proxy in the 'cozy-kubevirt-cdi' namespace.
Consider adding a brief comment explaining the purpose of this policy, for example:
metadata: name: allow-to-cdi-upload-proxy namespace: {{ include "tenant.name" . }} # Allow communication with CDI upload proxy for VM image uploading spec: # ... (rest of the policy remains unchanged)This will help future maintainers understand the policy's purpose at a glance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (6)
- packages/apps/tenant/Chart.yaml (1 hunks)
- packages/apps/tenant/templates/networkpolicy.yaml (1 hunks)
- packages/apps/versions_map (1 hunks)
- packages/system/kubevirt-cdi/templates/cdi-cr.yaml (1 hunks)
- packages/system/kubevirt-cdi/templates/ingress.yaml (1 hunks)
- packages/system/kubevirt-cdi/values.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/apps/tenant/Chart.yaml
🧰 Additional context used
🪛 yamllint
packages/system/kubevirt-cdi/templates/cdi-cr.yaml
[warning] 8-8: wrong indentation: expected 2 but found 4
(indentation)
[error] 7-7: syntax error: expected the node content, but found '-'
(syntax)
packages/system/kubevirt-cdi/templates/ingress.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
🔇 Additional comments (12)
packages/system/kubevirt-cdi/values.yaml (2)
1-1
: Verify theuploadProxyHost
configuration.The
uploadProxyHost
is set to "cdi.infra.aenix.org". This appears to be an internal infrastructure endpoint for the CDI upload proxy service.Please confirm that:
- This hostname is correct and accessible within your infrastructure.
- The necessary DNS records and network configurations are in place to route traffic to this host.
- The upload proxy service is properly configured to handle requests at this hostname.
✅ Verification successful
uploadProxyHost
configuration verified successfully.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify if the uploadProxyHost is referenced in other configuration files rg --type yaml "cdi.infra.aenix.org"Length of output: 116
2-2
: Confirm theingressClass
configuration.The
ingressClass
is set to "tenant-root", which is a non-standard value.Please ensure that:
- This ingress class exists in your Kubernetes cluster.
- It's the correct class for routing CDI-related traffic.
- The corresponding Ingress controller is properly configured to handle this class.
packages/system/kubevirt-cdi/templates/cdi-cr.yaml (1)
7-9
: LGTM! Dynamic configuration of uploadProxyURLOverrideThe addition of the conditional block for
uploadProxyURLOverride
is a good improvement. It allows for dynamic configuration of the upload proxy URL based on the provided Helm values, which aligns with the PR objective of fixing VM image uploads using virtctl.A few observations:
- The use of Helm templating here is appropriate and allows for flexible configuration.
- The indentation appears correct for Helm templates, despite the yamllint warning.
- This change enhances the adaptability of the CDI configuration across different environments.
To ensure this change is properly utilized, let's verify the
uploadProxyHost
value in the Helm chart:🧰 Tools
🪛 yamllint
[warning] 8-8: wrong indentation: expected 2 but found 4
(indentation)
[error] 7-7: syntax error: expected the node content, but found '-'
(syntax)
packages/system/kubevirt-cdi/templates/ingress.yaml (6)
1-1
: Conditional creation looks good.The Ingress resource is conditionally created based on the presence of both
uploadProxyHost
andingressClass
values. This is a good practice to ensure the Ingress is only created when necessary.🧰 Tools
🪛 yamllint
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
2-3
: API version and kind are correct.The use of
networking.k8s.io/v1
for the API version is appropriate for recent Kubernetes versions. Thekind: Ingress
is also correct.
4-9
: Metadata and annotations are well-defined.The metadata and annotations are correctly specified:
- The name "cdi-uploadproxy" is descriptive and aligns with the service it's routing to.
- The NGINX ingress controller annotations are appropriate for the use case, enabling HTTPS backend, SSL passthrough, and SSL redirect.
23-23
: Conditional block is properly closed.The conditional block is correctly closed with the
{{- end }}
directive.
1-1
: Note on YAML linting:The static analysis tool (yamllint) reported a syntax error on this line, but this is a false positive. The
{{- if ... }}
syntax is valid Helm template syntax used for conditional rendering and whitespace control. No changes are needed here.🧰 Tools
🪛 yamllint
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
1-23
: Overall, the Ingress resource is well-defined and aligns with the PR objectives.This new Ingress resource for the cdi-uploadproxy service is correctly implemented using Helm templating. It addresses the PR objective of fixing uploading VM images using virtctl by providing a proper ingress configuration. The conditional creation, correct API version, appropriate annotations, and well-structured specification all contribute to a solid implementation.
The only suggested improvement is to consider adding TLS configuration for enhanced security. Otherwise, this implementation should effectively route traffic to the cdi-uploadproxy service, facilitating the upload of VM images.
🧰 Tools
🪛 yamllint
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
packages/apps/versions_map (1)
75-76
: Version updates for the tenant package look good.The changes to the tenant package versions are consistent with the file's structure and show a logical progression:
- Version 1.4.0 has been updated from HEAD to a specific commit (94c688f), indicating a stabilization of this version.
- A new version 1.5.0 has been added, pointing to HEAD, suggesting ongoing development.
These updates align with good versioning practices. However, it's not immediately clear how these changes relate to the PR objective of "fix uploading vm images using virtctl".
To ensure these changes are related to the PR objective, please run the following script:
This script will help verify if the specified commit or recent changes in the tenant package are related to the PR objective.
✅ Verification successful
Tenant package version updates are verified and relevant to the PR objective.
The recent changes in the tenant package versions align with the PR objective of fixing VM image uploads using virtctl:
- The addition of tenant 1.5.0 points to ongoing development, which includes the commit
cde1bca
("Allow specifying uploadproxy url") related to upload functionalities.- The update of tenant 1.4.0 to a specific commit ensures stability for this version.
These updates confirm that the version changes support the objectives of the PR.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if the commit 94c688f7 or recent commits in the tenant package are related to VM image uploading or virtctl. # Test 1: Check the commit message for 94c688f7 echo "Checking commit 94c688f7:" git show --no-patch --format=%B 94c688f7 | grep -iE "vm|image|upload|virtctl" # Test 2: Check recent commits in the tenant package echo "Checking recent commits in the tenant package:" git log -n 10 --oneline -- packages/apps/tenant | grep -iE "vm|image|upload|virtctl"Length of output: 371
packages/apps/tenant/templates/networkpolicy.yaml (2)
162-173
: Overall structure and consistency look good.The new 'allow-to-cdi-upload-proxy' policy is well-integrated into the existing file structure. It maintains consistency with other policies in terms of indentation, naming conventions, and overall format. The placement at the end of the file, just before the 'allow-to-ingress' policy, is appropriate and doesn't disrupt the existing flow of policies.
The changes align well with the existing file structure and do not interfere with the conditional logic used for other policies.
162-171
: Consider conditional application of the new policy.The new 'allow-to-cdi-upload-proxy' policy effectively supports the PR objective of fixing VM image uploading using virtctl. However, it's applied unconditionally to all pods in the namespace.
To ensure this aligns with the intended behavior:
- Confirm if this policy should always be applied or only under certain conditions.
- If conditional application is appropriate, consider wrapping it in a conditional block similar to other policies in this file.
For example:
{{- if .Values.enableCDIUpload }} apiVersion: cilium.io/v2 kind: CiliumNetworkPolicy metadata: name: allow-to-cdi-upload-proxy namespace: {{ include "tenant.name" . }} spec: # ... (rest of the policy remains unchanged) {{- end }}This would allow more fine-grained control over when this policy is applied.
Signed-off-by: Andrei Kvapil <[email protected]>
Signed-off-by: Andrei Kvapil <[email protected]>
Upstream fix:
kubevirt/containerized-data-importer#3461
Signed-off-by: Andrei Kvapil [email protected]
Summary by CodeRabbit
New Features
v1beta1
) for the CDI operator alongside the existing version, enhancing configuration options.spec
section with detailed descriptions for various configurations including data volume management and TLS security profiles.cdi-uploadproxy
service, improving traffic routing capabilities.Improvements