Created
June 15, 2020 12:14
-
-
Save jianzzha/db0442d51030a5060bd037d1f0420e63 to your computer and use it in GitHub Desktop.
uperf test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: uperf-master | |
spec: | |
restartPolicy: Never | |
#hostNetwork: true | |
containers: | |
- name: uperf-master | |
image: cscojianzhan/container-perf-tools | |
env: | |
- name: GIT_URL | |
value: https://github.com/jianzzha/container-tools.git | |
- name: tool | |
value: uperf | |
- name: mode | |
value: master | |
- name: uperfSlave | |
value: $slave | |
- name: size | |
value: "1024" | |
- name: threads | |
value: "1" | |
securityContext: | |
privileged: true | |
nodeSelector: | |
kubernetes.io/hostname: "worker0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: uperf-slave | |
spec: | |
restartPolicy: Never | |
#hostNetwork: true | |
containers: | |
- name: uperf-slave | |
image: cscojianzhan/container-perf-tools | |
ports: | |
- containerPort: 20000 | |
env: | |
- name: GIT_URL | |
value: https://github.com/jianzzha/container-tools.git | |
- name: tool | |
value: uperf | |
- name: mode | |
value: slave | |
securityContext: | |
privileged: true | |
nodeSelector: | |
kubernetes.io/hostname: "worker1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
if ! oc get pod uperf-slave 1>&2 2>/dev/null; then | |
oc create -f pod-uperf-slave.yaml | |
fi | |
oc delete pod uperf-master 2>/dev/null | |
while true; do | |
status=$(oc get pods uperf-slave -o json | jq -r '.status.phase') | |
if [[ "${status}" == "Running" ]]; then | |
break | |
fi | |
sleep 5s | |
done | |
export slave=$(oc get pods uperf-slave -o json | jq -r '.status.podIP') | |
envsubst < pod-uperf-master.yaml | oc create -f - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/jianzzha/container-tools/tree/master/uperf | |
when sriov is enabled, the pod will have multiple interfaces, to select the sriov interface for the test, you may want to | |
change the test script to identify the sriov ip address used by the uperf slave pod. Right now the slave pod default | |
ip address is used in the script: slave=$(oc get pods uperf-slave -o json | jq -r '.status.podIP') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment