|
9 | 9 | [role="_abstract"] |
10 | 10 | The `wasp-agent` component facilitates memory overcommitment by assigning swap resources to worker nodes. It also manages pod evictions when nodes are at risk due to high swap I/O traffic or high utilization. |
11 | 11 |
|
| 12 | +The `wasp-agent` component is deployed automatically if `memoryOvercommitPercentage` is set to more than `100` when you first create the `HyperConverged` custom resource (CR). |
| 13 | + |
12 | 14 | [IMPORTANT] |
13 | 15 | ==== |
14 | 16 | Swap resources can be only assigned to virtual machine workloads (VM pods) of the `Burstable` Quality of Service (QoS) class. VM pods of the `Guaranteed` QoS class and pods of any QoS class that do not belong to VMs cannot swap resources. |
|
58 | 60 | $ oc wait mcp worker --for condition=Updated=True --timeout=-1s |
59 | 61 | ---- |
60 | 62 |
|
61 | | -. Provision swap by creating a `MachineConfig` object. For example: |
| 63 | +. Provision swap by creating a `MachineConfig` object: |
| 64 | + |
| 65 | +.. Create a `MachineConfig` file with the paramaters shown in the following example: |
62 | 66 | + |
63 | 67 | [source,yaml] |
64 | 68 | ---- |
@@ -125,159 +129,13 @@ NODE_SWAP_SPACE = 16 GB * (150% / 100% - 1) |
125 | 129 | = 8 GB |
126 | 130 | ---- |
127 | 131 |
|
128 | | -. Create a privileged service account by running the following commands: |
129 | | -+ |
130 | | -[source,terminal] |
131 | | ----- |
132 | | -$ oc adm new-project wasp |
133 | | ----- |
134 | | -+ |
135 | | -[source,terminal] |
136 | | ----- |
137 | | -$ oc create sa -n wasp wasp |
138 | | ----- |
139 | | -+ |
140 | | -[source,terminal] |
141 | | ----- |
142 | | -$ oc create clusterrolebinding wasp --clusterrole=cluster-admin --serviceaccount=wasp:wasp |
143 | | ----- |
144 | | -+ |
145 | | -[source,terminal] |
146 | | ----- |
147 | | -$ oc adm policy add-scc-to-user -n wasp privileged -z wasp |
148 | | ----- |
149 | | -
|
150 | | -. Wait for the worker nodes to sync with the new configuration by running the following command: |
| 132 | +.. Wait for the worker nodes to sync with the new configuration by running the following command: |
151 | 133 | + |
152 | 134 | [source,yaml] |
153 | 135 | ---- |
154 | 136 | $ oc wait mcp worker --for condition=Updated=True --timeout=-1s |
155 | 137 | ---- |
156 | 138 |
|
157 | | -. Determine the pull URL for the wasp agent image by running the following command: |
158 | | -+ |
159 | | -[source,terminal] |
160 | | ----- |
161 | | -$ oc get csv -n openshift-cnv -l=operators.coreos.com/kubevirt-hyperconverged.openshift-cnv -ojson | jq '.items[0].spec.relatedImages[] | select(.name|test(".*wasp-agent.*")) | .image' |
162 | | ----- |
163 | | -
|
164 | | -. Deploy `wasp-agent` by creating a `DaemonSet` object as shown in the following example: |
165 | | -+ |
166 | | -[source,yaml] |
167 | | ----- |
168 | | -kind: DaemonSet |
169 | | -apiVersion: apps/v1 |
170 | | -metadata: |
171 | | - name: wasp-agent |
172 | | - namespace: wasp |
173 | | - labels: |
174 | | - app: wasp |
175 | | - tier: node |
176 | | -spec: |
177 | | - selector: |
178 | | - matchLabels: |
179 | | - name: wasp |
180 | | - template: |
181 | | - metadata: |
182 | | - annotations: |
183 | | - description: >- |
184 | | - Configures swap for workloads |
185 | | - labels: |
186 | | - name: wasp |
187 | | - spec: |
188 | | - containers: |
189 | | - - env: |
190 | | - - name: SWAP_UTILIZATION_THRESHOLD_FACTOR |
191 | | - value: "0.8" |
192 | | - - name: MAX_AVERAGE_SWAP_IN_PAGES_PER_SECOND |
193 | | - value: "1000000000" |
194 | | - - name: MAX_AVERAGE_SWAP_OUT_PAGES_PER_SECOND |
195 | | - value: "1000000000" |
196 | | - - name: AVERAGE_WINDOW_SIZE_SECONDS |
197 | | - value: "30" |
198 | | - - name: VERBOSITY |
199 | | - value: "1" |
200 | | - - name: FSROOT |
201 | | - value: /host |
202 | | - - name: NODE_NAME |
203 | | - valueFrom: |
204 | | - fieldRef: |
205 | | - fieldPath: spec.nodeName |
206 | | - image: >- |
207 | | - quay.io/openshift-virtualization/wasp-agent:v4.20 <1> |
208 | | - imagePullPolicy: Always |
209 | | - name: wasp-agent |
210 | | - resources: |
211 | | - requests: |
212 | | - cpu: 100m |
213 | | - memory: 50M |
214 | | - securityContext: |
215 | | - privileged: true |
216 | | - volumeMounts: |
217 | | - - mountPath: /host |
218 | | - name: host |
219 | | - - mountPath: /rootfs |
220 | | - name: rootfs |
221 | | - hostPID: true |
222 | | - hostUsers: true |
223 | | - priorityClassName: system-node-critical |
224 | | - serviceAccountName: wasp |
225 | | - terminationGracePeriodSeconds: 5 |
226 | | - volumes: |
227 | | - - hostPath: |
228 | | - path: / |
229 | | - name: host |
230 | | - - hostPath: |
231 | | - path: / |
232 | | - name: rootfs |
233 | | - updateStrategy: |
234 | | - type: RollingUpdate |
235 | | - rollingUpdate: |
236 | | - maxUnavailable: 10% |
237 | | - maxSurge: 0 |
238 | | ----- |
239 | | -<1> Replace the `image` value with the image URL from the previous step. |
240 | | -
|
241 | | -. Deploy alerting rules by creating a `PrometheusRule` object. For example: |
242 | | -+ |
243 | | -[source,yaml] |
244 | | ----- |
245 | | -apiVersion: monitoring.coreos.com/v1 |
246 | | -kind: PrometheusRule |
247 | | -metadata: |
248 | | - labels: |
249 | | - tier: node |
250 | | - wasp.io: "" |
251 | | - name: wasp-rules |
252 | | - namespace: wasp |
253 | | -spec: |
254 | | - groups: |
255 | | - - name: alerts.rules |
256 | | - rules: |
257 | | - - alert: NodeHighSwapActivity |
258 | | - annotations: |
259 | | - description: High swap activity detected at {{ $labels.instance }}. The rate |
260 | | - of swap out and swap in exceeds 200 in both operations in the last minute. |
261 | | - This could indicate memory pressure and may affect system performance. |
262 | | - runbook_url: https://github.com/openshift-virtualization/wasp-agent/tree/main/docs/runbooks/NodeHighSwapActivity.md |
263 | | - summary: High swap activity detected at {{ $labels.instance }}. |
264 | | - expr: rate(node_vmstat_pswpout[1m]) > 200 and rate(node_vmstat_pswpin[1m]) > |
265 | | - 200 |
266 | | - for: 1m |
267 | | - labels: |
268 | | - kubernetes_operator_component: kubevirt |
269 | | - kubernetes_operator_part_of: kubevirt |
270 | | - operator_health_impact: warning |
271 | | - severity: warning |
272 | | ----- |
273 | | -
|
274 | | -. Add the `cluster-monitoring` label to the `wasp` namespace by running the following command: |
275 | | -+ |
276 | | -[source,terminal] |
277 | | ----- |
278 | | -$ oc label namespace wasp openshift.io/cluster-monitoring="true" |
279 | | ----- |
280 | | -
|
281 | 139 | . Enable memory overcommitment in {VirtProductName} by using the web console or the CLI. |
282 | 140 | + |
283 | 141 | -- |
@@ -312,9 +170,9 @@ hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patched |
312 | 170 |
|
313 | 171 | . To verify the deployment of `wasp-agent`, run the following command: |
314 | 172 | + |
315 | | -[source, terminal] |
| 173 | +[source,terminal,subs="attributes+"] |
316 | 174 | ---- |
317 | | -$ oc rollout status ds wasp-agent -n wasp |
| 175 | +$ oc rollout status ds wasp-agent -n {CNVNamespace} |
318 | 176 | ---- |
319 | 177 | + |
320 | 178 | If the deployment is successful, the following message is displayed: |
|
0 commit comments