-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Incorrect Kubernetes Port Annotation for Management Interface #40409
base: main
Are you sure you want to change the base?
Conversation
This commit addresses the issue where the `prometheus.io/port` annotation was incorrectly set to the main application server port instead of the management port when the management interface was enabled in a Quarkus application deployed to Kubernetes. Changes include: - Updated the `createAnnotations` method in the `KindProcessor` class to check if the management interface is enabled and if the annotation key is `"prometheus.io/port"`. - If both conditions are true, the method now produces a new `KubernetesAnnotationBuildItem` with the key `k`, the value `managementPort`, and the target `KIND`. - Otherwise, it produces a new `KubernetesAnnotationBuildItem` with the key `k`, the value `v`, and the target `KIND`. These changes ensure that the `prometheus.io/port` annotation is correctly set to the management port when the management interface is enabled.
@iocanel could you have a look at this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for taking a stub at it.
Is there a reason why this is specific to kind
. My understanding is that this is something that should be applied to all targets and not just kind. So, I think that a better place for this might be somewhere around here:
Line 1006 in b8e7635
metricsConfiguration.ifPresent(m -> { |
More specifically, I would just ensure that this line:
Line 1026 in b8e7635
config.getPrometheusConfig().port.orElse(prefix + "/port"), "" + port.get().getContainerPort(), |
Finally, we definitely need an integration test for this. Do let me know if you need a pointer for that.
@BrunoSena97 are you willing to pursue this? Thanks! |
@BrunoSena97 Are you having a look to @iocanel 's review? |
@iocanel What should be do here? Do we want this feature? |
@cescoffier: I think that we do. I would keep this open, just in case someone will pick this up. |
resolves #37904
Changes include:
createAnnotations
method in theKindProcessor
class to check if the management interface is enabled and if the annotation key is"prometheus.io/port"
.KubernetesAnnotationBuildItem
with the keyk
, the valuemanagementPort
, and the targetKIND
.KubernetesAnnotationBuildItem
with the keyk
, the valuev
, and the targetKIND
.