Skip to content

Commit

Permalink
[FEAT grafana#6416] nodePort value can be set now (grafana#6417)
Browse files Browse the repository at this point in the history
* [FEAT grafana#6416] nodePort value can be set now

* [FEAT grafana#6416] README fix

* [FEAT grafana#6416] test added

* [FEAT grafana#6416] tests have not been generated

---------

Co-authored-by: Paschalis Tsilias <[email protected]>
  • Loading branch information
ryayon and tpaschalis authored Mar 6, 2024
1 parent 734ec8c commit 5fb5395
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions operations/helm/charts/grafana-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ internal API changes are not present.
Unreleased
----------

### Features

- Allow setting nodePort for service. (@ryayon)

0.36.0 (2024-02-27)
-------------------

Expand Down
1 change: 1 addition & 0 deletions operations/helm/charts/grafana-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ use the older mode (called "static mode"), set the `agent.mode` value to
| service.clusterIP | string | `""` | Cluster IP, can be set to None, empty "" or an IP address |
| service.enabled | bool | `true` | Creates a Service for the controller's pods. |
| service.internalTrafficPolicy | string | `"Cluster"` | Value for internal traffic policy. 'Cluster' or 'Local' |
| service.nodePort | int | `31128` | NodePort port. Only takes effect when `service.type: NodePort` |
| service.type | string | `"ClusterIP"` | Service type |
| serviceAccount.additionalLabels | object | `{}` | Additional labels to add to the created service account. |
| serviceAccount.annotations | object | `{}` | Annotations to add to the created service account. |
Expand Down
3 changes: 3 additions & 0 deletions operations/helm/charts/grafana-agent/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
internalTrafficPolicy: {{.Values.service.internalTrafficPolicy}}
ports:
- name: http-metrics
{{- if eq .Values.service.type "NodePort" }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
port: {{ .Values.agent.listenPort }}
targetPort: {{ .Values.agent.listenPort }}
protocol: "TCP"
Expand Down
2 changes: 2 additions & 0 deletions operations/helm/charts/grafana-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ service:
enabled: true
# -- Service type
type: ClusterIP
# -- NodePort port. Only takes effect when `service.type: NodePort`
nodePort: 31128
# -- Cluster IP, can be set to None, empty "" or an IP address
clusterIP: ''
# -- Value for internal traffic policy. 'Cluster' or 'Local'
Expand Down

0 comments on commit 5fb5395

Please sign in to comment.