Skip to content
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

[kube-prometheus-stack] How to change Prometheus default port (9090) #5266

Open
nessrinehaf opened this issue Feb 3, 2025 · 1 comment
Open

Comments

@nessrinehaf
Copy link

Hello,

I've been trying to change my port to 9091 since 9090 is used but i get container with 2 ports:

Image

what i did:
add to values:
containers:
- name: prometheus
ports:
- name: http-web
containerPort: 9091
protocol: TCP

or update the helm chart: --set prometheus.service.port=9091
--set prometheus.prometheusSpec.containers[0].name=prometheus
--set prometheus.prometheusSpec.containers[0].ports[0].containerPort=9091
--set prometheus.prometheusSpec.containers[0].ports[0].name=http-web
--set prometheus.prometheusSpec.containers[0].ports[0].protocol=TCP

Still same. Can you please give me a tip to change it?

@zeritti zeritti changed the title How to change Prometheus default port (9090) when installing chart Kube Prometheus stack [kube-prometheus-stack] How to change Prometheus default port (9090) Feb 9, 2025
@zeritti
Copy link
Contributor

zeritti commented Feb 9, 2025

I doubt changing the port is currently possible and I am sure Prometheus operator sets and expects exactly that number. Other than that, a strategic merge patch, supported by the operator, follows the field's patch strategy:

With a strategic merge patch, a list is either replaced or merged depending on its patch strategy. The patch strategy is specified by the value of the patchStrategy key in a field tag in the Kubernetes source code.

ContainerPort has the patch strategy merge on patch merge key containerPort. This is why you see another element in the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants