Add dbuf and pfcp agent

Change-Id: Iefcdbf1e2f32e0e97ec17abab85941615ba5bac6
diff --git a/VERSION b/VERSION
index afaf360..7f20734 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.0
\ No newline at end of file
+1.0.1
\ No newline at end of file
diff --git a/dbuf/.helmignore b/dbuf/.helmignore
new file mode 100644
index 0000000..c687fff
--- /dev/null
+++ b/dbuf/.helmignore
@@ -0,0 +1,26 @@
+# Copyright 2021-present Open Networking Foundation
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/dbuf/Chart.yaml b/dbuf/Chart.yaml
new file mode 100644
index 0000000..042e94e
--- /dev/null
+++ b/dbuf/Chart.yaml
@@ -0,0 +1,26 @@
+# Copyright 2021-present Open Networking Foundation
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v2
+name: dbuf
+description: A Helm chart deploying DBUF
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# This is the chart version. This version number should be incremented each time you make changes
+# to the chart and its templates, including the app version.
+# Versions are expected to follow Semantic Versioning (https://semver.org/)
+version: 0.0.1
+
+# This is the version number of the application being deployed. This version number should be
+# incremented each time you make changes to the application. Versions are not expected to
+# follow Semantic Versioning. They should reflect the version the application is using.
+appVersion: 0.0.1
diff --git a/dbuf/templates/NOTES.txt b/dbuf/templates/NOTES.txt
new file mode 100644
index 0000000..55b688c
--- /dev/null
+++ b/dbuf/templates/NOTES.txt
@@ -0,0 +1,10 @@
+{{/*
+Copyright 2020-present Open Networking Foundation
+SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+Thank you for installing {{ .Chart.Name }}.
+
+Your release is named {{ .Release.Name }}.
+
+This chart deploys DBUF.
\ No newline at end of file
diff --git a/dbuf/templates/_helpers.tpl b/dbuf/templates/_helpers.tpl
new file mode 100644
index 0000000..b8b672a
--- /dev/null
+++ b/dbuf/templates/_helpers.tpl
@@ -0,0 +1,71 @@
+{{/*
+Copyright 2020-present Open Networking Foundation
+SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- define "extraParams" -}}
+{{- join "," . -}}
+{{- end -}}
+
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "dbuf.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "dbuf.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "dbuf.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "dbuf.labels" -}}
+helm.sh/chart: {{ include "dbuf.chart" . }}
+{{ include "dbuf.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "dbuf.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "dbuf.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "dbuf.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "dbuf.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
diff --git a/dbuf/templates/configmap-config.yaml b/dbuf/templates/configmap-config.yaml
new file mode 100644
index 0000000..96368c9
--- /dev/null
+++ b/dbuf/templates/configmap-config.yaml
@@ -0,0 +1,52 @@
+{{/*
+# Copyright 2021-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "dbuf.fullname" . }}
+  labels:
+    {{- include "dbuf.labels" . | nindent 4 }}
+data:
+  config: |
+    #!/bin/sh
+    set -x
+    env
+    export IFS=','
+    for r in $STATIC_ROUTES; do
+      ip route add $r dev $DP_INTERFACE
+    done
+    unset IFS
+    ifconfig
+    while true
+    do
+        echo "Up SR-IOV intercae"
+        ip link set $DP_INTERFACE up
+        echo "Get the IP Address from interface $DP_INTERFACE"
+        ifconfig $DP_INTERFACE
+        #IP Address from ifconfig is addr:10.71.126.127, have to cut it off
+        DP_IP=$(ifconfig $DP_INTERFACE | awk '/inet addr:/ {print $2}' | cut -d':' -f2)
+        echo "IP Address is $DP_IP"
+
+        echo "Generate the netcfg json"
+    cat <<EOF > /tmp/netcfg.json
+        {
+          "apps": {
+            "org.omecproject.up4": {
+              "dbuf": {
+                "serviceAddr": "$GRPC_SERVICE_NAME.$NAMESPACE:$GRPC_PORT",
+                "dataplaneAddr": "$DP_IP:$DP_PORT"
+              }
+            }
+          }
+        }
+    EOF
+
+        cat /tmp/netcfg.json
+        curl --fail -sSL --user $ONOS_USERNAME:$ONOS_PASSWORD --noproxy $ONOS_SERVER -X POST -H 'Content-Type:application/json' \
+        http://$ONOS_SERVER:$ONOS_PORT/onos/v1/network/configuration -d@/tmp/netcfg.json
+        sleep 1m
+    done
diff --git a/dbuf/templates/deployment.yaml b/dbuf/templates/deployment.yaml
new file mode 100644
index 0000000..22d4db7
--- /dev/null
+++ b/dbuf/templates/deployment.yaml
@@ -0,0 +1,105 @@
+
+# Copyright 2020-present Open Networking Foundation
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "dbuf.fullname" . }}
+  labels:
+    {{- include "dbuf.labels" . | nindent 4 }}
+spec:
+  replicas: {{ .Values.replicaCount }}
+  selector:
+    matchLabels:
+      {{- include "dbuf.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+    {{- with .Values.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+    {{- end }}
+      labels:
+        {{- include "dbuf.selectorLabels" . | nindent 8 }}
+    spec:
+      {{- if hasKey .Values.image "pullSecrets" }}
+      imagePullSecrets:
+        {{- range .Values.image.pullSecrets }}
+        - name: {{ . | quote }}
+        {{- end }}
+      {{- end }}
+      securityContext:
+        {{- toYaml .Values.podSecurityContext | nindent 8 }}
+      containers:
+        - name: {{ .Chart.Name }}
+          securityContext:
+            {{- toYaml .Values.securityContext | nindent 12 }}
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          command: [ "dbuf", {{ template "extraParams" .Values.extraParams }} ]
+          resources:
+            requests:
+              intel.com/{{ .Values.sriovResourceName }}: '{{ .Values.sriovNICSize }}'
+            limits:
+              intel.com/{{ .Values.sriovResourceName }}: '{{ .Values.sriovNICSize }}'
+          ports:
+          - name: grpc
+            containerPort: 10000
+            protocol:  {{ .Values.service.grpc.protocol }}
+          - name: exporter
+            containerPort: 8080
+            protocol: {{ .Values.service.stats.protocol }}
+        # Push data plane address to ONOS via netcfgc
+        # Add the static route for sr-iov interface
+        - name: config
+          image: curlimages/curl:7.75.0
+          imagePullPolicy: IfNotPresent
+          env:
+            - name: NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+            - name: ONOS_SERVER
+              value: "{{ .Values.onos.server }}"
+            - name: ONOS_PORT
+              value: "{{ .Values.onos.port }}"
+            - name: ONOS_USERNAME
+              value: "{{ .Values.onos.username }}"
+            - name: ONOS_PASSWORD
+              value: "{{ .Values.onos.password }}"
+            - name: GRPC_SERVICE_NAME
+              value: {{ include "dbuf.fullname" . }}
+            - name: GRPC_PORT
+              value: "{{ .Values.service.grpc.port }}"
+            - name: DP_INTERFACE
+              value: "{{ .Values.dataplane.interface }}"
+            - name: DP_PORT
+              value: "{{ .Values.dataplane.port }}"
+            - name: STATIC_ROUTES
+              value: "{{ .Values.network.route }}"
+          volumeMounts:
+            - name: config-script
+              mountPath: /tmp/config
+              subPath: config
+          command: ["sh", "-c", "/tmp/config"]
+          securityContext:
+            runAsUser: 0
+            capabilities:
+              add: ["NET_ADMIN"]
+      {{- with .Values.nodeSelector }}
+      nodeSelector:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.affinity }}
+      affinity:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.tolerations }}
+      tolerations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      volumes:
+        - name: config-script
+          configMap:
+            name: {{ include "dbuf.fullname" . }}
+            defaultMode: 0755
diff --git a/dbuf/templates/networks.yaml b/dbuf/templates/networks.yaml
new file mode 100644
index 0000000..84e0cf5
--- /dev/null
+++ b/dbuf/templates/networks.yaml
@@ -0,0 +1,33 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+  name: {{ .Values.multusNetworkName }}
+  annotations:
+    k8s.v1.cni.cncf.io/resourceName: intel.com/{{ .Values.sriovResourceName }}
+spec:
+  config: '{
+  "type": "sriov",
+  "name": "sriov-network",
+{{- if hasKey .Values.network "vlan" }}
+  "vlan": {{ .Values.network.vlan }},
+{{- end }}
+  "ipam": {
+    {{- if eq .Values.network.ipam "host-local" }}
+    "type": "host-local",
+    "subnet": "{{ .Values.network.static.subnets }}",
+    "routes": [{
+      "dst": "0.0.0.0/0"
+    }],
+    "gateway": "{{ .Values.network.static.gateway }}"
+    {{- else if eq .Values.network.ipam "dhcp" }}
+    "type": "dhcp"
+
+    {{- end }}
+  }
+}'
diff --git a/dbuf/templates/service.yml b/dbuf/templates/service.yml
new file mode 100644
index 0000000..48df27e
--- /dev/null
+++ b/dbuf/templates/service.yml
@@ -0,0 +1,36 @@
+{{/*
+# Copyright 2021-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "dbuf.fullname" . }}
+  labels:
+    {{- include "dbuf.labels" . | nindent 4 }}
+spec:
+  selector:
+    {{- include "dbuf.selectorLabels" . | nindent 4 }}
+  ports:
+  - name: grpc
+    protocol: {{ .Values.service.grpc.protocol }}
+    port: {{ .Values.service.grpc.port }}
+    targetPort: grpc
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "dbuf.fullname" . }}-stats
+  labels:
+    {{- include "dbuf.labels" . | nindent 4 }}
+spec:
+  selector:
+    {{- include "dbuf.selectorLabels" . | nindent 4 }}
+  ports:
+  - name: exporter
+    protocol: {{ .Values.service.stats.protocol }}
+    port: {{ .Values.service.stats.port }}
+    targetPort: exporter
diff --git a/dbuf/templates/servicemonitor.yaml b/dbuf/templates/servicemonitor.yaml
new file mode 100644
index 0000000..4290b0b
--- /dev/null
+++ b/dbuf/templates/servicemonitor.yaml
@@ -0,0 +1,23 @@
+{{- if eq .Values.prometheus_enable true }}
+
+{{/*
+# Copyright 2021-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+  name: dbuf
+  labels:
+    {{- include "dbuf.labels" . | nindent 4 }}
+spec:
+  selector:
+    matchLabels:
+      {{- include "dbuf.selectorLabels" . | nindent 6 }}
+  endpoints:
+  - port: exporter
+    path: /metrics
+    scheme: HTTP
+{{ end }}
diff --git a/dbuf/values.yaml b/dbuf/values.yaml
new file mode 100644
index 0000000..f0408b9
--- /dev/null
+++ b/dbuf/values.yaml
@@ -0,0 +1,65 @@
+# Copyright 2021-present Open Networking Foundation
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+image:
+  repository: registry.aetherproject.org/tost/dbuf
+  pullPolicy: Always
+  tag: "latest"
+
+extraParams:
+  - '"-max_queues=1024"'
+
+replicaCount: 1
+sriovNICSize: 1
+sriovResourceName: intel_sriov_netdevice
+
+# Change both in the same time
+multusNetworkName: dbuf-sriov
+podAnnotations:
+  k8s.v1.cni.cncf.io/networks: dbuf-sriov@net0
+
+podSecurityContext: {}
+resources:
+  requests:
+    intel.com/intel_sriov_netdevice: "1"
+  limits:
+    intel.com/intel_sriov_netdevice: "1"
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}
+
+# onos inforamtion
+onos:
+  server: sdfabric-onos-classic-hs.sdfabric
+  port: 8181
+  username: onos
+  password: rocks
+
+dataplane:
+  port: 2152
+  interface: "net0"
+
+prometheus_enable: true
+service:
+  stats:
+    port: 8080
+    protocol: TCP
+  grpc:
+    port: 10000
+    protocol: TCP
+
+# two options for ipam, dhcp or host-local
+# static is for host-local ipam
+network:
+  #  ipam: dhcp
+  ipam: host-local
+  static:
+    subnets: "10.56.217.0/24"
+    gateway: "10.56.217.1"
+  # route the following subnets via sr-iov interface
+  # route: 10.56.215.0/24,10.56.214.0/24
+  route: ""
+  #vlan:
diff --git a/pfcp-agent/Chart.yaml b/pfcp-agent/Chart.yaml
new file mode 100644
index 0000000..0befa5f
--- /dev/null
+++ b/pfcp-agent/Chart.yaml
@@ -0,0 +1,8 @@
+# Copyright 2020-present Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+description: PFCP Agent for SD-Fabric's P4 UPF
+name: pfcp-agent
+version: 0.0.1
diff --git a/pfcp-agent/templates/_helpers.tpl b/pfcp-agent/templates/_helpers.tpl
new file mode 100644
index 0000000..2746e4c
--- /dev/null
+++ b/pfcp-agent/templates/_helpers.tpl
@@ -0,0 +1,66 @@
+{{- /*
+
+# Copyright 2020-present Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+*/ -}}
+
+{{/*
+Renders a set of standardised labels.
+*/}}
+{{- define "pfcp-agent.metadata_labels" -}}
+{{- $application := index . 0 -}}
+{{- $context := index . 1 -}}
+release: {{ $context.Release.Name }}
+app: {{ $application }}
+{{- end -}}
+
+{{/*
+Render the given template.
+*/}}
+{{- define "pfcp-agent.template" -}}
+{{- $name := index . 0 -}}
+{{- $context := index . 1 -}}
+{{- $last := base $context.Template.Name }}
+{{- $wtf := $context.Template.Name | replace $last $name -}}
+{{ include $wtf $context }}
+{{- end -}}
+
+{{/*
+Render init container for coredump.
+*/}}
+{{- define "pfcp-agent.coredump_init" -}}
+{{- $pod := index . 0 -}}
+{{- $context := index . 1 -}}
+- name: {{ $pod }}-coredump-init
+  image: {{ $context.Values.images.tags.init | quote }}
+  imagePullPolicy: {{ $context.Values.images.pullPolicy }}
+  securityContext:
+    privileged: true
+    runAsUser: 0
+  command: ["sh", "-xc"]
+  args:
+    - echo '/tmp/coredump/core.%h.%e.%t' > /mnt/host-rootfs/proc/sys/kernel/core_pattern
+  volumeMounts:
+    - name: host-rootfs
+      mountPath: /mnt/host-rootfs
+{{- end -}}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "pfcp-agent.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/pfcp-agent/templates/configmap-pfcp-agent.yaml b/pfcp-agent/templates/configmap-pfcp-agent.yaml
new file mode 100644
index 0000000..f8f2bb0
--- /dev/null
+++ b/pfcp-agent/templates/configmap-pfcp-agent.yaml
@@ -0,0 +1,17 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "pfcp-agent.fullname" . }}
+  labels:
+{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 4 }}
+data:
+{{- range $key, $value := .Values.config.pfcp.cfgFiles }}
+  {{ $key }}: {{ toJson $value | quote }}
+{{- end }}
diff --git a/pfcp-agent/templates/service-pfcp-agent.yaml b/pfcp-agent/templates/service-pfcp-agent.yaml
new file mode 100644
index 0000000..a525c2d
--- /dev/null
+++ b/pfcp-agent/templates/service-pfcp-agent.yaml
@@ -0,0 +1,29 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "pfcp-agent.fullname" . }}
+  labels:
+{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 4 }}
+{{- with .Values.service.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+{{- end }}
+spec:
+  type: {{ .Values.service.type }}
+{{- if .Values.service.externalIp }}
+  externalIPs:
+    - {{ .Values.service.externalIp }}
+{{- end }}
+  selector:
+{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 4 }}
+  ports:
+  - name: pfcp
+    port: 8805
+    protocol: UDP
diff --git a/pfcp-agent/templates/statefulset-pfcp-agent.yaml b/pfcp-agent/templates/statefulset-pfcp-agent.yaml
new file mode 100644
index 0000000..d4aaa6a
--- /dev/null
+++ b/pfcp-agent/templates/statefulset-pfcp-agent.yaml
@@ -0,0 +1,73 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- $upfConfig := index .Values.config.pfcp.cfgFiles "upf.json" }}
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: {{ include "pfcp-agent.fullname" . }}
+  labels:
+{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 4 }}
+spec:
+  replicas: 1
+  serviceName: pfcp-headless
+  selector:
+    matchLabels:
+{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 6 }}
+  template:
+    metadata:
+      labels:
+{{ tuple "pfcp" . | include "pfcp-agent.metadata_labels" | indent 8 }}
+    spec:
+      shareProcessNamespace: true
+    {{- if .Values.nodeSelectors.enabled }}
+      nodeSelector:
+        {{ .Values.nodeSelectors.pfcp.label }}: {{ .Values.nodeSelectors.pfcp.value }}
+    {{- end }}
+    {{- if .Values.images.pullSecrets }}
+      imagePullSecrets:
+        {{- range .Values.images.pullSecrets }}
+        - name: {{ . | quote }}
+        {{- end }}
+    {{- end }}
+    {{- if .Values.config.coreDump.enabled }}
+      initContainers:
+{{ tuple "pfcp" . | include "pfcp-agent.coredump_init" | indent 8 }}
+    {{- end }}
+      containers:
+      - name: {{ include "pfcp-agent.fullname" . }}
+        image: {{ .Values.images.tags.pfcpiface | quote }}
+        imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
+        env:
+        - name: POD_IP
+          valueFrom:
+            fieldRef:
+              fieldPath: status.podIP
+        command: ["pfcpiface"]
+        args:
+          - -config
+          - /tmp/conf/upf.json
+      {{- if .Values.resources.enabled }}
+        resources:
+{{ toYaml .Values.resources.pfcpiface | indent 10 }}
+      {{- end }}
+        volumeMounts:
+          - name: configs
+            mountPath: /tmp/conf
+      volumes:
+      - name: configs
+        configMap:
+          name: {{ include "pfcp-agent.fullname" . }}
+          defaultMode: 493
+    {{- if .Values.config.coreDump.enabled }}
+      - name: host-rootfs
+        hostPath:
+          path: /
+      - name: coredump
+        hostPath:
+          path: {{ .Values.config.coreDump.path }}
+    {{- end }}
diff --git a/pfcp-agent/values.yaml b/pfcp-agent/values.yaml
new file mode 100644
index 0000000..ac42a93
--- /dev/null
+++ b/pfcp-agent/values.yaml
@@ -0,0 +1,46 @@
+# Copyright 2020-present Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+images:
+  tags:
+    init: registry.aetherproject.org/tools/busybox:stable
+    pfcpiface: "registry.aetherproject.org/proxy/omecproject/upf-epc-pfcpiface:master-fcdbc95"
+  pullPolicy: Always
+  # Secrets must be manually created in the namespace.
+  pullSecrets:
+    - "aether.registry"
+
+nodeSelectors:
+  enabled: false
+  pfcp:
+    label: omec-upf
+    value: enabled
+
+resources:
+  enabled: true
+  pfcpiface:
+    requests:
+      cpu: 256m
+      memory: 128Mi
+    limits:
+      cpu: 256m
+      memory: 128Mi
+
+config:
+  coreDump:
+    enabled: false
+    path: /tmp/coredump
+  pfcp:
+    cfgFiles:
+      upf.json:
+        measure: true
+        enable_p4rt: true
+        p4rtciface:
+          access_ip: "172.17.0.1/32"
+          p4rtc_server: "sdfabric-onos-classic-hs.sdfabric"
+          p4rtc_port: "51001"
+service:
+  type: ClusterIP
+  #externalIp:
+  #annotations:
diff --git a/sdfabric/Chart.yaml b/sdfabric/Chart.yaml
index 0c7d0c1..1647a9c 100644
--- a/sdfabric/Chart.yaml
+++ b/sdfabric/Chart.yaml
@@ -7,7 +7,7 @@
 description: A chart to deploy all SD-Fabric components
 kubeVersion: ">=1.18.0"
 type: application
