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

Update VM instead of VMI when exposing service objects #839

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/network/service_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ port inside the cluster network:

## Expose VirtualMachineInstance as a NodePort Service

To expose a VirtualMachineInstance via a NodePort service, you must ensure that the VirtualMachine (VM) resource includes the proper labels in the template section. This is crucial to allow the service to correctly associate with the VM's underlying pod.

```yaml
template:
metadata:
labels:
kubevirt.io/domain: "VM_NAME"
vmName: "VM_NAME"
```
Expose the SSH port (22) of a VirtualMachineInstance running on KubeVirt
by creating a `NodePort` service:

Expand All @@ -101,7 +110,7 @@ spec:
protocol: TCP
targetPort: 22
selector:
special: key
vmName: "VM_NAME"
type: NodePort
```

Expand Down