5장. Postinstallation configuration
5.1. Run automated postinstallation configuration 링크 복사링크가 클립보드에 복사되었습니다!
The virt-platform-autopilot controller replaces manual postinstallation configuration by automatically applying opinionated defaults to the virtualization platform and installed optional components. You can customize or opt out of any managed configuration.
5.1.1. How automated postinstallation configuration works 링크 복사링크가 클립보드에 복사되었습니다!
After you install OpenShift Virtualization, the virt-platform-autopilot controller continuously reconciles managed resources to keep the expected state and correct configuration drift. It also configures optional components such as the Kube Descheduler Operator and the Cluster Observability Operator if they are installed.
The virt-platform-autopilot controller manages the following configurations:
- Load-aware descheduler
- Configures the Kube Descheduler Operator to balance virtual machine (VM) workloads across nodes based on CPU and memory use. Requires the Kube Descheduler Operator to be installed.
- Observability enhancements
- Enhances observability with additional Prometheus alerting rules and advanced Perses dashboards in the OpenShift Container Platform web console.
- Swap enablement
- Enables OpenShift Container Platform worker nodes to safely use swap for virtualization workloads. Swap requires pre-provisioned, dedicated storage to be available.
5.1.1.1. Soft dependency model 링크 복사링크가 클립보드에 복사되었습니다!
The virt-platform-autopilot controller does not install optional components. It configures components that are already installed on the cluster. If an optional component is not installed, the virt-platform-autopilot controller skips that configuration and continues without error.
When you install an optional component later, the virt-platform-autopilot controller detects it on the next reconciliation cycle and applies the relevant configuration automatically.
5.1.1.2. Reconciliation and anti-thrashing behavior 링크 복사링크가 클립보드에 복사되었습니다!
The virt-platform-autopilot controller continuously reconciles managed resources to keep the expected state. If an external process changes a managed resource, the virt-platform-autopilot controller detects the drift and restores the expected state.
To prevent thrashing, the virt-platform-autopilot controller monitors the rate of changes to managed resources. If the virt-platform-autopilot controller detects rapid or repeated changes, it pauses reconciliation for the affected resources. This prevents a loop where the virt-platform-autopilot controller and another controller repeatedly overwrite each other’s changes. You can monitor paused resources by using the kubevirt_autopilot_paused_resources metric.
5.1.2. Customize or opt-out of managed configurations 링크 복사링크가 클립보드에 복사되었습니다!
The virt-platform-autopilot controller applies opinionated defaults, but you can override managed configurations to suit your environment.
z
- Stop reconciliation of a resource
- Mark a resource as unmanaged so that the controller does not reconcile it after it is created. You take full ownership of that resource’s configuration.
You can combine these approaches across different resources in the same cluster.
5.1.2.1. Exclude a resource from being managed by the virt-platform-autopilot controller 링크 복사링크가 클립보드에 복사되었습니다!
Disabled resources are not created or reconciled automatically by the virt-platform-autopilot controller. Prevent the controller from creating or reconciling a resource by disabling it in the HyperConverged custom resource (CR).
Prerequisites
-
You have installed the OpenShift CLI (
oc). -
You have logged in to the cluster as a user with
cluster-adminprivileges. -
The
virt-platform-autopilotcontroller is enabled on the cluster.
Procedure
Edit the
HyperConvergedCR and add resources to theplatform.kubevirt.io/disabled-resourcesannotation:Example
HyperConvergedCR:apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: annotations: platform.kubevirt.io/disabled-resources: | - kind: KubeDescheduler name: cluster - kind: MachineConfig name: 90-worker-swap-onlineApply your changes to the
HyperConvergedCR by running the following command:$ oc apply -f <filename>.yaml
5.1.2.2. Customize specific values in a managed resource 링크 복사링크가 클립보드에 복사되었습니다!
Customize specific values in a managed resource by applying a JSON patch on top of the reconciled configuration to retain your custom settings.
Deleting an unmanaged resource causes any annotations on that resource to be lost. The virt-platform-autopilot controller then creates a new, opinionated version of the resource.
To prevent the virt-platform-autopilot controller from recreating deleted resources, you must disable the resource. You can disable resources by adding them to the platform.kubevirt.io/disabled-resources annotation in the HyperConverged custom resource (CR).
For more information, see "Exclude a resource from being managed by the virt-platform-autopilot controller".
Prerequisites
-
You have installed the OpenShift CLI (
oc). -
You have logged in to the cluster as a user with
cluster-adminprivileges. -
The
virt-platform-autopilotcontroller is enabled on the cluster. -
The
platform.kubevirt.io/mode=unmanagedandplatform.kubevirt.io/ignore-fieldsannotations must not be present on the resource.
Procedure
Add the
platform.kubevirt.io/patchannotation to a resource with a valid RFC 6902 JSON Patch operations array.For example, to prevent the
virt-platform-autopilotcontroller from overriding a custom descheduler profile configuration, run the following command:$ oc annotate kubedescheduler cluster \ 'platform.kubevirt.io/patch=[{"op":"replace","path":"/spec/profileCustomizations","value":{"devKnobs":{}}}]' \ -n openshift-kube-descheduler-operatorThe
virt-platform-autopilotcontroller continues to manage all other fields on the resource but skips the specified paths.중요JSON patches are blocked on sensitive resources, including
MachineConfigandKubeletConfigresources.Optional: To restore
virt-platform-autopilotcontroller management for all fields, remove theplatform.kubevirt.io/patchannotation.For example, to restore
virt-platform-autopilotcontroller management for all fields of the descheduler configuration, run the following command:$ oc annotate kubedescheduler cluster \ platform.kubevirt.io/patch- \ -n openshift-kube-descheduler-operator
5.1.2.3. Exclude specific fields from reconciliation in a managed resource 링크 복사링크가 클립보드에 복사되었습니다!
Exclude specific fields from being managed by the virt-platform-autopilot controller so that it ignores them during reconciliation.
Deleting an unmanaged resource causes any annotations on that resource to be lost. The virt-platform-autopilot controller then creates a new, opinionated version of the resource.
To prevent the virt-platform-autopilot controller from recreating deleted resources, you must disable the resource. You can disable resources by adding them to the platform.kubevirt.io/disabled-resources annotation in the HyperConverged custom resource (CR).
For more information, see "Exclude a resource from being managed by the virt-platform-autopilot controller".
Prerequisites
-
You have installed the OpenShift CLI (
oc). -
You have logged in to the cluster as a user with
cluster-adminprivileges. -
The
virt-platform-autopilotcontroller is enabled on the cluster. -
The
platform.kubevirt.io/mode=unmanagedandplatform.kubevirt.io/patchannotations must not be present on the resource.
Procedure
Add the
platform.kubevirt.io/ignore-fieldsannotation with a comma-separated list of RFC 6901 JSON Pointer paths.For example, to prevent the
virt-platform-autopilotcontroller from overriding a systemd unit in a managedMachineConfigresource, run the following command:$ oc annotate machineconfig 90-worker-swap-online \ platform.kubevirt.io/ignore-fields='/spec/config/systemd/units/0/contents'Optional: To restore
virt-platform-autopilotcontroller management for all fields, remove theplatform.kubevirt.io/ignore-fieldsannotation.For example, to restore
virt-platform-autopilotcontroller management for all fields of the descheduler configuration, run the following command:$ oc annotate kubedescheduler cluster \ platform.kubevirt.io/ignore-fields- \ -n openshift-kube-descheduler-operator
5.1.2.4. Stop reconciliation of a managed resource 링크 복사링크가 클립보드에 복사되었습니다!
Mark a resource as unmanaged so that the virt-platform-autopilot controller does not reconcile it after it is created. You take full ownership of that resource’s configuration.
Deleting an unmanaged resource causes any annotations on that resource to be lost. The virt-platform-autopilot controller then creates a new, opinionated version of the resource.
To prevent the virt-platform-autopilot controller from recreating deleted resources, you must disable the resource. You can disable resources by adding them to the platform.kubevirt.io/disabled-resources annotation in the HyperConverged custom resource (CR).
For more information, see "Exclude a resource from being managed by the virt-platform-autopilot controller".
Prerequisites
-
You have installed the OpenShift CLI (
oc). -
You have logged in to the cluster as a user with
cluster-adminprivileges. -
The
virt-platform-autopilotcontroller is enabled on the cluster. -
The
platform.kubevirt.io/ignore-fieldsandplatform.kubevirt.io/patchannotations must not be present on the resource.
Procedure
Set the
platform.kubevirt.io/modeannotation for the resource tounmanaged.For example, to stop the
virt-platform-autopilotcontroller from managing the descheduler configuration, run the following command:$ oc annotate kubedescheduler cluster \ platform.kubevirt.io/mode=unmanaged \ -n openshift-kube-descheduler-operatorOptional: To restore
virt-platform-autopilotcontroller management for a resource, remove theplatform.kubevirt.io/modeannotation.For example, to restore
virt-platform-autopilotcontroller management for the descheduler configuration, run the following command:$ oc annotate kubedescheduler cluster \ platform.kubevirt.io/mode- \ -n openshift-kube-descheduler-operator