Skip to content

Commit e1e58f8

Browse files
authored
Merge pull request #74420 from jherrman/CNV-37922
OSDOCS: CNV-37922 - Adding docs on VNC token revocation
2 parents e372937 + 6ce05cc commit e1e58f8

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

@@ -26,14 +26,15 @@ Kubernetes also supports authentication using client certificates, instead of a
2626
$ oc patch hyperconverged kubevirt-hyperconverged -n {CNVNamespace} --type json -p '[{"op": "replace", "path": "/spec/featureGates/deployVmConsoleProxy", "value": true}]'
2727
----
2828

29-
. Generate a token by running the following command:
29+
. Generate a token by entering the following command:
3030
+
3131
[source,terminal]
3232
----
3333
$ curl --header "Authorization: Bearer ${TOKEN}" \
34-
"https://api.<cluster_fqdn>/apis/token.kubevirt.io/v1alpha1/namespaces/<namespace>/virtualmachines/<vm_name>/vnc?duration=<duration>" <1>
34+
"https://api.<cluster_fqdn>/apis/token.kubevirt.io/v1alpha1/namespaces/<namespace>/virtualmachines/<vm_name>/vnc?duration=<duration>"
3535
----
36-
<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.
36+
+
37+
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.
3738
+
3839
Sample output:
3940
+
@@ -53,16 +54,28 @@ You can now use the token to access the VNC console of a VM.
5354

5455
.Verification
5556

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

63-
. Use `virtctl` to test access to the VNC console of the VM by running the following command:
64+
. Test access to the VNC console of the VM by using the `virtctl` command:
6465
+
6566
[source,terminal]
6667
----
6768
$ virtctl vnc <vm_name> -n <namespace>
6869
----
70+
71+
[WARNING]
72+
====
73+
It is currently not possible to revoke a specific token.
74+
75+
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:
76+
77+
[source,terminal]
78+
----
79+
$ virtctl delete serviceaccount --namespace "<namespace>" "<vm_name>-vnc-access"
80+
----
81+
====

0 commit comments

Comments
 (0)