diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index 47a802cbce73..a6a00a5f88f7 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -10,6 +10,10 @@ internal API changes are not present. Unreleased ---------- +### Features + +- Allow setting nodePort for service. (@ryayon) + 0.36.0 (2024-02-27) ------------------- diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index f1ea72470654..51ea7498b654 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -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. | diff --git a/operations/helm/charts/grafana-agent/templates/service.yaml b/operations/helm/charts/grafana-agent/templates/service.yaml index a3180d4715ab..34427f822ac0 100644 --- a/operations/helm/charts/grafana-agent/templates/service.yaml +++ b/operations/helm/charts/grafana-agent/templates/service.yaml @@ -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" diff --git a/operations/helm/charts/grafana-agent/values.yaml b/operations/helm/charts/grafana-agent/values.yaml index d481ae0ab290..588274fa05be 100644 --- a/operations/helm/charts/grafana-agent/values.yaml +++ b/operations/helm/charts/grafana-agent/values.yaml @@ -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'