Skip to content

Commit 6ce05cc

Browse files
committed
OSDOCS-37922: Added a note on revoking VNC tokens
1 parent bda50a0 commit 6ce05cc

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

modules/virt-temporary-token-VNC.adoc

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="virt-temporary-token-VNC_{context}"]
77
= Generating a temporary token for the VNC console
88

9-
Generate a temporary authentication bearer token for the Kubernetes API to access the VNC of a virtual machine (VM).
9+
To access the VNC of a virtual machine (VM), generate a temporary authentication bearer token for the Kubernetes API.
1010

1111
[NOTE]
1212
====
@@ -15,7 +15,7 @@ Kubernetes also supports authentication using client certificates, instead of a
1515

1616
.Prerequisites
1717

18-
* A running virtual machine with {VirtProductName} 4.14 or later and xref:../../virt/about-virt/virt-architecture#virt-about-ssp-operator_virt-architecture[`ssp-operator`] 4.14 or later
18+
* A running VM with {VirtProductName} 4.14 or later and xref:../../virt/about-virt/virt-architecture#virt-about-ssp-operator_virt-architecture[`ssp-operator`] 4.14 or later
1919
2020
.Procedure
2121

@@ -27,14 +27,15 @@ $ oc patch hyperconverged kubevirt-hyperconverged -n {CNVNamespace} --type json
2727
# ...
2828
----
2929

30-
. Generate a token by running the following command:
30+
. Generate a token by entering the following command:
3131
+
3232
[source,terminal]
3333
----
3434
$ curl --header "Authorization: Bearer ${TOKEN}" \
35-
"https://api.<cluster_fqdn>/apis/token.kubevirt.io/v1alpha1/namespaces/<namespace>/virtualmachines/<vm_name>/vnc?duration=<duration>" <1>
35+
"https://api.<cluster_fqdn>/apis/token.kubevirt.io/v1alpha1/namespaces/<namespace>/virtualmachines/<vm_name>/vnc?duration=<duration>"
3636
----
37-
<1> Duration can be in hours and minutes, with a minimum duration of 10 minutes. Example: `5h30m`. The token is valid for 10 minutes by default if this parameter is not set.
37+
+
38+
The `<duration>` parameter can be set in hours and minutes, with a minimum duration of 10 minutes. For example: `5h30m`. If this parameter is not set, the token is valid for 10 minutes by default.
3839
+
3940
Sample output:
4041
+
@@ -54,16 +55,28 @@ You can now use the token to access the VNC console of a VM.
5455

5556
.Verification
5657

57-
. Log in to the cluster by running the following command:
58+
. Log in to the cluster by entering the following command:
5859
+
5960
[source,terminal]
6061
----
6162
$ oc login --token ${VNC_TOKEN}
6263
----
6364

64-
. Use `virtctl` to test access to the VNC console of the VM by running the following command:
65+
. Test access to the VNC console of the VM by using the `virtctl` command:
6566
+
6667
[source,terminal]
6768
----
6869
$ virtctl vnc <vm_name> -n <namespace>
6970
----
71+
72+
[WARNING]
73+
====
74+
It is currently not possible to revoke a specific token.
75+
76+
To revoke a token, you must delete the service account that was used to create it. However, this also revokes all other tokens that were created by using the service account. Use the following command with caution:
77+
78+
[source,terminal]
79+
----
80+
$ virtctl delete serviceaccount --namespace "<namespace>" "<vm_name>-vnc-access"
81+
----
82+
====

0 commit comments

Comments
 (0)