Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-55143

[docs] Fix machine configuration and add explicit warning about usage of resources.requests.memory

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • ---
    • ---
    • None

      We need to update the machine config manifest, since the current provided one causes issue when restarting the kubelet service. Following is the manifest of the new machine config:

      apiVersion: machineconfiguration.openshift.io/v1
      kind: MachineConfig
      metadata:
        labels:
          machineconfiguration.openshift.io/role: worker
        name: 90-worker-swap
      spec:
        config:
          ignition:
            version: 3.4.0
          systemd:
            units:
              - contents: |
                  [Unit]
                  Description=Provision and enable swap
                  ConditionFirstBoot=no
                  ConditionPathExists=!/var/tmp/swapfile
                  
                  [Service]
                  Type=oneshot
                  Environment=SWAP_SIZE_MB=5000
                  ExecStart=/bin/sh -c "sudo dd if=/dev/zero of=/var/tmp/swapfile count=${SWAP_SIZE_MB} bs=1M && \
                  sudo chmod 600 /var/tmp/swapfile && \
                  sudo mkswap /var/tmp/swapfile && \
                  sudo swapon /var/tmp/swapfile && \
                  free -h"
                  
                  [Install]
                  RequiredBy=kubelet-dependencies.target
                enabled: true
                name: swap-provision.service
              - contents: |
                  [Unit]
                  Description=Restrict swap for system slice
                  ConditionFirstBoot=no            [Service]
                  Type=oneshot
                  ExecStart=/bin/sh -c "sudo systemctl set-property --runtime system.slice MemorySwapMax=0 IODeviceLatencyTargetSec=\"/ 50ms\""            [Install]
                  RequiredBy=kubelet-dependencies.target
                enabled: true
                name: cgroup-system-slice-config.service 

      Link: https://raw.githubusercontent.com/openshift-virtualization/wasp-agent/refs/heads/main/manifests/openshift/machineconfig-add-swap.yaml

       

      In addition, we need to add a warning in the beginning of the doc file, the warning can be adjacent to the current important header at the top of the doc.
      The warning should look as follows:
      "Using spec.domain.resources.requests.memory in the VM manifest will disable the memory overcommit configuration. Please use spec.domain.memory.guest instead. "

              rhn-support-sbeskin Sasha Beskin
              ibezukh Igor Bezukh
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: