Skip to content

[vm-instance] Fix PortList not filtering ingress ports - #2501

Merged
Andrei Kvapil (kvaps) merged 2 commits into
cozystack:mainfrom
mattia-eleuteri:fix/vm-instance-portlist
Apr 28, 2026
Merged

Andrei Kvapil (kvaps) merged 2 commits into
cozystack:mainfrom
mattia-eleuteri:fix/vm-instance-portlist

Conversation

@mattia-eleuteri

@mattia-eleuteri mattia-eleuteri commented Apr 27, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

The vm-instance chart now drives the cozy-proxy wholeIP and allowICMP annotations explicitly so that externalMethod: PortList actually filters ingress traffic to declared ports while keeping ping/PMTU functional.

  • Render networking.cozystack.io/wholeIP: "false" when externalMethod: PortList (was always "true", which silently disabled the PortList semantics in cozy-proxy).
  • Add externalAllowICMP value (default true) propagated as networking.cozystack.io/allowICMP when externalMethod: PortList. Without this, cozy-proxy drops ICMP in port-filter mode (ping/PMTU broken). Operators can set externalAllowICMP: false to opt out.

The changelog entry is intentionally not part of this PR — it will be added in a dedicated docs: add changelog for vX.Y.Z commit at release time, per project convention.

Why

externalMethod: PortList is documented as filtering ingress traffic to declared ports but has been non-functional on Cozystack v1.3.0 — verified empirically on a 3-node Talos lab. Root cause was twofold: chart always set wholeIP: "true", and cozy-proxy v0.2.0 had no port-aware logic. The cozy-proxy side was fixed in cozystack/cozy-proxy#11 (merged) and cozystack/cozy-proxy#12 (allowICMP follow-up); this PR completes the user-visible fix on the chart side.

Companion PRs

Test plan

  • Built cozy-proxy with the companion fix locally, deployed on a 3-node Talos lab (Cozystack v1.3.0)
  • wholeIP: "false" Service with spec.ports: [22]: only port 22 reachable from outside; ports 80/443/8080/9999 filtered
  • WholeIP-annotated Service unchanged: all listening ports reachable
  • Egress IP preservation works in both modes (TCP curl + UDP DNS)
  • nft list table ip cozy_proxy confirms expected ruleset
  • helm template renders the expected annotation matrix: PortList default → wholeIP=false, allowICMP=true; PortList opt-out → allowICMP=false; WholeIP → only wholeIP=true
  • make unit-tests passes locally
  • CI unit tests
  • CI E2E

Backport

Suggesting backport-v1.3 once merged.

Release note

[vm-instance] Make `externalMethod: PortList` actually filter ingress traffic to ports listed in `externalPorts`. New `externalAllowICMP` knob (default true) propagates the cozy-proxy `allowICMP` annotation to keep ping/PMTU functional in port-filter mode. Combined with cozy-proxy v0.3.0+, only listed ports plus ICMP are reachable from the VM's LoadBalancer IP.

Summary by CodeRabbit

  • New Features

    • Added externalAllowICMP configuration option to control ICMP traffic acceptance for VM external access in PortList mode (enabled by default).
  • Documentation

    • Updated parameter documentation to include the new ICMP traffic control setting.

Render `networking.cozystack.io/wholeIP: "false"` on the Service when
`externalMethod: PortList` is configured (was always `"true"` before).
Combined with cozy-proxy v0.3.0+ which adds per-port filtering for
"false"-annotated services, this makes `externalMethod: PortList`
behave as documented: only ports listed in `externalPorts` are
reachable from the LoadBalancer IP.

Backward-compatible: existing services with `externalMethod: WholeIP`
continue to set `wholeIP: "true"` and behave identically. cozy-proxy
versions older than v0.3.0 ignore Services with `wholeIP: "false"`,
which means PortList Services on older cozy-proxy will lose their
egress IP preservation — but that path was already non-functional
ingress-wise, so this is not a regression for users actually relying
on PortList.

Signed-off-by: mattia-eleuteri <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new externalAllowICMP configuration option is introduced to control ICMP traffic acceptance in PortList external access mode, implemented across API types, Helm chart values, service templates, and documentation with a default value of true.

Changes

Cohort / File(s) Summary
API Type Definition
api/apps/v1alpha1/vminstance/types.go
Added ExternalAllowICMP boolean field to ConfigSpec struct with JSON serialization and kubebuilder defaulting metadata.
Helm Chart Values & Configuration
packages/apps/vm-instance/values.yaml, packages/apps/vm-instance/values.schema.json
Introduced new externalAllowICMP property (default true) to schema and values, controlling ICMP handling behavior for PortList mode.
Service Template
packages/apps/vm-instance/templates/service.yaml
Updated Service annotations to dynamically set wholeIP based on externalMethod and conditionally emit allowICMP annotation when in PortList mode.
Documentation & System Configuration
packages/apps/vm-instance/README.md, packages/system/vm-instance-rd/cozyrds/vm-instance.yaml
Updated parameter documentation table and extended OpenAPI schema with new externalAllowICMP field and keysOrder adjustment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A ping's permission takes its place,
Through ports aligned with gentle grace,
In schemas, charts, and values true,
This ICMP flag now flows on through,
The network hops with joyful cheer! 💫

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: fixing PortList to properly filter ingress ports by making the wholeIP annotation conditional, addressing the root cause of the issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review label Apr 27, 2026
- Add `externalAllowICMP` value (default true) propagated as
  `networking.cozystack.io/allowICMP` annotation on the rendered Service
  when `externalMethod: PortList`. The cozy-proxy companion (released as
  part of cozystack/cozy-proxy#11 + cozystack#12) drops ICMP by default in
  port-filter mode, which breaks ping and PMTU discovery; defaulting the
  chart to "true" preserves user expectations while still allowing
  operators to opt out by setting `externalAllowICMP: false`.

- Remove the v1.3.1.md changelog entry. Project convention is to add
  changelogs in a dedicated "docs: add changelog for vX.Y.Z" commit at
  release time, not as part of feature/fix PRs.

Signed-off-by: mattia-eleuteri <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@dosubot dosubot Bot added size/M This PR changes 30-99 lines, ignoring generated files area/networking Issues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn) area/virtualization Issues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import) kind/backport-previous Categorizes issue or PR as requiring a backport to the previous release line do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress kind/bug Categorizes issue or PR as related to a bug labels Apr 28, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 enables functional ingress port filtering for vm-instance when configured with externalMethod: PortList. By correctly adjusting the wholeIP annotation on generated Services, it allows the proxy layer to enforce port restrictions. Additionally, it introduces a configurable option for ICMP traffic to ensure connectivity diagnostics like ping remain functional while port filtering is active.

Highlights

  • Ingress Port Filtering: Updated the Service template to correctly set the wholeIP annotation to false when externalMethod is set to PortList, enabling proper port-based ingress filtering.
  • ICMP Configuration: Added a new externalAllowICMP configuration option to allow or deny ICMP traffic in PortList mode, defaulting to true to maintain expected ping behavior.
  • Documentation and Schema: Updated the README, values schema, and chart metadata to include the new externalAllowICMP parameter.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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 (@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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new configuration option, externalAllowICMP, to allow ICMP traffic to virtual machines when using the PortList mode. The changes include updates to the API types, Helm templates, and schema definitions. Regarding the review feedback, the comments correctly identify that manual edits to auto-generated files (such as api/apps/v1alpha1/vminstance/types.go and packages/system/vm-instance-rd/cozyrds/vm-instance.yaml) should be avoided in favor of using make generate. Additionally, the comment regarding values.schema.json correctly notes that manual additions of description fields will be stripped during regeneration.

Comment on lines +29 to +31
// Whether to accept ICMP traffic to the VM in PortList mode (preserves ping and PMTU discovery). No effect in WholeIP mode. Default true so ping behaves as users expect even when port filtering is in effect.
// +kubebuilder:default:=true
ExternalAllowICMP bool `json:"externalAllowICMP"`

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.

high

This file is auto-generated as indicated by the header on line 1. Manual changes to this file will be overwritten during the next build or when make generate is executed. According to the project guidelines, you should update the package schema (via values.yaml annotations, which you have already done) and run make generate to update this file automatically.

References
  1. Suggest changes to the relevant package schema rather than hand-editing generated types. (link)

plural: vminstances
openAPISchema: |-
{"title":"Chart Values","type":"object","properties":{"external":{"description":"Enable external access from outside the cluster.","type":"boolean","default":false},"externalMethod":{"description":"Method to pass through traffic to the VM.","type":"string","default":"PortList","enum":["PortList","WholeIP"]},"externalPorts":{"description":"Ports to forward from outside the cluster.","type":"array","default":[22],"items":{"type":"integer"}},"runStrategy":{"description":"Requested running state of the VirtualMachineInstance","type":"string","default":"Always","enum":["Always","Halted","Manual","RerunOnFailure","Once"]},"instanceType":{"description":"Virtual Machine instance type.","type":"string","default":"u1.medium"},"instanceProfile":{"description":"Virtual Machine preferences profile.","type":"string","default":"ubuntu","enum":["alpine","centos.7","centos.7.desktop","centos.stream10","centos.stream10.desktop","centos.stream8","centos.stream8.desktop","centos.stream8.dpdk","centos.stream9","centos.stream9.desktop","centos.stream9.dpdk","cirros","fedora","fedora.arm64","opensuse.leap","opensuse.tumbleweed","rhel.10","rhel.10.arm64","rhel.7","rhel.7.desktop","rhel.8","rhel.8.desktop","rhel.8.dpdk","rhel.9","rhel.9.arm64","rhel.9.desktop","rhel.9.dpdk","rhel.9.realtime","sles","ubuntu","windows.10","windows.10.virtio","windows.11","windows.11.virtio","windows.2k16","windows.2k16.virtio","windows.2k19","windows.2k19.virtio","windows.2k22","windows.2k22.virtio","windows.2k25","windows.2k25.virtio",""]},"disks":{"description":"List of disks to attach.","type":"array","default":[],"items":{"type":"object","required":["name"],"properties":{"bus":{"description":"Disk bus type (e.g. \"sata\").","type":"string"},"name":{"description":"Disk name.","type":"string"}}}},"networks":{"description":"Networks to attach the VM to.","type":"array","default":[],"items":{"type":"object","properties":{"name":{"description":"Network attachment name.","type":"string"}}}},"subnets":{"description":"Deprecated: use networks instead.","type":"array","default":[],"items":{"type":"object","properties":{"name":{"description":"Network attachment name.","type":"string"}}}},"gpus":{"description":"List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM).","type":"array","default":[],"items":{"type":"object","required":["name"],"properties":{"name":{"description":"The name of the GPU resource to attach.","type":"string"}}}},"cpuModel":{"description":"Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map","type":"string","default":""},"resources":{"description":"Resource configuration for the virtual machine.","type":"object","default":{},"properties":{"cpu":{"description":"Number of CPU cores allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Amount of memory allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"sockets":{"description":"Number of CPU sockets (vCPU topology).","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"sshKeys":{"description":"List of SSH public keys for authentication.","type":"array","default":[],"items":{"type":"string"}},"cloudInit":{"description":"Cloud-init user data.","type":"string","default":""},"cloudInitSeed":{"description":"Seed string to generate SMBIOS UUID for the VM.","type":"string","default":""}}}
{"title":"Chart Values","type":"object","properties":{"external":{"description":"Enable external access from outside the cluster.","type":"boolean","default":false},"externalMethod":{"description":"Method to pass through traffic to the VM.","type":"string","default":"PortList","enum":["PortList","WholeIP"]},"externalPorts":{"description":"Ports to forward from outside the cluster.","type":"array","default":[22],"items":{"type":"integer"}},"externalAllowICMP":{"description":"Whether to accept ICMP traffic to the VM in PortList mode (preserves ping and PMTU discovery). No effect in WholeIP mode. Default true so ping behaves as users expect even when port filtering is in effect.","type":"boolean","default":true},"runStrategy":{"description":"Requested running state of the VirtualMachineInstance","type":"string","default":"Always","enum":["Always","Halted","Manual","RerunOnFailure","Once"]},"instanceType":{"description":"Virtual Machine instance type.","type":"string","default":"u1.medium"},"instanceProfile":{"description":"Virtual Machine preferences profile.","type":"string","default":"ubuntu","enum":["alpine","centos.7","centos.7.desktop","centos.stream10","centos.stream10.desktop","centos.stream8","centos.stream8.desktop","centos.stream8.dpdk","centos.stream9","centos.stream9.desktop","centos.stream9.dpdk","cirros","fedora","fedora.arm64","opensuse.leap","opensuse.tumbleweed","rhel.10","rhel.10.arm64","rhel.7","rhel.7.desktop","rhel.8","rhel.8.desktop","rhel.8.dpdk","rhel.9","rhel.9.arm64","rhel.9.desktop","rhel.9.dpdk","rhel.9.realtime","sles","ubuntu","windows.10","windows.10.virtio","windows.11","windows.11.virtio","windows.2k16","windows.2k16.virtio","windows.2k19","windows.2k19.virtio","windows.2k22","windows.2k22.virtio","windows.2k25","windows.2k25.virtio",""]},"disks":{"description":"List of disks to attach.","type":"array","default":[],"items":{"type":"object","required":["name"],"properties":{"bus":{"description":"Disk bus type (e.g. \"sata\").","type":"string"},"name":{"description":"Disk name.","type":"string"}}}},"networks":{"description":"Networks to attach the VM to.","type":"array","default":[],"items":{"type":"object","properties":{"name":{"description":"Network attachment name.","type":"string"}}}},"subnets":{"description":"Deprecated: use networks instead.","type":"array","default":[],"items":{"type":"object","properties":{"name":{"description":"Network attachment name.","type":"string"}}}},"gpus":{"description":"List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM).","type":"array","default":[],"items":{"type":"object","required":["name"],"properties":{"name":{"description":"The name of the GPU resource to attach.","type":"string"}}}},"cpuModel":{"description":"Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map","type":"string","default":""},"resources":{"description":"Resource configuration for the virtual machine.","type":"object","default":{},"properties":{"cpu":{"description":"Number of CPU cores allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Amount of memory allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"sockets":{"description":"Number of CPU sockets (vCPU topology).","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"sshKeys":{"description":"List of SSH public keys for authentication.","type":"array","default":[],"items":{"type":"string"}},"cloudInit":{"description":"Cloud-init user data.","type":"string","default":""},"cloudInitSeed":{"description":"Seed string to generate SMBIOS UUID for the VM.","type":"string","default":""}}}

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.

high

The openAPISchema in the ApplicationDefinition appears to have been updated manually. This content is typically synchronized from the package's values.schema.json using make generate. Manual edits to this minified JSON string are error-prone and will be lost on the next regeneration.

References
  1. Suggest changes to the relevant package schema rather than hand-editing generated types. (link)

}
},
"externalAllowICMP": {
"description": "Whether to accept ICMP traffic to the VM in PortList mode (preserves ping and PMTU discovery). No effect in WholeIP mode. Default true so ping behaves as users expect even when port filtering is in effect.",

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.

low

The description field in values.schema.json is automatically stripped when running make generate. It is better to rely on the generator to handle this file based on the annotations in values.yaml.

References
  1. make generate regenerates this file and strips title, description, and x-* custom annotations. (link)

@kvaps

Copy link
Copy Markdown
Member

A note on PR title and commit messages: the project adopted Conventional Commits (type(scope): description) per .github/PULL_REQUEST_TEMPLATE.md. Recent merged PRs follow this consistently — e.g. fix(kubernetes): close admin-kubeconfig race, feat(linstor): bump linstor-csi to v1.10.6. This PR still uses the older bracket prefix [vm-instance] Fix PortList not filtering ingress ports.

Suggested rewording:

  • PR title: fix(virtual-machine): make PortList actually filter ingress ports (or scope it as vm-instance if you prefer the package-level scope; recent commits seem to use kubernetes, linstor, etc., i.e. the system component name).
  • Commit messages likewise: fix(virtual-machine): set wholeIP annotation conditionally on externalMethod and feat(virtual-machine): add externalAllowICMP knob.
  • Release-note block should start with the same type(scope): prefix as the title.

If the behavior change for accidentally-open ports under PortList is considered user-visible enough to be a break, append ! (fix(virtual-machine)!: ...) and add a BREAKING CHANGE: footer; otherwise plain fix is fine since the PortList semantics being honored is the documented behavior.


I also stacked the cozy-proxy v0.3.0 chart bump on this branch in mattia-eleuteri#2 — the cozy-proxy side has just been released, and the new datapath only takes effect once both land. Happy to rebase or fold it into your PR however you prefer; the diff is minimal (make update + breaking-change commit footer).

Andrei Kvapil (kvaps) added a commit that referenced this pull request Apr 28, 2026
Pulls in the per-port filtering and allowICMP support that the companion
vm-instance chart fix in #2501 relies on. cozy-proxy v0.3.0 also tightens
the selector to the standard service.kubernetes.io/service-proxy-name=cozy-proxy
label and switches the default ingress mode to port-filter; both are
already covered by the vm-instance chart (label landed in #2357,
wholeIP/allowICMP wired explicitly in #2501), so VM workloads upgrade
transparently.

Out-of-tree consumers using cozy-proxy annotations directly (without the
label, or relying on the absent-annotation passthrough default) are
called out in the upstream v0.3.0 release notes:
https://github.com/cozystack/cozy-proxy/releases/tag/v0.3.0

Signed-off-by: Andrei Kvapil <[email protected]>

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Verified:

  • Template logic in service.yaml: wholeIP=true when externalMethod=WholeIP, wholeIP=false + allowICMP (default true) when PortList. Matches the cozy-proxy v0.3.0 contract.
  • types.go / values.schema.json / values.yaml / vm-instance-rd cozyrds all updated consistently for the new externalAllowICMP field.
  • README parameter table regenerated.
  • Build, E2E, DCO, pre-commit all green.

Companion #2510 ships cozy-proxy v0.3.0 to make this take effect.

@kvaps Andrei Kvapil (kvaps) removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress label Apr 28, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 28, 2026
@kvaps
Andrei Kvapil (kvaps) merged commit bbe0e86 into cozystack:main Apr 28, 2026
18 of 19 checks passed
@github-actions

Copy link
Copy Markdown

Backport failed for release-1.2, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-1.2
git worktree add -d .worktree/backport-2501-to-release-1.2 origin/release-1.2
cd .worktree/backport-2501-to-release-1.2
git switch --create backport-2501-to-release-1.2
git cherry-pick -x 80631bc9160a4567cce8facdf781799f15455497 b0afc9a07c8a842915af1fa98ff1e7d17ccb39c8

@kvaps Andrei Kvapil (kvaps) removed the kind/backport-previous Categorizes issue or PR as requiring a backport to the previous release line label Apr 28, 2026
Andrei Kvapil (kvaps) added a commit that referenced this pull request Apr 28, 2026
Bumps the vendored cozy-proxy chart and image tag from v0.2.0 to v0.3.0
by running `make update` in `packages/system/cozy-proxy`.

cozy-proxy v0.3.0 release:
https://github.com/cozystack/cozy-proxy/releases/tag/v0.3.0

## Why

cozy-proxy v0.3.0 is the companion of #2501. The chart fix in #2501
finally honors the documented PortList semantics (only `externalPorts`
reachable, ICMP preserved by default), but only takes effect once
cozy-proxy v0.3.0 is in place — v0.2.0 has no port-aware logic, so the
chart fix silently no-ops on it. This PR ships that runtime side.

## Upgrade impact

For cozystack users this is a **bug fix, not a breaking change**.
cozy-proxy v0.3.0 introduces two contract changes upstream — (1)
label-only selector via `service.kubernetes.io/service-proxy-name:
cozy-proxy`, and (2) port-filter as the default ingress mode — both of
which are absorbed by the vm-instance chart (label landed in #2357,
`wholeIP` + `allowICMP` wired in #2501).

- **`externalMethod: WholeIP`** (default) — chart renders label +
`wholeIP: "true"` in both old and new versions. cozy-proxy keeps
passthrough. **No change.**
- **`externalMethod: PortList`** — previously the chart always rendered
`wholeIP: "true"` regardless of method, and cozy-proxy v0.2.0 had no
port-aware logic, so PortList was silently a no-op (all ports
reachable). After this bump + #2501, PortList behaves as documented:
only ports listed in `externalPorts` reach the VM. Users who configured
PortList but reached undeclared ports (relying on the silent no-op) will
see those ports become unreachable — that's the documented intent of
PortList finally taking effect. ICMP keeps working by default thanks to
`externalAllowICMP: true`.
- **DaemonSet rollover** — re-init of the nft table during cozy-proxy
pod restart is a brief blip on existing flows; same as any DaemonSet
upgrade.

Out-of-tree consumers using cozy-proxy directly (without the
`service-proxy-name` label, or relying on the absent-annotation
passthrough default) need to migrate per the upstream v0.3.0 release
notes — not a cozystack concern.

## Order of operations

This PR is functionally complete on its own (image bump), but the
user-facing PortList fix it enables only happens when #2501 also lands.
Recommended merge order:

1. #2501 first (chart adapts to the new contract)
2. This PR second (cozy-proxy DaemonSet picks up the new image)

The reverse order is also safe — cozy-proxy v0.3.0 with the unmodified
vm-instance chart still produces correct results for `externalMethod:
WholeIP` (most common case) and keeps PortList silently broken until
#2501 lands.

## Test plan

- [ ] `helm template packages/system/cozy-proxy` — image tag `v0.3.0`
rendered
- [ ] `make unit-tests` passes
- [ ] After #2501 lands, end-to-end: `externalMethod: PortList` with
`externalPorts: [22]` filters all other ports, ping works
- [ ] WholeIP-method VM Service unchanged after upgrade

## Companion PRs

- #2501 — vm-instance chart wires `wholeIP` / `allowICMP` per
`externalMethod`
- cozystack/cozy-proxy#13 (merged) — label-only selector + port-filter
default
- cozy-proxy v0.3.0 release notes —
https://github.com/cozystack/cozy-proxy/releases/tag/v0.3.0

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Released version 0.3.0 with updated Helm chart metadata and container
image configuration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking Issues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn) area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review area/virtualization Issues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import) kind/bug Categorizes issue or PR as related to a bug lgtm This PR has been approved by a maintainer size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants