Skip to content

docs, net, service-objects: Add a section for Service lifecycle#969

Open
EdDev wants to merge 1 commit intokubevirt:mainfrom
EdDev:kubectl-expose-refown
Open

docs, net, service-objects: Add a section for Service lifecycle#969
EdDev wants to merge 1 commit intokubevirt:mainfrom
EdDev:kubectl-expose-refown

Conversation

@EdDev
Copy link
Copy Markdown
Member

@EdDev EdDev commented Mar 3, 2026

What this PR does / why we need it:

In v1.9 virtctl expose adds a ownerReference to the Service object and binds it to the VM/VMI object.
Allowing proper cleanup of Services and avoiding orphan services.

This change complements kubevirt/kubevirt#16884 by documenting it towards v1.9.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note:

NONE

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Mar 3, 2026
@kubevirt-bot kubevirt-bot requested review from RamLavi and ormergi March 3, 2026 08:39
Copy link
Copy Markdown
Member

@orelmisan orelmisan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @EdDev!
Unfortunately, kubevirt/kubevirt#16884 didn't make it to the cut of release-1.8, so the feature will only be available in v1.9 (unless we backport of course).

@aburdenthehand
Copy link
Copy Markdown
Member

/hold
I'd like to create a v1.8 branch after the release so that we have it ready for when we have versioning set up.

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 12, 2026
@EdDev EdDev force-pushed the kubectl-expose-refown branch from 5325223 to 8cddf6f Compare March 19, 2026 07:50
@EdDev
Copy link
Copy Markdown
Member Author

EdDev commented Mar 19, 2026

Thank you for the PR @EdDev! Unfortunately, kubevirt/kubevirt#16884 didn't make it to the cut of release-1.8, so the feature will only be available in v1.9 (unless we backport of course).

Thank you. Done.

@EdDev
Copy link
Copy Markdown
Member Author

EdDev commented Mar 19, 2026

/assign @orelmisan @frenzyfriday

Copy link
Copy Markdown
Member

@orelmisan orelmisan left a comment

Choose a reason for hiding this comment

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

Thank you for the change @EdDev.
Can you also adjust the version in the PR description?

Comment thread docs/network/service_objects.md Outdated
While creating the service explicitly, it is up to the user to explicitly
cleanup the service.
From v1.9 the implicit service creation through `virtctl expose` adds an
`ownerRefernce` to the service object, binding the service to the VM/VMI.
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.

Typo:

Suggested change
`ownerRefernce` to the service object, binding the service to the VM/VMI.
`ownerReference` to the service object, binding the service to the VM/VMI.

nit: Consider adding a link to https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/.

Comment thread docs/network/service_objects.md Outdated

## Service lifecycle

Service objects may be created explicitly by an user or implicitly
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.

Suggested change
Service objects may be created explicitly by an user or implicitly
Service objects may be created explicitly by a user or implicitly

Comment thread docs/network/service_objects.md Outdated
through the `virtctl expose` command.

While creating the service explicitly, it is up to the user to explicitly
cleanup the service.
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.

nit:

Suggested change
cleanup the service.
clean up the service.

Comment thread docs/network/service_objects.md Outdated
Comment on lines +190 to +191
`ownerRefernce` to the service object, binding the service to the VM/VMI.
As a result, the service will be collected by the garbage-collector once
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.

Suggested change
`ownerRefernce` to the service object, binding the service to the VM/VMI.
As a result, the service will be collected by the garbage-collector once
As a result, the service will be collected by the k8s garbage-collector once

@EdDev EdDev force-pushed the kubectl-expose-refown branch from 8cddf6f to 759f120 Compare March 26, 2026 10:06
@EdDev
Copy link
Copy Markdown
Member Author

EdDev commented Mar 26, 2026

change: Rebase

In v1.9 `virtctl expose` adds a `ownerReference` to the Service object
and binds it to the VM/VMI object.
Allowing proper cleanup of Services and avoiding orphan services.

Signed-off-by: Edward Haas <edwardh@redhat.com>
@EdDev EdDev force-pushed the kubectl-expose-refown branch from 759f120 to d4cf555 Compare March 26, 2026 10:13
@EdDev
Copy link
Copy Markdown
Member Author

EdDev commented Mar 26, 2026

change: Answered review comments from @orelmisan .

Copy link
Copy Markdown
Member

@orelmisan orelmisan left a comment

Choose a reason for hiding this comment

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

Thank you @EdDev!
/approve

@kubevirt-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: orelmisan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2026
Copy link
Copy Markdown
Contributor

@ormergi ormergi left a comment

Choose a reason for hiding this comment

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

LGTM

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants