×

Running workloads on a DPU enables offloading specialized infrastructure tasks such as networking, security, and storage to a dedicated processing unit. This improves performance, enforces a stronger security boundary between infrastructure and application workloads, and frees up host CPU resources.

Running a workload on the DPU

Follow these steps to deploy a workload on the DPU.

Prerequisites
  • The OpenShift CLI (oc) is installed.

  • An account with cluster-admin privileges is available.

  • The DPU Operator is installed.

Procedure
  1. Create a sample workload on the host side by using the following YAML, save the file as workload-host.yaml:

    apiVersion: v1
    kind: Pod
    metadata:
      name: my-pod
      namespace: default
      annotations:
        k8s.v1.cni.cncf.io/networks: default-sriov-net
    spec:
      nodeSelector:
        kubernetes.io/hostname: worker-237 (1)
      containers:
      - name: appcntr1
        image: registry.access.redhat.com/ubi9/ubi:latest
        command: ['/bin/sh', '-c', 'sleep infinity']
        imagePullPolicy: Always
        securityContext:
          priviledged: true
          runAsNonRoot: false
          runAsUser: 0
          seccompProfile:
            type: RuntimeDefault
        resources:
          requests:
            openshift.io/dpu: '1'
          limits:
            openshift.io/dpu: '1'
    1 The name of the node where the workload is deployed.
  2. Create the workload by running the following command:

    $ oc apply -f workload-host.yaml

Creating a service function chain on the DPU

Network service chaining, also known as service function chaining (SFC) is a capability that uses software-defined networking (SDN) capabilities to create a chain of connected network services, such as L4-7 services like firewalls, network address translation (NAT), and intrusion protection.

Follow this procedure on the DPU to create the network function my-network-function in the service function chain.

Prerequisites
  • Install the OpenShift CLI (oc).

  • An account with cluster-admin privileges.

  • Install the DPU Operator.

Procedure
  1. Save the following YAML file example as sfc.yaml:

    apiVersion: config.openshift.io/v1
    kind: ServiceFunctionChain
    metadata:
      name: sfc
      namespace: openshift-dpu-operator
    spec:
      networkFunctions:
      - name: my-network-function (1)
        image: quay.io/example-org/my-network-function:latest (2)
    1 The name of the network function. This name is used to identify the network function in the service function chain.
    2 The URL to the container image that contains the network function. The image must be accessible from the DPU.
  2. Create the chain by running the following command on the DPU nodes:

    $ oc apply -f sfc.yaml