Skip to content
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

ci: fix backup related test cases fail on talos #2226

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

yangchiu
Copy link
Member

@yangchiu yangchiu commented Dec 24, 2024

Which issue(s) this PR fixes:

Issue longhorn/longhorn#10063

What this PR does / why we need it:

fix backup related test cases fail on talos

Special notes for your reviewer:

Additional documentation or context

Summary by CodeRabbit

  • New Features

    • Enhanced node selection logic for MinIO and NFS backup stores through updated affinity configurations.
    • New secret minio-secret created in the longhorn-system namespace for sensitive data management.
  • Bug Fixes

    • Improved scheduling flexibility for longhorn-test-minio and longhorn-test-nfs deployments.

@yangchiu yangchiu self-assigned this Dec 24, 2024
@yangchiu yangchiu requested a review from a team as a code owner December 24, 2024 11:17
Copy link

coderabbitai bot commented Dec 24, 2024

Walkthrough

The pull request modifies Kubernetes deployment configurations for MinIO and NFS backup stores in the Longhorn test environment. The key changes involve replacing nodeSelector with more flexible nodeAffinity configurations. For MinIO, a new secret is created in the longhorn-system namespace, mirroring the existing secret in the default namespace. The changes aim to improve node scheduling flexibility, particularly for Talos Kubernetes clusters where node labels might differ from traditional setups.

Changes

File Change Summary
manager/integration/deploy/backupstores/minio-backupstore.yaml - Added minio-secret in longhorn-system namespace
- Replaced nodeSelector with nodeAffinity in deployment
manager/integration/deploy/backupstores/nfs-backupstore.yaml - Replaced nodeSelector with nodeAffinity in deployment

Assessment against linked issues

Objective Addressed Explanation
Fix backup test failures on Talos Jenkins pipeline [#10063] Modifications address node selector issues, but full resolution requires verification
Handle different control plane node label formats New nodeAffinity supports both "true" and "" label values

Possibly related PRs

Suggested reviewers

  • roger-ryao
  • khushboo-rancher

Poem

🐰 In the realm of Kubernetes deploy,
Where nodes dance and secrets deploy,
MinIO and NFS take flight,
With affinity rules shining bright,
A backup ballet, code's sweet joy! 🚀


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
manager/integration/deploy/backupstores/minio-backupstore.yaml (1)

Line range hint 1-40: Consider using a secure secret management system

While the secret configuration is functional, storing sensitive data (certificates, keys) directly in YAML files, even when base64 encoded, is not ideal from a security perspective.

Consider:

  1. Using a secure secret management system (e.g., HashiCorp Vault, AWS Secrets Manager)
  2. Implementing dynamic secret injection
  3. Documenting that this configuration is for testing purposes only
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 416a194 and c930ae4.

📒 Files selected for processing (2)
  • manager/integration/deploy/backupstores/minio-backupstore.yaml (1 hunks)
  • manager/integration/deploy/backupstores/nfs-backupstore.yaml (1 hunks)
🔇 Additional comments (3)
manager/integration/deploy/backupstores/nfs-backupstore.yaml (1)

17-26: LGTM! Node affinity configuration improves compatibility with Talos

The replacement of nodeSelector with nodeAffinity is a good change that improves compatibility with Talos Kubernetes clusters while maintaining functionality on traditional clusters. The configuration properly handles both cases where the control-plane label value is "true" or empty.

manager/integration/deploy/backupstores/minio-backupstore.yaml (2)

44-53: LGTM! Consistent node affinity configuration

The nodeAffinity configuration matches the NFS backupstore, maintaining consistency across both backup store deployments. This change properly handles both traditional Kubernetes and Talos clusters.


Line range hint 1-53: Verify other backup store configurations

Let's check if there are any other backup store configurations that might need similar updates for Talos compatibility.

✅ Verification successful

Backup store configurations are consistently updated

Based on the search results, I can confirm that:

  1. There are two backup store configurations in the codebase:

    • manager/integration/deploy/backupstores/minio-backupstore.yaml
    • manager/integration/deploy/backupstores/nfs-backupstore.yaml
  2. Both configurations have been updated with the same node affinity rules that support Talos compatibility:

nodeAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchExpressions:
      - key: node-role.kubernetes.io/control-plane
        operator: In
        values:
        - "true"

The changes are consistent across both backup store configurations, ensuring proper Talos compatibility throughout the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other backup store configurations that might need similar updates
echo "Searching for other backup store configurations..."
fd -e yaml -e yml | xargs rg -l "nodeSelector.*control-plane" 

echo "Searching for other potential secret configurations..."
fd -e yaml -e yml | xargs rg -l "kind: Secret.*minio-secret"

Length of output: 356


Script:

#!/bin/bash
# Let's try a different approach to search for backup store configurations and node affinity rules

# Search for yaml files containing backup store configurations
echo "=== Searching for backup store yaml files ==="
fd backupstore

# Search for node affinity or nodeSelector patterns
echo -e "\n=== Searching for node affinity patterns ==="
rg -A 5 "nodeAffinity|nodeSelector" --type yaml

# Search for minio-related configurations
echo -e "\n=== Searching for minio configurations ==="
rg -l "minio|AWS_" --type yaml

Length of output: 3116

Copy link
Contributor

@chriscchien chriscchien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants