Skip to content

Commit 6de5e43

Browse files
authored
Merge pull request #102624 from openshift-cherrypick-robot/cherry-pick-98186-to-enterprise-4.19
[enterprise-4.19] CNV#51222: Restoring doc Deploying a vm template to a custom ns
2 parents 33d8f58 + 84a5198 commit 6de5e43

File tree

3 files changed

+116
-2
lines changed

3 files changed

+116
-2
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/vm_templates/virt-deploying-vm-template-to-custom-namespace.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="virt-adding-templates-to-custom-namespace_{context}"]
7+
= Adding templates to a custom namespace
8+
9+
[role="_abstract"]
10+
The Scheduling, Scale, and Performance (SSP) Operator deploys virtual machine templates to the `openshift` namespace by default. To also publish these templates in a custom namespace, set the `commonTemplatesNamespace` field in the `HyperConverged` custom resource (CR). After the templates sync to the custom namespace, you can modify or delete them there.
11+
12+
[NOTE]
13+
====
14+
Do not edit templates in the `openshift` namespace. The SSP Operator reconciles that namespace and overwrites changes.
15+
====
16+
17+
.Prerequisites
18+
* Install the {oc-first}.
19+
* Log in as a user with cluster-admin privileges.
20+
21+
.Procedure
22+
23+
. Optional: Create the custom namespace if it does not already exist:
24+
+
25+
[source,terminal]
26+
----
27+
$ oc create namespace <custom_namespace>
28+
----
29+
30+
. Optional: View the list of templates in the `openshift` namespace:
31+
+
32+
[source,terminal]
33+
----
34+
$ oc get templates -n openshift
35+
----
36+
37+
. Open the `HyperConverged` CR in your default editor by running the following command:
38+
+
39+
[source,terminal,subs="attributes+"]
40+
----
41+
$ oc edit hco -n {CNVNamespace} kubevirt-hyperconverged
42+
----
43+
44+
. Add the `commonTemplatesNamespace` field and set your target namespace. For example:
45+
+
46+
[source,yaml]
47+
----
48+
apiVersion: hco.kubevirt.io/v1beta1
49+
kind: HyperConverged
50+
metadata:
51+
name: kubevirt-hyperconverged
52+
spec:
53+
commonTemplatesNamespace: <custom_namespace>
54+
----
55+
56+
. Save and exit. The SSP Operator creates or updates the templates in the custom namespace.
57+
58+
. Verify the templates in the custom namespace:
59+
+
60+
[source,terminal]
61+
----
62+
$ oc get templates -n <custom_namespace>
63+
----
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/vm_templates/virt-deploying-vm-template-to-custom-namespace.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="virt-deleting-templates-from-custom-namespace_{context}"]
8+
= Deleting templates from a custom namespace
9+
10+
To delete virtual machine templates from a custom namespace, remove the `commonTemplateNamespace` attribute from the `HyperConverged` custom resource (CR) and delete each template from that custom namespace.
11+
12+
.Procedure
13+
14+
. Edit the `HyperConverged` CR in your default editor by running the following command:
15+
+
16+
[source,terminal,subs="attributes+"]
17+
----
18+
$ oc edit hco -n {CNVNamespace} kubevirt-hyperconverged
19+
----
20+
+
21+
. Remove the `commonTemplateNamespace` attribute:
22+
+
23+
[source,yaml]
24+
----
25+
apiVersion: hco.kubevirt.io/v1beta1
26+
kind: HyperConverged
27+
metadata:
28+
name: kubevirt-hyperconverged
29+
spec:
30+
commonTemplatesNamespace: <custom_namespace>
31+
----
32+
+
33+
. Delete a specific template from the custom namespace that you removed from the `HyperConverged` CR:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc delete templates -n <custom_namespace> <template_name>
38+
----
39+
40+
.Verification
41+
42+
* Verify that the template was deleted from the custom namespace:
43+
+
44+
[source,terminal]
45+
----
46+
$ oc get templates -n <custom_namespace>
47+
----

virt/creating_vm/virt-creating-vms-from-templates.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Due to differences in storage behavior, some templates are incompatible with {sn
3232

3333
include::modules/virt-creating-vm-from-template.adoc[leveloffset=+1]
3434

35-
include::modules/virt-customizing-vm-template-web.adoc[leveloffset=+2]
35+
include::modules/virt-customizing-vm-template-web.adoc[leveloffset=+1]
3636

37-
include::modules/virt-creating-template.adoc[leveloffset=+2]
37+
include::modules/virt-creating-template.adoc[leveloffset=+1]
38+
39+
include::modules/virt-adding-templates-to-custom-namespace.adoc[leveloffset=+1]
40+
41+
include::modules/virt-deleting-templates-from-custom-namespace.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)