|
66 | 66 | List all instances that has the pause reconciliation label |
67 | 67 | kubectl rabbitmq [-n NAMESPACE | -A] list-pause-reconciliation-instances |
68 | 68 |
|
69 | | - Run perf-test against an instance - you can pass as many perf test parameters as you want |
| 69 | + Create a Job to run perf-test against an instance - you can pass as many perf test parameters as you want |
70 | 70 | (see https://rabbitmq.github.io/rabbitmq-perf-test/stable/htmlsingle/ for more details) |
71 | 71 | kubectl rabbitmq [-n NAMESPACE] perf-test INSTANCE --rate 100 |
72 | 72 | If you want to monitor perf-test, create the following ServiceMonitor: |
|
82 | 82 | matchLabels: |
83 | 83 | app: perf-test |
84 | 84 |
|
85 | | - Run stream-perf-test against an instance - you can pass as many stream perf test parameters as you want |
| 85 | + Create a job to run stream-perf-test against an instance - you can pass as many stream perf test parameters as you want |
86 | 86 | (see https://rabbitmq.github.io/rabbitmq-stream-java-client/snapshot/htmlsingle/ for more details) |
87 | 87 | kubectl rabbitmq [-n NAMESPACE] stream-perf-test INSTANCE --rate 100 |
88 | 88 |
|
@@ -130,27 +130,74 @@ get_instance_details() { |
130 | 130 | perf_test() { |
131 | 131 | get_instance_details "$@" |
132 | 132 | shift 1 |
133 | | - perftestopts=$* |
134 | | - |
135 | | - kubectl "$NAMESPACE" run perf-test \ |
136 | | - --expose=true \ |
137 | | - --port=8080 \ |
138 | | - --labels="app=perf-test,run=perf-test" \ |
139 | | - --image=pivotalrabbitmq/perf-test \ |
140 | | - -- --uri "amqp://${username}:${password}@${service}" \ |
141 | | - --metrics-prometheus "$perftestopts" |
| 133 | + |
| 134 | + local perf_test_job_file="perf-test.yml" |
| 135 | + set -u |
| 136 | + pushd "$(mktemp -d)" || exit 1 |
| 137 | + { |
| 138 | + echo "apiVersion: batch/v1" |
| 139 | + echo "kind: Job" |
| 140 | + echo "metadata:" |
| 141 | + echo " name: perf-test" |
| 142 | + echo " labels:" |
| 143 | + echo " app: perf-test" |
| 144 | + echo "spec:" |
| 145 | + echo " completions: 1" |
| 146 | + echo " ttlSecondsAfterFinished: 300" |
| 147 | + echo " template:" |
| 148 | + echo " spec:" |
| 149 | + echo " restartPolicy: Never" |
| 150 | + echo " containers:" |
| 151 | + echo " - name: rabbitmq-perf-test" |
| 152 | + echo " image: pivotalrabbitmq/perf-test" |
| 153 | + echo " ports:" |
| 154 | + echo " - containerPort: 8080" |
| 155 | + echo " args:" |
| 156 | + echo " - --uri" |
| 157 | + echo " - amqp://${username}:${password}@${service}" |
| 158 | + echo " - --metrics-prometheus" |
| 159 | + for arg in "$@"; do |
| 160 | + echo " - $arg" |
| 161 | + done |
| 162 | + } >"$perf_test_job_file" |
| 163 | + |
| 164 | + kubectl "$NAMESPACE" apply -f "$perf_test_job_file" |
| 165 | + popd |
142 | 166 | } |
143 | 167 |
|
144 | 168 | stream_perf_test() { |
145 | 169 | get_instance_details "$@" |
146 | 170 | shift 1 |
147 | | - streamperftestopts=$* |
148 | 171 |
|
149 | | - kubectl "$NAMESPACE" run stream-perf-test \ |
150 | | - --labels="app=stream-perf-test,run=stream-perf-test" \ |
151 | | - --image=pivotalrabbitmq/stream-perf-test \ |
152 | | - -- --uris "rabbitmq-stream://${username}:${password}@${service}" \ |
153 | | - "$streamperftestopts" |
| 172 | + local perf_test_job_file="stream-perf-test.yml" |
| 173 | + set -u |
| 174 | + pushd "$(mktemp -d)" || exit 1 |
| 175 | + { |
| 176 | + echo "apiVersion: batch/v1" |
| 177 | + echo "kind: Job" |
| 178 | + echo "metadata:" |
| 179 | + echo " name: stream-perf-test" |
| 180 | + echo " labels:" |
| 181 | + echo " app: stream-perf-test" |
| 182 | + echo "spec:" |
| 183 | + echo " completions: 1" |
| 184 | + echo " ttlSecondsAfterFinished: 300" |
| 185 | + echo " template:" |
| 186 | + echo " spec:" |
| 187 | + echo " restartPolicy: Never" |
| 188 | + echo " containers:" |
| 189 | + echo " - name: rabbitmq-stream-perf-test" |
| 190 | + echo " image: pivotalrabbitmq/stream-perf-test" |
| 191 | + echo " args:" |
| 192 | + echo " - --uris" |
| 193 | + echo " - stream://${username}:${password}@${service}" |
| 194 | + for arg in "$@"; do |
| 195 | + echo " - $arg" |
| 196 | + done |
| 197 | + } >"$perf_test_job_file" |
| 198 | + |
| 199 | + kubectl "$NAMESPACE" apply -f "$perf_test_job_file" |
| 200 | + popd |
154 | 201 | } |
155 | 202 |
|
156 | 203 | manage() { |
|
0 commit comments