poc1027a

Young-Kyoo Kim·2025년 10월 27일
apiVersion: batch/v1
kind: Job
metadata:
  name: iperf-test
spec:
  completions: 4       # TARGET 개수
  parallelism: 4       # 동시에 실행할 개수
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: iperf-client
          image: networkstatic/iperf3
          command: ["/bin/sh", "-c"]
          args:
            - |
              TARGETS=("10.0.0.11" "10.0.0.12" "10.0.0.13" "10.0.0.14");
              TARGET=${TARGETS[$((JOB_COMPLETION_INDEX))]};
              echo "Testing $TARGET";
              iperf3 -c $TARGET -t 30 -J > /results/iperf_${TARGET}.json
          env:
            - name: JOB_COMPLETION_INDEX
              valueFrom:
                fieldRef:
                  fieldPath: metadata.annotations['batch.kubernetes.io/job-completion-index']
          volumeMounts:
            - name: results
              mountPath: /results
      volumes:
        - name: results
          emptyDir: {}

0개의 댓글