-version: 1.0.0
+version: 1.0.1
 keywords:
   - aether
   - sdn
@@ -23,3 +23,11 @@
   - name: stratum
     repository: https://charts.stratumproject.org/
     version: 0.1.13
+  - name: pfcp-agent
+    repository: file://../pfcp-agent
+    version: 0.0.1
+    condition: import.pfcp-agent.enabled
+  - name: dbuf
+    repository: file://../dbuf
+    version: 0.0.1
+    condition: import.dbuf.enabled
diff --git a/sdfabric/README.md b/sdfabric/README.md
index a7398d7..ea558e9 100644
--- a/sdfabric/README.md
+++ b/sdfabric/README.md
@@ -15,19 +15,39 @@
 
 | Name | Description |
 |------|-------------|
-| .Values.image.credential.secretName | Name for the Kubernetes secret to store the credential |
-| .Values.image.credential.registry | The container registry |
-| .Values.image.credential.username | The username to login the container registry |
-| .Values.image.credential.password | The password to login the container registry |
-| .Values.onos-classic | See <https://github.com/onosproject/onos-helm-charts/tree/master/onos-classic> |
-| .Values.stratum | See <https://github.com/stratum/stratum-helm-charts/tree/master/stratum> |
+| import.pfcp-agent.enabled | Enable PFCP agent |
+| import.dbuf.enabled | Enable DBuf |
+| image.credential.secretName | Name for the Kubernetes secret to store the credential |
+| image.credential.registry | The container registry |
+| image.credential.username | The username to login the container registry |
+| image.credential.password | The password to login the container registry |
+| onos-classic | See <https://github.com/onosproject/onos-helm-charts/tree/master/onos-classic> |
+| stratum | See <https://github.com/stratum/stratum-helm-charts/tree/master/stratum> |
+| pfcp-agent | See [values.yaml](../pfcp-agent/values.yaml) file of the PFCP agent chart |
+| dbuf | See [values.yaml](../dbuf/values.yaml) file of the DBuf chart |
 
 ## Installation
 
