Skip to content

Commit

Permalink
Update install.sh to allow dpdk limits configuration (#546)
Browse files Browse the repository at this point in the history
(cherry picked from commit d41110e)
  • Loading branch information
emmakenny authored and oilbeater committed Nov 18, 2020
1 parent 9663638 commit f6ff278
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ VLAN_RANGE="1,4095"
DPDK="false"
DPDK_SUPPORTED_VERSIONS=("19.11")
DPDK_VERSION=""
DPDK_CPU="1000m" # Default CPU configuration for if --dpdk-cpu flag is not included
DPDK_MEMORY="2Gi" # Default Memory configuration for it --dpdk-memory flag is not included

display_help() {
echo "Usage: $0 [option...]"
echo
echo " -h, --help Print Help (this message) and exit"
echo " --with-dpdk=<version> Install Kube-OVN with OVS-DPDK instead of kernel OVS"
echo " --dpdk-cpu=<amount>m Configure DPDK to use a specific amount of CPU"
echo " --dpdk-memory=<amount>Gi Configure DPDK to use a specific amount of memory"
echo
exit 0
}
Expand All @@ -66,6 +70,26 @@ then
exit 1
fi
;;
--dpdk-cpu=*)
DPDK_CPU="${1#*=}"
if [[ $DPDK_CPU =~ ^[0-9]+(m)$ ]]
then
echo "CPU $DPDK_CPU"
else
echo "$DPDK_CPU is not valid, please use the format --dpdk-cpu=<amount>m"
exit 1
fi
;;
--dpdk-memory=*)
DPDK_MEMORY="${1#*=}"
if [[ $DPDK_MEMORY =~ ^[0-9]+(Gi)$ ]]
then
echo "MEMORY $DPDK_MEMORY"
else
echo "$DPDK_MEMORY is not valid, please use the format --dpdk-memory=<amount>Gi"
exit 1
fi
;;
-?*)
echo "Unknown argument $1"
exit 1
Expand Down Expand Up @@ -708,11 +732,11 @@ spec:
timeoutSeconds: 45
resources:
requests:
cpu: 500m
memory: 2Gi
cpu: $DPDK_CPU
memory: $DPDK_MEMORY
limits:
cpu: 1000m
memory: 2Gi
cpu: $DPDK_CPU
memory: $DPDK_MEMORY
hugepages-1Gi: 1Gi
nodeSelector:
kubernetes.io/os: "linux"
Expand Down

0 comments on commit f6ff278

Please sign in to comment.