mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
formatting fix formatting fix 2 fixing vale errors 5 fixing vale errors 6 fixing vale errors 7
76 lines
2.4 KiB
Plaintext
76 lines
2.4 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * networking/networking_operators/nw-dpu-running-workloads.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="nw-dpu-creating-a-sfc_{context}"]
|
|
= Running a workload on the DPU
|
|
|
|
[role="_abstract"]
|
|
You can deploy network workloads directly on the DPU to improve performance, enhance security isolation, and reduce host CPU usage.
|
|
|
|
The DPU offloads network workloads, such as security functions or virtualized appliances, to improve performance, enhance security isolation, and free host CPU resources.
|
|
|
|
Follow this procedure to deploy a simple pod directly onto the DPU.
|
|
|
|
.Prerequisites
|
|
|
|
* Install the {oc-first}.
|
|
* An account with `cluster-admin` privileges.
|
|
* Install the DPU Operator.
|
|
|
|
.Procedure
|
|
|
|
. Save the following YAML file example as `dpu-pod.yaml`. This is an example of a simple pod that will be scheduled directly onto a DPU node by the Kubernetes default scheduler.
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: "my-network-function"
|
|
namespace: openshift-dpu-operator
|
|
annotations:
|
|
k8s.v1.cni.cncf.io/networks: dpunfcni-conf, dpunfcni-conf
|
|
spec:
|
|
nodeSelector:
|
|
dpu.config.openshift.io/dpuside: "dpu"
|
|
containers:
|
|
- name: "my-network-function"
|
|
image: "quay.io/example-org/my-network-function:latest"
|
|
resources:
|
|
requests:
|
|
openshift.io/dpu: "2"
|
|
limits:
|
|
openshift.io/dpu: "2"
|
|
securityContext:
|
|
privileged: true
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
add:
|
|
- NET_RAW
|
|
- NET_ADMIN
|
|
----
|
|
+
|
|
* `metadata.name.annotations.k8s.v1.cni.cncf.io/networks`: The value `dpunfcni-conf` specifies the name of the `NetworkAttachmentDefinition` resource. The DPU Operator creates this resource during installation to configure the DPU networking.
|
|
* `spec.nodeSelector`: The `nodeSelector` is the primary mechanism for scheduling this workload. The DPU Operator creates and maintains the label: `dpu.config.openshift.io/dpuside: "dpu"`. This label ensures the pod is scheduled directly onto the DPU's processing unit.
|
|
* `spec.containers.name`: The name of the container.
|
|
* `spec.containers.image`: The container image to pull and run.
|
|
|
|
. Create the pod by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f dpu-pod.yaml
|
|
----
|
|
|
|
. Verify the pod status by running the following command:
|
|
+
|
|
[source,bash]
|
|
----
|
|
$ oc get pods -n openshift-dpu-operator
|
|
----
|
|
+
|
|
Ensure the pod's status is `Running`.
|