From 64035bbe57c37b500fb58b8df4ff4eb9fd166b46 Mon Sep 17 00:00:00 2001 From: sam-at-luther Date: Fri, 27 Oct 2023 16:00:40 -0700 Subject: [PATCH] Make peer probes optional, set config path --- ansible-roles/k8s_fabric_peer/defaults/main.yml | 1 + .../files/fabric-peer/templates/deployment.yaml | 14 +++++++++++++- .../k8s_fabric_peer/files/fabric-peer/values.yaml | 2 ++ ansible-roles/k8s_fabric_peer/tasks/inner.yml | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ansible-roles/k8s_fabric_peer/defaults/main.yml b/ansible-roles/k8s_fabric_peer/defaults/main.yml index 22d3419..b6078f5 100644 --- a/ansible-roles/k8s_fabric_peer/defaults/main.yml +++ b/ansible-roles/k8s_fabric_peer/defaults/main.yml @@ -9,6 +9,7 @@ k8s_fabric_peer_namespace: fabric-{{k8s_fabric_peer_org}} k8s_fabric_peer_helm_chart_path: "{{kubectl_asset_root_path}}/fabric-peer" k8s_fabric_peer_image_repository: hyperledger/fabric-peer k8s_fabric_peer_start_service: true +k8s_fabric_peer_start_probes: true k8s_fabric_peer_chaincode_invoke_timeout: 5s k8s_fabric_peer_chaincode_memory_limit: 4294967296 # 4Gi k8s_fabric_peer_storage_size: 10Gi diff --git a/ansible-roles/k8s_fabric_peer/files/fabric-peer/templates/deployment.yaml b/ansible-roles/k8s_fabric_peer/files/fabric-peer/templates/deployment.yaml index a47d5d7..5bcb6e5 100644 --- a/ansible-roles/k8s_fabric_peer/files/fabric-peer/templates/deployment.yaml +++ b/ansible-roles/k8s_fabric_peer/files/fabric-peer/templates/deployment.yaml @@ -70,6 +70,8 @@ spec: - while true; do sleep 10; done {{- end }} env: + - name: FABRIC_CFG_PATH + value: /etc/hyperledger/fabric/ {{- if .Values.logGrpc }} - name: GRPC_GO_LOG_VERBOSITY_LEVEL value: 99 @@ -172,15 +174,25 @@ spec: - name: http-op containerPort: {{ .Values.internal.container.operationsPort }} protocol: TCP - {{- if .Values.startService }} + {{- if and .Values.startProbes .Values.startService }} livenessProbe: httpGet: path: /healthz port: http-op + failureThreshold: 1 + periodSeconds: 10 readinessProbe: httpGet: path: /healthz port: http-op + initialDelaySeconds: 5 + periodSeconds: 5 + startupProbe: + httpGet: + path: /healthz + port: http-op + failureThreshold: 30 + periodSeconds: 10 {{- end }} volumeMounts: {{- if .Values.externalChaincode }} diff --git a/ansible-roles/k8s_fabric_peer/files/fabric-peer/values.yaml b/ansible-roles/k8s_fabric_peer/files/fabric-peer/values.yaml index 063bc1b..8e35fe4 100644 --- a/ansible-roles/k8s_fabric_peer/files/fabric-peer/values.yaml +++ b/ansible-roles/k8s_fabric_peer/files/fabric-peer/values.yaml @@ -109,6 +109,8 @@ affinity: {} startService: true +startProbes: true + logLevel: INFO logGrpc: false diff --git a/ansible-roles/k8s_fabric_peer/tasks/inner.yml b/ansible-roles/k8s_fabric_peer/tasks/inner.yml index 358bb34..3f0f02d 100644 --- a/ansible-roles/k8s_fabric_peer/tasks/inner.yml +++ b/ansible-roles/k8s_fabric_peer/tasks/inner.yml @@ -50,6 +50,7 @@ image: repository: "{{k8s_fabric_peer_image_repository}}" startService: "{{k8s_fabric_peer_start_service}}" + startProbes: "{{k8s_fabric_peer_start_probes}}" internal: container: invokeTimeout: "{{k8s_fabric_peer_chaincode_invoke_timeout}}"