From 793b28ae206d33f4010a88fb937b2e60de36d94a Mon Sep 17 00:00:00 2001 From: Alexandre-P Date: Sun, 13 Sep 2020 20:22:59 +0200 Subject: [PATCH] [stable/hlf-peer] Fix metrics configuration (#23752) Signed-off-by: AlexandrePicosson --- stable/hlf-peer/Chart.yaml | 2 +- stable/hlf-peer/README.md | 2 +- stable/hlf-peer/templates/configmap--peer.yaml | 7 +++++-- stable/hlf-peer/templates/deployment.yaml | 5 +++++ stable/hlf-peer/templates/service.yaml | 6 ++++++ stable/hlf-peer/values.yaml | 3 +-- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/stable/hlf-peer/Chart.yaml b/stable/hlf-peer/Chart.yaml index ee19a59ac7..1fcfbd5a88 100644 --- a/stable/hlf-peer/Chart.yaml +++ b/stable/hlf-peer/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Hyperledger Fabric Peer chart (these charts are created by AID:Tech and are currently not directly associated with the Hyperledger project) name: hlf-peer -version: 1.6.0 +version: 1.6.1 appVersion: 1.4.3 keywords: - blockchain diff --git a/stable/hlf-peer/README.md b/stable/hlf-peer/README.md index b5d5d72b19..12ab1d7cff 100644 --- a/stable/hlf-peer/README.md +++ b/stable/hlf-peer/README.md @@ -78,6 +78,7 @@ The following table lists the configurable parameters of the Hyperledger Fabric | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `service.portRequest` | TCP port for requests to Peer | `7051` | | `service.portEvent` | TCP port for event service on Peer | `7053` | +| `service.portMetrics` | TCP port for the metrics service on Peer | `9443` | | `service.type` | K8S service type exposing ports, e.g. `ClusterIP` | `ClusterIP` | | `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | | `persistence.annotations` | Persistent Volume annotations | `{}` | @@ -113,7 +114,6 @@ The following table lists the configurable parameters of the Hyperledger Fabric | `peer.chaincode.runtime.golang` | Image of the chaincode runtime for Go | `` | | `peer.chaincode.runtime.java` | Image of the chaincode runtime for Java | `` | | `peer.chaincode.runtime.node` | Image of the chaincode runtime for Node.js | `` | -| `peer.operations.listenAddress` | Host and port for the operations server | `` | | `peer.metrics.provider` | Metrics provider, can be `statsd`, `prometheus`, or `disabled` | `disabled` | | `peer.metrics.statsd.network` | Network type, can be `tcp` or `udp` | `udp` | | `peer.metrics.statsd.address` | Address of the StatsD server | `127.0.0.1:8125` | diff --git a/stable/hlf-peer/templates/configmap--peer.yaml b/stable/hlf-peer/templates/configmap--peer.yaml index 4df01f68f5..07d9dc9759 100644 --- a/stable/hlf-peer/templates/configmap--peer.yaml +++ b/stable/hlf-peer/templates/configmap--peer.yaml @@ -82,8 +82,11 @@ data: ############## # Operations # ############## - {{- if .Values.peer.operations.listenAddress }} - CORE_OPERATIONS_LISTENADDRESS: {{ .Values.peer.operations.listenAddress | quote }} + {{- if eq .Values.peer.metrics.provider "prometheus" }} + CORE_OPERATIONS_LISTENADDRESS: 0.0.0.0:9443 + {{- end }} + {{- if eq .Values.peer.metrics.provider "statsd" }} + CORE_OPERATIONS_LISTENADDRESS: 127.0.0.1:8125 {{- end }} ########### # Metrics # diff --git a/stable/hlf-peer/templates/deployment.yaml b/stable/hlf-peer/templates/deployment.yaml index edbafc5cc9..1fa4159a34 100644 --- a/stable/hlf-peer/templates/deployment.yaml +++ b/stable/hlf-peer/templates/deployment.yaml @@ -111,6 +111,11 @@ spec: - name: event containerPort: 7053 protocol: TCP + {{- if eq .Values.peer.metrics.provider "prometheus" }} + - name: metrics + containerPort: 9443 + protocol: TCP + {{- end }} livenessProbe: exec: command: diff --git a/stable/hlf-peer/templates/service.yaml b/stable/hlf-peer/templates/service.yaml index 8f1d7a3338..5a15ea3829 100644 --- a/stable/hlf-peer/templates/service.yaml +++ b/stable/hlf-peer/templates/service.yaml @@ -15,6 +15,12 @@ spec: targetPort: 7053 protocol: TCP name: event + {{- if eq .Values.peer.metrics.provider "prometheus" }} + - port: {{ .Values.service.portMetrics }} + targetPort: 9443 + protocol: TCP + name: metrics + {{- end }} selector: app: {{ include "hlf-peer.name" . }} release: {{ .Release.Name }} diff --git a/stable/hlf-peer/values.yaml b/stable/hlf-peer/values.yaml index cde014a208..f3933168f1 100644 --- a/stable/hlf-peer/values.yaml +++ b/stable/hlf-peer/values.yaml @@ -12,6 +12,7 @@ service: type: ClusterIP portRequest: 7051 portEvent: 7053 + portMetrics: 9443 # Path of the docker socket on the host dockerSocketPath: /var/run/docker.sock @@ -89,8 +90,6 @@ peer: golang: "" java: "" node: "" - operations: - listenAddress: "" metrics: provider: "disabled" statsd: