-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat: area/helm: Modify helm template to use http_listen_port and grpc_listen_port instead of hardcoded value #11646
Conversation
…ten_port Signed-off-by: Sheikh-Abubaker <[email protected]>
Signed-off-by: Sheikh-Abubaker <[email protected]>
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.
Is it working for you?
My loki-read pod is stuck in an endless list of errors:
level=warn ts=2024-01-11T08:43:57.902636597Z caller=scheduler_processor.go:98 msg="error contacting scheduler" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 172.28.12.169:9095: connect: connection refused\"" addr=172.28.12.169:9095
level=warn ts=2024-01-11T08:43:57.985055672Z caller=scheduler_processor.go:98 msg="error contacting scheduler" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 172.28.12.169:9095: connect: connection refused\"" addr=172.28.12.169:9095
level=error ts=2024-01-11T08:43:58.268012236Z caller=frontend_scheduler_worker.go:237 msg="error contacting scheduler" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 172.28.12.169:9095: connect: connection refused\"" addr=172.28.12.169:9095
level=error ts=2024-01-11T08:43:58.619265229Z caller=frontend_scheduler_worker.go:237 msg="error contacting scheduler" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 172.28.12.169:9095: connect: connection refused\"" addr=172.28.12.169:9095
level=warn ts=2024-01-11T08:43:59.015424721Z caller=scheduler_processor.go:98 msg="error contacting scheduler" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 172.28.12.169:9095: connect: connection refused\"" addr=172.28.12.169:9095
level=warn ts=2024-01-11T08:43:59.171403506Z caller=scheduler_processor.go:98 msg="error contacting scheduler" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 172.28.12.169:9095: connect: connection refused\"" addr=172.28.12.169:9095
level=warn ts=2024-01-11T08:43:59.206568576Z caller=scheduler_processor.go:98 msg="error contacting scheduler" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 172.28.12.169:9095: connect: connection refused\"" addr=172.28.12.169:9095
The 172.28.12.169
address is the backend pod address.
There are many more places where we need to edit hardcoded values. I'll open a PR to your personal branch.
Edit: PR ready here: Sheikh-Abubaker#1. Already tested to be working fine.
The memberlist port is still hardcoded to 7946
(grep for it in the helm templates) though.
production/helm/loki/CHANGELOG.md
Outdated
@@ -13,6 +13,10 @@ Entries should include a reference to the pull request that introduced the chang | |||
|
|||
[//]: # (<AUTOMATED_UPDATES_LOCATOR> : do not remove this line. This locator is used by the CI pipeline to automatically create a changelog entry for each new Loki release. Add other chart versions and respective changelog entries bellow this line.) | |||
|
|||
## 5.41.6 | |||
|
|||
- [ENHANCEMENT] Modified helm template to use parameters http_listen_port and grpc_listen_port instead of hardcoded value of 3100 and 9095. |
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.
- [ENHANCEMENT] Modified helm template to use parameters http_listen_port and grpc_listen_port instead of hardcoded value of 3100 and 9095. | |
- [ENHANCEMENT] Modified helm template to use parameters http_listen_port and grpc_listen_port instead of hardcoded values. |
@@ -14,11 +14,11 @@ spec: | |||
publishNotReadyAddresses: true | |||
ports: | |||
- name: http-metrics | |||
port: 3100 | |||
port: {{ .Values.loki.server.http_listen_port | default 3100 }} |
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.
port: {{ .Values.loki.server.http_listen_port | default 3100 }} | |
port: {{ .Values.loki.server.http_listen_port }} |
No need to set defaults here too, if the user didn't specify the value, helm will use the default from the values.yaml provided by the helm chart, so that resolves to {{ 3100 | default 3100 }}
.
This means that there are less "magic numbers" defined across the helm chart, and if the default values will need to be changed in the future they could be changed only in the values.yaml and it would be updated everywhere immediately.
targetPort: http-metrics | ||
protocol: TCP | ||
- name: grpc | ||
port: 9095 | ||
port: {{ .Values.loki.server.grpc_listen_port | default 9095 }} |
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.
port: {{ .Values.loki.server.grpc_listen_port | default 9095 }} | |
port: {{ .Values.loki.server.grpc_listen_port }} |
@@ -28,11 +28,11 @@ spec: | |||
clusterIP: None | |||
ports: | |||
- name: http-metrics | |||
port: 3100 | |||
port: {{ .Values.loki.server.http_listen_port | default 3100 }} |
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.
port: {{ .Values.loki.server.http_listen_port | default 3100 }} | |
port: {{ .Values.loki.server.http_listen_port }} |
targetPort: http-metrics | ||
protocol: TCP | ||
- name: grpc | ||
port: 9095 | ||
port: {{ .Values.loki.server.grpc_listen_port | default 9095 }} |
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.
port: {{ .Values.loki.server.grpc_listen_port | default 9095 }} | |
port: {{ .Values.loki.server.grpc_listen_port }} |
…ki_server_ports [helm] Replace all hardcoded loki server ports
…into http-grpc-pr
Signed-off-by: Sheikh-Abubaker <[email protected]>
The problem with that port number is that there is currently no variable in the helm values that defines the port, so the default port is hardcoded everywhere: if you From the loki docs it seems it can be set with the following variable:
In the values file we can define values to be set in the memberlist section of the config. Therefore I added to my values the following:
And the value shows up correctly in the configmap:
And loki seems to read it without any issue:
But the pods are not obeying it somehow:
For this reason I'd open a separate issue. If you find a solution ping me in the new PR and I'll happily test it! |
@bebosudo I'm onto completing the above memberlist port task |
I'd discourage putting the memberlist port task change in this PR: these are different changes and it'd be better fixing them in different PRs. |
@bebosudo okk, is there anything I'm supposed to do for this PR ? |
Nope, it's ready for review by a maintainer :-) |
Signed-off-by: Sheikh-Abubaker <[email protected]>
…into http-grpc-pr
It was great working with you, looking forward to connecting. resolving issues and opening more PR's together :-) |
…into http-grpc-pr
Signed-off-by: Sheikh-Abubaker <[email protected]>
…into http-grpc-pr
Signed-off-by: Sheikh-Abubaker <[email protected]>
…into http-grpc-pr
…into http-grpc-pr
…into http-grpc-pr
…into http-grpc-pr
Signed-off-by: Sheikh-Abubaker <[email protected]>
Signed-off-by: Sheikh-Abubaker <[email protected]>
…into http-grpc-pr
Signed-off-by: Sheikh-Abubaker <[email protected]>
Signed-off-by: Sheikh-Abubaker <[email protected]>
Signed-off-by: Sheikh-Abubaker <[email protected]>
…into http-grpc-pr
…into http-grpc-pr
…into http-grpc-pr
Signed-off-by: Sheikh-Abubaker <[email protected]>
Hey guys! I think this PR introduced an issue on the templates/monitoring/_helpers-monitoring.tpl.
If I overwrite the http_listen_port to "3100" (with quotes), then it works, but then the loki core fails with same error: want int instead of string. I manage to get it to work by using %v instead of %s. If using:
Ive been trying the single binary installation, here's my values: loki:
commonConfig:
replication_factor: 1
storage:
type: "filesystem"
singleBinary:
replicas: 1 |
@MaxThom Apologies, that did indeed cause a problem. The fix is here: #12242 |
…rpc_listen_port instead of hardcoded value (grafana#11646) Signed-off-by: Sheikh-Abubaker <[email protected]> Co-authored-by: Alberto Chiusole <[email protected]> Co-authored-by: Michel Hollands <[email protected]>
…rpc_listen_port instead of hardcoded value (grafana#11646) Signed-off-by: Sheikh-Abubaker <[email protected]> Co-authored-by: Alberto Chiusole <[email protected]> Co-authored-by: Michel Hollands <[email protected]>
What this PR does / why we need it:
This PR basically modifies helm template to use parameters http_listen_port and grpc_listen_port instead of hardcoded value to handle the cases where user assigns some other port other than default.
Which issue(s) this PR fixes:
Fixes #11641
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updatedadd-to-release-notes
labeldocs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR