So I'm running the activemq-artemis-operator from artemiscloud in minikube, and it works but I'd like to monitor the jolokia externally.
So according to the docs,
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: artemis-broker
spec:
deploymentPlan:
enableMetricsPlugin: true
console:
expose: true
ingressHost: myhost.local
This should expose the console at /console/jolokia
However, looking inside the artemis-broker-ss-0
pod,
bootstrap.xml
contains:
<binding sniHostCheck="false" sniRequired="false" name="artemis" uri="http://artemis-broker-ss-0.artemis-broker-hdls-svc.activemq-artemis-operator.svc.cluster.local:8161">
and jolokia-access.xml
contains:
<allow-origin>*://artemis-broker-ss-0.artemis-broker-hdls-svc.activemq-artemis-operator.svc.cluster.local*</allow-origin>
So the logs say:
AMQ241002: Artemis Jolokia REST API available at http://artemis-broker-ss-0.artemis-broker-hdls-svc.activemq-artemis-operator.svc.cluster.local:8161/console/jolokia
If I go into the pod,
sh-4.4$ curl http://localhost:8161/console/jolokia
curl: (7) Failed to connect to localhost port 8161: Connection refused
sh-4.4$ curl http://$(hostname -f):8161/console/jolokia
sh-4.4$ curl http://artemis-broker-ss-0.artemis-broker-hdls-svc.activemq-artemis-operator.svc.cluster.local:8161/console/jolokia
sh-4.4$
I can't access it however I try.
Ideally I would like to start it up so that the console is accessible (rather than messing around with restarting pods).
Does anyone know how to do this? Is there an official way?
The curl command is failing because the path `console/jolokia` is not accessible, indeed the server response is 403:
$ curl -v http://$(hostname -f):8161/console/jolokia
* Trying 10.244.3.80:8161...
* Connected to artemis-broker-ss-0.artemis-broker-hdls-svc.default.svc.cluster.local (10.244.3.80) port 8161 (#0)
> GET /console/jolokia HTTP/1.1
> Host: artemis-broker-ss-0.artemis-broker-hdls-svc.default.svc.cluster.local:8161
> User-Agent: curl/7.76.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 403 Forbidden
...
Try the following command from inside the broker pod to get the status:
$ curl -u $AMQ_USER:$AMQ_PASSWORD http://$HOSTNAME:8161/console/jolokia/read/org.apache.activemq.artemis:broker=%22amq-broker%22/Status
{"request":{"mbean":"org.apache.activemq.artemis:broker=\"amq-broker\"","attribute":"Status","type":"read"},"value":"{\"configuration\":{\"properties\":{\"broker.properties\":{\"alder32\":\"1\"},\"system-brokerconfig.\":{\"alder32\":\"1\"}}},\"server\":{\"jaas\":{\"properties\":{\"artemis-users.properties\":{\"reloadTime\":\"1746180838134\",\"Alder32\":\"3043897467\"},\"artemis-roles.properties\":{\"reloadTime\":\"1746180838134\",\"Alder32\":\"670893345\"}}},\"state\":\"STARTED\",\"version\":\"2.40.0\",\"nodeId\":\"24de017d-273e-11f0-9105-424f9f10f457\",\"identity\":null,\"uptime\":\"31 minutes\"}}","status":200}