Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-52174

virtctl expose should create service per VM

XMLWordPrintable

    • Quality / Stability / Reliability
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • CNV v4.99.0.rhel9-1987, CNV v4.18.0.rhel9-694, CNV v4.17.4.rhel9-3
    • CNV Infra 265
    • None

      Description of problem:

      The selector of the service should utilize the unique  vm.kubevirt.io/name instead of the generic network.kubevirt.io/headlessService like the service generated by web ui.
      

      Version-Release number of selected component (if applicable):

      CNV 4.17.2 / 4.18
      

      How reproducible:

      100%
      

      Steps to Reproduce:

      1. Create VM via UI from volume
      2. Expose service to VM via virtctl
      3.
      

      Actual results:

      dholler@t14gen4:~/bin$ virtctl expose vm rhel-10-teal-donkey-74 --port=22 --type=loadbalancer --name=testservice
      Service testservice successfully created for vm rhel-10-teal-donkey-74
      dholler@t14gen4:~/bin$ virtctl version
      Client Version: version.Info{GitVersion:"v1.4.0-rc.0-418-gcb0d40dbf7", GitCommit:"cb0d40dbf774693f0d900ee44061e60258e3a4d0", GitTreeState:"clean", BuildDate:"2024-11-29T07:53:41Z", GoVersion:"go1.22.9 (Red Hat 1.22.9-2.el9_5) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}
      Server Version: version.Info{GitVersion:"v1.3.1-127-g450184b4c7", GitCommit:"450184b4c7fca60e74ad7cfeb8c1728c53269fca", GitTreeState:"clean", BuildDate:"2024-11-28T10:13:21Z", GoVersion:"go1.22.9 (Red Hat 1.22.9-2.el9_5) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}
      dholler@t14gen4:~/bin$ oc get service/testservice -o yaml
      apiVersion: v1
      kind: Service
      metadata:
        creationTimestamp: "2024-11-29T14:33:58Z"
        finalizers:
        - service.kubernetes.io/load-balancer-cleanup
        name: testservice
        namespace: default
        resourceVersion: "190578"
        uid: 83c54f01-4a4c-4073-9ede-7618986a5594
      spec:
        allocateLoadBalancerNodePorts: true
        clusterIP: 172.30.36.234
        clusterIPs:
        - 172.30.36.234
        externalTrafficPolicy: Cluster
        internalTrafficPolicy: Cluster
        ipFamilies:
        - IPv4
        ipFamilyPolicy: SingleStack
        ports:
        - nodePort: 31909
          port: 22
          protocol: TCP
          targetPort: 22
        selector:
          network.kubevirt.io/headlessService: headless
        sessionAffinity: None
        type: LoadBalancer
      status:
        loadBalancer:
          ingress:
          - ip: 72.144.104.149
            ipMode: VIP
      
      

      Expected results:

      
      The selector of the service should utilize the unique  vm.kubevirt.io/name instead of the generic network.kubevirt.io/headlessService like the service generated by web ui:
      
      
      dholler@t14gen4:~/bin$ oc get service/windows-11-virtio-amber-marlin-73-rdp -o yaml
      apiVersion: v1
      kind: Service
      metadata:
        creationTimestamp: "2024-11-29T14:12:03Z"
        name: windows-11-virtio-amber-marlin-73-rdp
        namespace: default
        ownerReferences:
        - apiVersion: kubevirt.io/v1
          blockOwnerDeletion: false
          kind: VirtualMachine
          name: windows-11-virtio-amber-marlin-73
          uid: ebce1373-4265-414c-8689-ae2c0d6f31a2
        resourceVersion: "177069"
        uid: d15189ea-255e-4079-af04-efd19877c971
      spec:
        clusterIP: 172.30.225.58
        clusterIPs:
        - 172.30.225.58
        externalTrafficPolicy: Cluster
        internalTrafficPolicy: Cluster
        ipFamilies:
        - IPv4
        ipFamilyPolicy: SingleStack
        ports:
        - nodePort: 31947
          port: 3389
          protocol: TCP
          targetPort: 3389
        selector:
          vm.kubevirt.io/name: windows-11-virtio-amber-marlin-73
        sessionAffinity: None
        type: NodePort
      status:
        loadBalancer: {}
      
      

      Additional info:

      
      

              fmatousc@redhat.com Felix Matouschek
              dholler@redhat.com Dominik Holler
              Geetika Kapoor Geetika Kapoor
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: