Skip to content

[tenant] Fix networkpolicy for accessing externalIPs from the cluster - #854

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-network-policies
Apr 23, 2025
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-network-policies

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Apr 23, 2025 •

Copy link
Copy Markdown
Member

This PR fixes an issue with accessing external IPs of cluster from cluster itself

Policy verdict log: flow 0x6c9bf32e local EP ID 1155, remote ID remote-node, proto 6, ingress, action deny, auth: disabled, match none, 172.27.88.13:46124 -> 10.244.4.174:30274 tcp SYN
xx drop (Policy denied) flow 0x6c9bf32e to endpoint 1155, ifindex 247, file bpf_lxc.c:2181, , identity remote-node->56986: 172.27.88.13:46124 -> 10.244.4.174:30274 tcp SYN

related doc: https://docs.cilium.io/en/stable/security/policy/language/#entities-based

Summary by CodeRabbit

  • New Features

    • Expanded network access for the tenant application to allow connections from both external sources and within the cluster.
  • Chores

    • Updated the tenant application to version 1.9.2.
    • Adjusted version mappings to reflect the latest release.

@coderabbitai

coderabbitai Bot commented Apr 23, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the tenant application's Helm chart version from 1.9.1 to 1.9.2 and adjust its network policy to allow ingress from both the "world" and "cluster" entities. Additionally, the version mapping file is updated to reflect the new version, associating 1.9.1 with a specific commit and 1.9.2 with the latest code. No modifications were made to the application's exported or public entities.

Changes

File(s) Change Summary
packages/apps/tenant/Chart.yaml Incremented the tenant app version from 1.9.1 to 1.9.2.
packages/apps/tenant/templates/networkpolicy.yaml Modified network policy to allow ingress from both "world" and "cluster" entities.
packages/apps/versions_map Updated tenant version mapping: 1.9.1 now points to a commit hash; added 1.9.2 pointing to HEAD.

Suggested reviewers

  • klinch0

Poem

In the warren of code, a version hops anew,
From 1.9.1 to 1.9.2!
The network gates swing open wide,
Welcoming cluster friends inside.
Mappings refreshed, the chart ascends—
Another hop, another lens!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

@kvaps Andrei Kvapil (kvaps) added the kind/backport Categorizes issue or PR as requiring a backport to the current release line label Apr 23, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e81cbf7 and 7bfad65.

📒 Files selected for processing (3)
  • packages/apps/tenant/Chart.yaml (1 hunks)
  • packages/apps/tenant/templates/networkpolicy.yaml (1 hunks)
  • packages/apps/versions_map (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build and Test
  • GitHub Check: Build and Test
🔇 Additional comments (2)
packages/apps/tenant/Chart.yaml (1)

7-7:

Details

✅ Verification successful

Chart Version Bump
The chart version has been updated from 1.9.1 to 1.9.2, aligning with the network policy change. Please ensure that any associated Chart.lock (if present) is also updated to reflect this bump.

Run the following script to verify Chart.lock (if it exists) has the new version:


🏁 Script executed:

#!/bin/bash
# Verify Chart.lock version for tenant chart
FILE=$(find packages/apps/tenant -maxdepth 1 -name 'Chart.lock')
if [ -f "$FILE" ]; then
  echo "Found Chart.lock: $FILE"
  grep -n 'version:' "$FILE"
else
  echo "No Chart.lock found; nothing to verify"
fi

Length of output: 168


Chart Version Bump Approved
The chart’s version has been correctly updated from 1.9.1 to 1.9.2. No Chart.lock file was found in packages/apps/tenant, so there’s nothing further to update.

packages/apps/tenant/templates/networkpolicy.yaml (1)

27-27: Enable Cluster Ingress
Added the cluster entity alongside world in the allow-external-communication policy to permit cross-cluster traffic for tenant pods, resolving access issues within the cluster.

Comment on lines +133 to +134
tenant 1.9.1 721c12a7
tenant 1.9.2 HEAD

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Version Mapping Update
The entry for tenant 1.9.1 is now pinned to commit 721c12a and tenant 1.9.2 points to HEAD, matching the chart bump. Please verify that commit 721c12a correctly corresponds to the v1.9.1 release and that no other services or version maps need adjustment.

Run this script to confirm the commit exists:


🏁 Script executed:

#!/bin/bash
# Check that commit 721c12a7 exists in the repository
if git cat-file -e 721c12a7^{commit}; then
  echo "Commit 721c12a7 found"
else
  echo "Error: commit 721c12a7 not found"
fi

Length of output: 161


Invalid commit SHA for tenant 1.9.1
The mapping now points to 721c12a7, but that commit isn’t in the repo. Please confirm and update the correct SHA for the v1.9.1 release (for example, by running git rev-parse v1.9.1^{commit} or git rev-list -n1 v1.9.1 after fetching tags). Also review other version‑map entries or dependent services to ensure no further updates are needed.

• File: packages/apps/versions_map
Lines 133–134:

‑ tenant 1.9.1 721c12a7
+ tenant 1.9.1 <correct‑commit‑sha>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tenant 1.9.1 721c12a7
tenant 1.9.2 HEAD
tenant 1.9.1 <correct‑commit‑sha>
tenant 1.9.2 HEAD

@kvaps Andrei Kvapil (kvaps) changed the title Fix: networkpolicy for tenant to access from cluster [tenant] Fix networkpolicy for accessing externalIPs from the cluster Apr 23, 2025
@kvaps
Andrei Kvapil (kvaps) merged commit c22603b into main Apr 23, 2025
@kvaps
Andrei Kvapil (kvaps) deleted the fix-network-policies branch April 23, 2025 12:30
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for release-0.30:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/backport Categorizes issue or PR as requiring a backport to the current release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants