Skip to content

Commit d2df268

Browse files
authored
Merge pull request #102156 from erpeters157/CNV-70798
CNV-70798: Doc updates for wasp-agent
2 parents 00651b2 + 49ccdf9 commit d2df268

File tree

2 files changed

+9
-180
lines changed

2 files changed

+9
-180
lines changed

modules/virt-removing-wasp-agent.adoc

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,6 @@ If you no longer need memory overcommitment, you can remove the `wasp-agent` com
1616
1717
.Procedure
1818

19-
. Remove the `wasp-agent` DaemonSet:
20-
+
21-
[source,terminal]
22-
----
23-
$ oc delete daemonset wasp-agent -n wasp
24-
----
25-
26-
. If deployed, remove the alerting rules:
27-
+
28-
[source,terminal]
29-
----
30-
$ oc delete prometheusrule wasp-rules -n wasp
31-
----
32-
33-
. Optionally, delete the `wasp` namespace if no other resources depend on it:
34-
+
35-
[source,terminal]
36-
----
37-
$ oc delete namespace wasp
38-
----
39-
4019
. Revert the memory overcommitment configuration:
4120
+
4221
[source,terminal]
@@ -67,16 +46,8 @@ $ oc delete kubeletconfig custom-config
6746
$ oc wait mcp worker --for condition=Updated=True --timeout=-1s
6847
----
6948

70-
.Verification
7149

72-
* Confirm that the `wasp-agent` DaemonSet is removed:
73-
+
74-
[source,terminal]
75-
----
76-
$ oc get daemonset -n wasp
77-
----
78-
+
79-
No `wasp-agent` should be listed.
50+
.Verification
8051

8152
* Confirm that swap is no longer enabled on a node:
8253
+

modules/virt-using-wasp-agent-to-configure-higher-vm-workload-density.adoc

Lines changed: 8 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
[role="_abstract"]
1010
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.
1111

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+
1214
[IMPORTANT]
1315
====
1416
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,7 +60,9 @@ spec:
5860
$ oc wait mcp worker --for condition=Updated=True --timeout=-1s
5961
----
6062

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:
6266
+
6367
[source,yaml]
6468
----
@@ -125,159 +129,13 @@ NODE_SWAP_SPACE = 16 GB * (150% / 100% - 1)
125129
= 8 GB
126130
----
127131

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:
151133
+
152134
[source,yaml]
153135
----
154136
$ oc wait mcp worker --for condition=Updated=True --timeout=-1s
155137
----
156138

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-
281139
. Enable memory overcommitment in {VirtProductName} by using the web console or the CLI.
282140
+
283141
--
@@ -312,9 +170,9 @@ hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patched
312170

313171
. To verify the deployment of `wasp-agent`, run the following command:
314172
+
315-
[source, terminal]
173+
[source,terminal,subs="attributes+"]
316174
----
317-
$ oc rollout status ds wasp-agent -n wasp
175+
$ oc rollout status ds wasp-agent -n {CNVNamespace}
318176
----
319177
+
320178
If the deployment is successful, the following message is displayed:

0 commit comments

Comments
 (0)