Closed micst closed 3 years ago
Have you tried using a different version of the plugin? Same behavior in that case?
My fault, everything works fine. I just found out yesterday. We extend the original docker image from jboss/keycloak
to add the metrics listener to avoid complex init container configuration like this:
# install prometheus metrics provider
ENV providerProjectUrl https://github.com/aerogear/keycloak-metrics-spi
ENV providerVersion 2.1.0
ENV providerFileName keycloak-metrics-spi-${providerVersion}.jar
ENV providerFileUrl ${providerProjectUrl}/releases/download/${providerVersion}/${providerFileName}
RUN echo "=== installing metric provider ===" \
&& cd /opt/jboss/keycloak/standalone/deployments \
&& curl -s -k -L --output ${providerFileName} ${providerFileUrl} \
&& touch ${providerFileName}.dodeploy
I was missing the -L
parameter in the curl command, got no error and saw that something was downloaded. Never checked if the downloaded file actually was a real .jar
. It was not obviously. It was some html code telling me I hit a redirect. Simply adding -L
to the curl command line fixed everything.
Sorry for any inconvenience and thanks for the answer!
Got the same issue with using the init container and wget
if you use helm of codecentric this is an exemple which work:
extraInitContainers: |
- name: download-metric-spi
image: curlimages/curl:latest
command:
- 'sh'
args:
- -c
- |
curl -s -k -L --output /metrics/keycloak-metrics-spi-2.1.0.jar https://github.com/aerogear/keycloak-metrics-spi/releases/download/2.1.0/keycloak-metrics-spi-2.1.0.jar
touch /metrics/keycloak-metrics-spi-2.1.0.jar.dodeploy
volumeMounts:
- name: metrics
mountPath: /metrics
extraVolumes: |
- name: metrics
emptyDir: {}
extraVolumeMounts: |
- name: metrics
mountPath: /opt/jboss/keycloak/standalone/deployments/
We have a HA deployment in kuberenetes, the keycloak docker image is adapted to include the metrics jar file. When starting up I get the following log messages:
Any Ideas how I could solve this?