-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Updates for golden image heterogenous cluster support #99811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
modules/virt-add-custom-golden-image-heterogeneous-cluster.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * virt/virtual_machines/advanced_vm_management/virt-creating-vms-from-rh-images-overview.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="virt-add-custom-golden-image-heterogeneous-cluster_{context}"] | ||
|
|
||
| = Adding a custom golden image in a heterogeneous cluster | ||
|
|
||
| :FeatureName: Golden image support for heterogeneous clusters | ||
| include::snippets/technology-preview.adoc[] | ||
|
|
||
| Add a custom golden image in a heterogeneous cluster by setting the `ssp.kubevirt.io/dict.architectures` annotation in the `spec.dataImportCronTemplates.metadata.annotations` stanza of the `HyperConverged` custom resource (CR). This annotation lists the architectures supported by the image. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You have installed the {oc-first}. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Open the `HyperConverged` CR in your default editor by running the following command: | ||
| + | ||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace} | ||
| ---- | ||
|
|
||
| . Edit the `HyperConverged` CR, to add the custom golden image. You must add the appropriate values for `ssp.kubevirt.io/dict.architectures` annotation in the `dataImportCronTemplates` section. For example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: hco.kubevirt.io/v1beta1 | ||
| kind: HyperConverged | ||
| metadata: | ||
| name: kubevirt-hyperconverged | ||
| spec: | ||
| dataImportCronTemplates: | ||
| - metadata: | ||
| name: custom-image1 | ||
| annotations: | ||
| ssp.kubevirt.io/dict.architectures: "<architecture_list>" <1> | ||
| spec: | ||
| schedule: "0 */12 * * *" | ||
| template: | ||
| spec: | ||
| source: | ||
| registry: | ||
| url: docker://myprivateregistry/custom1 | ||
| managedDataSource: custom1 | ||
| retentionPolicy: "All" | ||
| #... | ||
| ---- | ||
| <1> The comma-separated list of supported architectures for this image. For example, if the image supports `amd64` and `arm64` architectures, the value would be `"amd64,arm64"`. | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| An image may support more architectures than you want to use in your cluster. You do not have to list all of the architectures an image supports, only those for which you want to create a boot source. | ||
| ==== | ||
| . Save and exit the editor to update the `HyperConverged` CR. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * virt/virtual_machines/advanced_vm_management/virt-creating-vms-from-rh-images-overview.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="virt-enabling-heterogeneous-clusters_{context}"] | ||
| = Enabling heterogeneous cluster support | ||
|
|
||
| You can enable golden image support for heterogeneous clusters by setting the `enableMultiArchBootImageImport` feature gate to `true` in the `HyperConverged` custom resource (CR). | ||
|
|
||
| :FeatureName: Golden image support for heterogeneous clusters | ||
| include::snippets/technology-preview.adoc[] | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You have access to the cluster as a user with `cluster-admin` permissions. | ||
| * You have installed the {oc-first}. | ||
|
|
||
| .Procedure | ||
|
|
||
| * Enable the `enableMultiArchBootImageImport` feature gate by running the following command: | ||
| + | ||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ oc patch hyperconverged kubevirt-hyperconverged -n {CNVNamespace} \ | ||
| --type json -p '[{"op":"replace","path":"/spec/featureGates/enableMultiArchBootImageImport", "value": true}]' | ||
| ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erpeters157 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * virt/virtual_machines/advanced_vm_management/virt-creating-vms-from-rh-images-overview.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="virt-mod-golden-image-heterogeneous-clusters_{context}"] | ||
| = Modifying a common golden image source in a heterogeneous cluster | ||
|
|
||
| You can modify the image source of a common golden image in a heterogeneous cluster by specifying the supported architectures in the `ssp.kubevirt.io/dict.architectures` annotation in the `HyperConverged` custom resource (CR). | ||
|
|
||
| :FeatureName: Golden image support for heterogeneous clusters | ||
| include::snippets/technology-preview.adoc[] | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You have installed the {oc-first}. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Open the `HyperConverged` CR in your default editor by running the following command: | ||
| + | ||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace} | ||
| ---- | ||
|
|
||
| . Edit the `HyperConverged` CR, adding the appropriate values for `ssp.kubevirt.io/dict.architectures` annotation in the `dataImportCronTemplates` section. For example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| #... | ||
| spec: | ||
erpeters157 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| dataImportCronTemplates: | ||
| - metadata: | ||
| name: kubevirt-hyperconverged | ||
| annotations: | ||
| ssp.kubevirt.io/dict.architectures: "<architecture_list>" <1> | ||
| spec: | ||
| schedule: "0 */12 * * *" | ||
| template: | ||
| spec: | ||
| source: | ||
| registry: | ||
| url: docker://my-private-registry/my-own-version-of-centos:8 | ||
| managedDataSource: centos-stream8 | ||
| #... | ||
| ---- | ||
| <1> The comma-separated list of supported architectures for this image. For example, if the image supports `amd64` and `arm64` architectures, the value would be `"amd64,arm64"`. | ||
|
|
||
| . Save and exit the editor to update the `HyperConverged` CR. | ||
52 changes: 52 additions & 0 deletions
52
modules/virt-modify-workload-node-heterogeneous-cluster.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * virt/virtual_machines/advanced_vm_management/virt-creating-vms-from-rh-images-overview.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="virt-modify-workload-node-heterogeneous-cluster_{context}"] | ||
|
|
||
| = Modifying workloads node placement in a heterogeneous cluster | ||
|
|
||
| :FeatureName: Golden image support for heterogeneous clusters | ||
| include::snippets/technology-preview.adoc[] | ||
|
|
||
| If you have a heterogeneous cluster but not want to enable multiple archiecture support, you can modify the workloads node placement in the `HyperConverged` custom resource (CR) to only include nodes with a specific architecture. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You have installed the {oc-first}. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Open the `HyperConverged` CR in your default editor by running the following command: | ||
| + | ||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace} | ||
| ---- | ||
|
|
||
| . Edit the `HyperConverged` CR, to modify the workloads node placement to include only nodes with a specific architecture. For example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: hco.kubevirt.io/v1beta1 | ||
| kind: HyperConverged | ||
erpeters157 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| metadata: | ||
| name: kubevirt-hyperconverged | ||
| spec: | ||
| #... | ||
| workloads: | ||
| nodePlacement: | ||
| affinity: | ||
| nodeAffinity: | ||
| requiredDuringSchedulingIgnoredDuringExecution: | ||
| nodeSelectorTerms: | ||
| - matchExpressions: | ||
| - key: kubernetes.io/arch | ||
| operator: In | ||
| values: | ||
| - <node_architecture> <1> | ||
| ---- | ||
| <1> Replace `<node_architecture>` with the target architecture. For example, to limit placement to AMD nodes, use `amd64`. | ||
|
|
||
| . Save and exit the editor to update the `HyperConverged` CR. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...dvanced/creating_vms_advanced_web/virt-golden-image-heterogeneous-clusters.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| :_mod-docs-content-type: ASSEMBLY | ||
| [id="virt-golden-image-heterogeneous-clusters"] | ||
| = Heterogeneous cluster support | ||
| include::_attributes/common-attributes.adoc[] | ||
| :context: virt-golden-image-heterogeneous-clusters | ||
|
|
||
| toc::[] | ||
|
|
||
| :FeatureName: Golden image support for heterogeneous clusters | ||
| include::snippets/technology-preview.adoc[] | ||
|
|
||
| A heterogeneous cluster is a cluster where nodes have differing architectures. Heterogeneous clusters promote optimal compute resource usage by mixing different types of hardware in one cluster. This allows workloads to be better matched to hardware intended for the workload task instead of general purpose compute platforms. For example, in a heterogeneous cluster, GPU and general purpose compute resources could be combined and workloads assigned to the appropriate hardware. | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| If golden image support is disabled in a heterogeneous cluster, you can encounter inconsistencies between node and image architectures. This happens when images are used for virtual machine creation that do not match the node architecture. This can lead to the failure of virtual machine boot up or virtual machines that do not run as expected. The warning level alert `HCOMultiArchGoldenImagesDisabled` is produced when this feature is not enabled in a heterogeneous cluster. | ||
| ==== | ||
|
|
||
| If you have a heterogeneous cluster but do not want to enable multiple architecture support, see xref:../../../virt/creating_vms_advanced/creating_vms_advanced_web/virt-golden-image-heterogeneous-clusters.adoc#virt-modify-workload-node-heterogeneous-cluster_virt-golden-image-heterogeneous-clusters[Modifying workloads node placement in a hetergeneous cluster] for the procedure to limit node placement to a specific architecture. | ||
|
|
||
| Golden image support for heterogeneous clusters extends golden image support in the following areas: | ||
|
|
||
| * Enables VM creators to deploy persistent virtual machines with specific architectures. | ||
| * Enables VM creators to define custom golden images that support heterogenous clusters. | ||
|
|
||
| The same golden image can be used with nodes of different architectures if the boot image supports the required architectures. For example, a golden image that supports both ARM and AMD architectures can be used with both types of nodes. | ||
|
|
||
| Golden image support for heterogeneous clusters is not enabled by default. For the procedure to enable this feature, see xref:../../../virt/creating_vms_advanced/creating_vms_advanced_web/virt-golden-image-heterogeneous-clusters.adoc#virt-enabling-heterogeneous-clusters_virt-golden-image-heterogeneous-clusters[Enabling hetergenous cluster support] | ||
|
|
||
| include::modules/virt-enabling-heterogeneous-clusters.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/virt-mod-golden-image-heterogeneous-clusters.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/virt-add-custom-golden-image-heterogeneous-cluster.adoc[leveloffset=+1] | ||
|
|
||
| include::modules/virt-modify-workload-node-heterogeneous-cluster.adoc[leveloffset=+1] | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.