user-guide icon indicating copy to clipboard operation
user-guide copied to clipboard

Edit VM instead of VMI when exposing service objects

Open aburdenthehand opened this issue 1 year ago • 9 comments

The service objects doc currently specify users edit the VMI object, however it seems as though this should be done on the VM (and restart if running).

This was raised on this thread: https://kubernetes.slack.com/archives/C8ED7RKFE/p1688475040764709

If this is the case, we should update this doc: https://github.com/kubevirt/user-guide/blame/main/docs/virtual_machines/service_objects.md

aburdenthehand avatar Jul 10 '23 13:07 aburdenthehand

To be even more specific: It seems like one must specify the label on the VM and on the VMI object (inside the template section of the VM resource). When specifying the VM as follows, I was able to expose VM ports via NodePort service objects:

yaml
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  labels:
    kubevirt.io/os: linux
    vmName: "__VM_NAME__"
  name: "__VM_NAME__"
spec:
  running: true
  template:
    metadata:
      creationTimestamp: null
      labels:
        kubevirt.io/domain: "__VM_NAME__"
        vmName: "__VM_NAME__"
    spec:
      domain:
        cpu:
          cores: __VM_CORES__
          model: host-passthrough
        devices:
          disks:
            - disk:
                bus: virtio
              name: disk0
            - cdrom:
                bus: sata
                readonly: true
              name: cloudinitdisk
          # see https://github.com/kubevirt/user-guide/pull/262/files
          rng: {}
        machine:
          type: q35
        resources:
          requests:
            memory: "__VM_MEMORY__"
      volumes:
        - name: disk0
          persistentVolumeClaim:
            claimName: "__VM_NAME__"
        - cloudInitNoCloud:
            userData: |
              #cloud-config
              hostname: __VM_NAME__
              ssh_pwauth: True
              disable_root: false
              ssh_authorized_keys:
              - __VM_SSH_PUBLIC_KEY__
          name: cloudinitdisk

drssdinblck avatar Jul 14 '23 13:07 drssdinblck

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot avatar Oct 12 '23 14:10 kubevirt-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

kubevirt-bot avatar Nov 11 '23 14:11 kubevirt-bot

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot avatar Feb 12 '24 12:02 kubevirt-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

kubevirt-bot avatar Mar 13 '24 13:03 kubevirt-bot

/remove-lifecycle rotten

dhiller avatar Mar 19 '24 15:03 dhiller

Hi! I was wondering if this method of exposing the VM ports has been confirmed. If so, should this VM specification @drssdinblck commented be added to the doc?

chuot803 avatar May 04 '24 18:05 chuot803

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot avatar Aug 02 '24 19:08 kubevirt-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

kubevirt-bot avatar Sep 01 '24 19:09 kubevirt-bot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

kubevirt-bot avatar Oct 01 '24 20:10 kubevirt-bot

@kubevirt-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

kubevirt-bot avatar Oct 01 '24 20:10 kubevirt-bot

/remove-lifecycle rotten

aburdenthehand avatar Oct 03 '24 08:10 aburdenthehand

/assign

anishbista60 avatar Oct 03 '24 08:10 anishbista60