Remote NoVNC Console access

256 views
Skip to first unread message

Prasad Mukhedkar

unread,
Feb 17, 2022, 10:14:36 AM2/17/22
to kubevirt-dev
I am checking the possibility to deliver KubeVirt vm in self service way to
the end users and for that my plan is to use ansible. Using ansible I can create
a virtual machine. I am planning to add vmcreate job template into ansible workflow and
in post provisioning, I want to connect kubevirt either API or virtctl and get NoVNC
url of the vm an embed it into the email notification. Workflow something like
below.


Create VM  Job >  Get NOVNC Url  of the vm Job > Construct Email Massage (Include NoVNC url )Job > Send email Job 

any thought on how can I achieve this, specifically getting novnc console url
of the vm? 

dvo...@redhat.com

unread,
Feb 21, 2022, 10:23:02 AM2/21/22
to kubevirt-dev

Prince Sarvaiya

unread,
Sep 14, 2022, 6:37:01 AM9/14/22
to kubevirt-dev
Hi dvossel,

I am following the post, but i am getting this error.

Can you please help

vnc.PNG
vnc0.PNG

Prince Sarvaiya

unread,
Sep 14, 2022, 6:50:14 AM9/14/22
to kubevirt-dev
YAML is as follow:

[root@migration-test]# cat virtvnc.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: virtvnc
  namespace: kubevirt
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: virtvnc
subjects:
- kind: ServiceAccount
  name: virtvnc
  namespace: kubevirt
roleRef:
  kind: ClusterRole
  name: virtvnc
  apiGroup: rbac.authorization.k8s.io
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: virtvnc
rules:
- apiGroups:
  - subresources.kubevirt.io
  resources:
  - virtualmachineinstances/console
  - virtualmachineinstances/vnc
  verbs:
  - get
  - list
  - watch
  - create
  - patch
  - update
  - delete
- apiGroups:
  - kubevirt.io
  resources:
  - virtualmachines
  - virtualmachineinstances
  - virtualmachineinstancepresets
  - virtualmachineinstancereplicasets
  - virtualmachineinstancemigrations
  verbs:
  - get
  - list
  - watch
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: virtvnc
  name: virtvnc
  namespace: kubevirt
spec:
  ports:
  - port: 8001
    protocol: TCP
    targetPort: 8001
    nodePort: 31002
  selector:
    app: virtvnc
  type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: virtvnc
  namespace: kubevirt
spec:
  replicas: 1
  selector:
    matchLabels:
      app: virtvnc
  template:
    metadata:
      labels:
        app: virtvnc
    spec:
      serviceAccountName: virtvnc
      containers:
      - name: virtvnc
        image: quay.io/samblade/virtvnc:v0.1
        livenessProbe:
          httpGet:
            port: 8001
            path: /
            scheme: HTTP
          failureThreshold: 30
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5

kripa

unread,
Sep 14, 2022, 10:49:52 AM9/14/22
to kubevirt-dev
Hi,
Can you try running this on command line and then access it.

kubectl proxy  --accept-hosts=^.*$ --address=[::] --api-prefix=/k8s/ --www-prefix=

Prince Sarvaiya

unread,
Sep 14, 2022, 11:16:42 AM9/14/22
to kripa, kubevirt-dev
Thank you for your email.

Nope, still not working..

--
You received this message because you are subscribed to the Google Groups "kubevirt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubevirt-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubevirt-dev/3467caf8-d98a-49e2-b7a1-211580913f4an%40googlegroups.com.

Prince Sarvaiya

unread,
Sep 15, 2022, 3:04:06 AM9/15/22
to kripa, kubevirt-dev
Hi Kubevirt Dev team,

Hope you are doing well!

I have a request, if you can assist me with the given issue, or point me in the right direction.

I am using a Centos machine with virtualization enabled on vSphere. CDI, image-upload,provisioning a sample VM without PVC everything is working fine. That means, all components are working and in place.

Just stuck at the last part to access the machine from the VNC on the browser. I am getting the issue, as mentioned in the attached screenshot. Also, mentioned YAML in above thread.

Regards,
Prince A. Sarvaiya
vnc0.PNG
Reply all
Reply to author
Forward
0 new messages