-Modify values.yaml according to the explanations above, then run the following command:
+Here are steps to deploy the sdfabric helm chart:
+
+1. Modify `values.yaml` according to the explanations above
+2. Use the following command to create a namespace `sdfabric`, :
+
+    ```bash
+    kubectl create namespace sdfabric
+    ```
+
+3. Use the helm command to deploy the chart:
+
+    ```bash
+    helm upgrade --install -n sdfabric -f my-values.yaml sdfabric .
+    ```
+
+This command will deploy the SD-Fabric helm chart with release name `sdfabric` in the `sdfabric` namesapce.
+
+To uninstall the helm chart, simply use:
 
 ```bash
-helm upgrade --install -f my-values.yaml sdfabric .
+helm -n sdfabric uninstall sdfabric
+kubectl delete namespace sdfabric # also remove the sdfabric if needed
 ```
-
-This command will deploy the SD-Fabric helm chart with release name `sdfabric` in the current context.
diff --git a/sdfabric/values.yaml b/sdfabric/values.yaml
index 74ba821..c44a1a5 100644
--- a/sdfabric/values.yaml
+++ b/sdfabric/values.yaml
@@ -9,6 +9,12 @@
     username: changeit
     password: changeit
 
+import:
+  pfcp-agent:
+    enabled: false
+  dbuf:
+    enabled: false
+
 onos-classic:
   image:
     repository: registry.aetherproject.org/tost/tost
@@ -90,8 +96,6 @@
     repository: stratumproject/stratum-bfrt
     tag: 21.09.24-9.5.0
     pullPolicy: IfNotPresent
-    pullSecrets:
-      - *image-secret-name
 
   annotations:
     fluentbit.io/parser: stratum
@@ -108,3 +112,98 @@
   #     value: switch
   #     effect: NoSchedule
   config: false
+
+pfcp-agent:
+  images:
+    tags:
+      init: registry.aetherproject.org/tools/busybox:stable
+      pfcpiface: "registry.aetherproject.org/proxy/omecproject/upf-epc-pfcpiface:master-fcdbc95"
+    pullPolicy: Always
+    pullSecrets:
+      - *image-secret-name
+  nodeSelectors:
+    enabled: false
+    pfcp:
+      label: omec-upf
+      value: enabled
+  resources:
+    enabled: true
+    pfcpiface:
+      requests:
+        cpu: 256m
+        memory: 128Mi
+      limits:
+        cpu: 256m
+        memory: 128Mi
+  config:
+    coreDump:
+      enabled: false
+      path: /tmp/coredump
+    pfcp:
+      cfgFiles:
+        upf.json:
+          measure: true
+          enable_p4rt: true
+          p4rtciface:
+            access_ip: "172.17.0.1/32"
+            p4rtc_server: "sdfabric-onos-classic-hs.sdfabric"
+            p4rtc_port: "51001"
+  service:
+    type: ClusterIP
+    #externalIp:
+    #annotations:
+
+dbuf:
+  image:
+    repository: registry.aetherproject.org/tost/dbuf
+    pullPolicy: Always
+    tag: "latest"
+    pullSecrets:
+      - *image-secret-name
+  extraParams:
+    - '"-max_queues=1024"'
+  replicaCount: 1
+  sriovNICSize: 1
+  sriovResourceName: intel_sriov_netdevice
+  # Change both in the same time
+  multusNetworkName: dbuf-sriov
+  podAnnotations:
+    k8s.v1.cni.cncf.io/networks: dbuf-sriov@net0
+  podSecurityContext: {}
+  resources:
+    requests:
+      intel.com/intel_sriov_netdevice: "1"
+    limits:
+      intel.com/intel_sriov_netdevice: "1"
+  nodeSelector: {}
+  tolerations: []
+  affinity: {}
+  # onos inforamtion
+  onos:
+    server: sdfabric-onos-classic-hs.sdfabric
+    port: 8181
+    username: onos
+    password: rocks
+  dataplane:
+    port: 2152
+    interface: "net0"
+  prometheus_enable: true
+  service:
+    stats:
+      port: 8080
+      protocol: TCP
+    grpc:
+      port: 10000
+      protocol: TCP
+  # two options for ipam, dhcp or host-local
+  # static is for host-local ipam
+  network:
+    #  ipam: dhcp
+    ipam: host-local
+    static:
+      subnets: "10.56.217.0/24"
+      gateway: "10.56.217.1"
+    # route the following subnets via sr-iov interface
+    # route: 10.56.215.0/24,10.56.214.0/24
+    route: ""
+    #vlan:
\ No newline at end of file