apiVersion: v1
kind: Pod
metadata:
  name: iperf
  labels:
     app: test-master
spec:
  containers:
    - name: test-master-container
      image: docker.local:5000/test
      command: ["role.sh"]
      args: ["master"]

######################################
apiVersion: apps/v1
kind: Deployment
metadata:
  name: iperf-server
  labels:
    app: iperf
spec:
  replicas: 1
  selector:
    matchLabels:
      app: iperf-server
  template:
    metadata:
      labels:
        app: iperf-server
    spec:
      containers:
        - name: cloud-bandwidth-netperf
          image: quay.io/networkstatic/cloud-bandwidth
          env:
            - name: CBANDWIDTH_PERF_SERVERS
              value: "10.42.3.3:cluster-a"
            - name: CBANDWIDTH_PERF_SERVER_PORT
              value: "5201"
            - name: CBANDWIDTH_POLL_INTERVAL
              value: "300"
            - name: CBANDWIDTH_POLL_LENGTH
              value: "5"
            - name: CBANDWIDTH_DOWNLOAD_PREFIX
              value: "bandwidth.download"
            - name: CBANDWIDTH_UPLOAD_PREFIX
              value: "bandwidth.upload"
            - name: CBANDWIDTH_GRAFANA_ADDRESS
              value: "192.168.122.1"
            - name: CBANDWIDTH_GRAFANA_PORT
              value: "2003"
          securityContext:
            allowPrivilegeEscalation: true
            privileged: true
          command: ["/bin/sh","-c"]
          args:
          - |
            while true; do
              ./cloud-bandwidth -perf-servers $CBANDWIDTH_PERF_SERVERS \
                -perf-server-port $CBANDWIDTH_PERF_SERVER_PORT \
                -test-interval $CBANDWIDTH_POLL_INTERVAL \
                -test-length $CBANDWIDTH_POLL_LENGTH \
                -tsdb-download-prefix $CBANDWIDTH_DOWNLOAD_PREFIX \
                -tsdb-upload-prefix $CBANDWIDTH_UPLOAD_PREFIX \
                -grafana-address $CBANDWIDTH_GRAFANA_ADDRESS \
                -grafana-port $CBANDWIDTH_GRAFANA_PORT \
                -nocontainer \
                -debug;
            done
      terminationGracePeriodSeconds: 60