Skip to content

Commit 1920330

Browse files
authored
kubectl rabbitmq manage command now supports TLS (#628)
Previously 15672 was always used to access Management. Now, the plugin will check if the instances is TLS enabled and if it is, it will use 15671.
1 parent e4d57d5 commit 1920330

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bin/kubectl-rabbitmq

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,20 @@ perf_test() {
138138
manage() {
139139
get_instance_details "$@"
140140

141+
TLS="$(kubectl $NAMESPACE get service ${service} -o jsonpath='{.spec.ports[?(@.name=="management-tls")]}')"
142+
if [[ -n "$TLS" ]]; then
143+
MGMT_PORT=15671
144+
MGMT_URL="https://localhost:$MGMT_PORT/"
145+
146+
else
147+
MGMT_PORT=15672
148+
MGMT_URL="http://localhost:$MGMT_PORT/"
149+
fi
141150
(
142151
sleep 2
143-
open "http://localhost:15672/"
152+
open "$MGMT_URL"
144153
) &
145-
kubectl ${NAMESPACE} port-forward "service/${service}" 15672
154+
kubectl ${NAMESPACE} port-forward "service/${service}" $MGMT_PORT
146155
}
147156

148157
list_rabbitmq_clusters() {

0 commit comments

Comments
 (0)