From a08eacbcc37925ba9a99a67f0090cddd85d16b30 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Fri, 24 May 2024 16:04:18 +0100 Subject: [PATCH] Update test-network-k8s Add required permissions for upcoming k8s builder release Also adds ttl to install jobs and configures the k8s builder prefix Signed-off-by: James Taylor --- test-network-k8s/config/org1/core.yaml | 1 + test-network-k8s/config/org2/core.yaml | 1 + test-network-k8s/kube/fabric-builder-role.yaml | 3 ++- test-network-k8s/kube/org1/org1-install-k8s-builder.yaml | 1 + test-network-k8s/kube/org1/org1-peer1.yaml | 1 + test-network-k8s/kube/org1/org1-peer2.yaml | 1 + test-network-k8s/kube/org2/org2-install-k8s-builder.yaml | 1 + test-network-k8s/kube/org2/org2-peer1.yaml | 1 + test-network-k8s/kube/org2/org2-peer2.yaml | 1 + 9 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test-network-k8s/config/org1/core.yaml b/test-network-k8s/config/org1/core.yaml index 0200457263..9643adbd83 100644 --- a/test-network-k8s/config/org1/core.yaml +++ b/test-network-k8s/config/org1/core.yaml @@ -568,6 +568,7 @@ chaincode: path: /var/hyperledger/fabric/external_builders/k8s_builder propagateEnvironment: - CORE_PEER_ID + - FABRIC_K8S_BUILDER_OBJECT_NAME_PREFIX - KUBERNETES_SERVICE_HOST - KUBERNETES_SERVICE_PORT diff --git a/test-network-k8s/config/org2/core.yaml b/test-network-k8s/config/org2/core.yaml index 8d9c1d97c7..e4168a1238 100644 --- a/test-network-k8s/config/org2/core.yaml +++ b/test-network-k8s/config/org2/core.yaml @@ -568,6 +568,7 @@ chaincode: path: /var/hyperledger/fabric/external_builders/k8s_builder propagateEnvironment: - CORE_PEER_ID + - FABRIC_K8S_BUILDER_OBJECT_NAME_PREFIX - KUBERNETES_SERVICE_HOST - KUBERNETES_SERVICE_PORT diff --git a/test-network-k8s/kube/fabric-builder-role.yaml b/test-network-k8s/kube/fabric-builder-role.yaml index 3f51d93178..c1d6d4ff3a 100644 --- a/test-network-k8s/kube/fabric-builder-role.yaml +++ b/test-network-k8s/kube/fabric-builder-role.yaml @@ -12,9 +12,10 @@ rules: - apiGroups: - "" - apps + - batch resources: - pods - - deployments + - jobs - configmaps - secrets verbs: diff --git a/test-network-k8s/kube/org1/org1-install-k8s-builder.yaml b/test-network-k8s/kube/org1/org1-install-k8s-builder.yaml index 8c8b26f8dc..d6bea41b26 100644 --- a/test-network-k8s/kube/org1/org1-install-k8s-builder.yaml +++ b/test-network-k8s/kube/org1/org1-install-k8s-builder.yaml @@ -9,6 +9,7 @@ kind: Job metadata: name: org1-install-k8s-builder spec: + ttlSecondsAfterFinished: 600 backoffLimit: 0 completions: 1 template: diff --git a/test-network-k8s/kube/org1/org1-peer1.yaml b/test-network-k8s/kube/org1/org1-peer1.yaml index 22a259a60c..9d267356ee 100644 --- a/test-network-k8s/kube/org1/org1-peer1.yaml +++ b/test-network-k8s/kube/org1/org1-peer1.yaml @@ -53,6 +53,7 @@ data: CORE_PEER_FILESYSTEMPATH: /var/hyperledger/fabric/data/org1-peer1.org1.example.com CORE_LEDGER_SNAPSHOTS_ROOTDIR: /var/hyperledger/fabric/data/org1-peer1.org1.example.com/snapshots CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG: "{\"peername\":\"org1peer1\"}" + FABRIC_K8S_BUILDER_OBJECT_NAME_PREFIX: org1-peer1-cc CORE_LEDGER_STATE_STATEDATABASE: CouchDB CORE_LEDGER_STATE_COUCHDBCONFIG_MAXRETRIESONSTARTUP: "20" CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS: localhost:5984 diff --git a/test-network-k8s/kube/org1/org1-peer2.yaml b/test-network-k8s/kube/org1/org1-peer2.yaml index f6282c0f8f..7eb6fb52ee 100644 --- a/test-network-k8s/kube/org1/org1-peer2.yaml +++ b/test-network-k8s/kube/org1/org1-peer2.yaml @@ -54,6 +54,7 @@ data: CORE_PEER_FILESYSTEMPATH: /var/hyperledger/fabric/data/org1-peer2.org1.example.com CORE_LEDGER_SNAPSHOTS_ROOTDIR: /var/hyperledger/fabric/data/org1-peer2.org1.example.com/snapshots CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG: "{\"peername\":\"org1peer2\"}" + FABRIC_K8S_BUILDER_OBJECT_NAME_PREFIX: org1-peer2-cc CORE_LEDGER_STATE_STATEDATABASE: CouchDB CORE_LEDGER_STATE_COUCHDBCONFIG_MAXRETRIESONSTARTUP: "20" CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS: localhost:5984 diff --git a/test-network-k8s/kube/org2/org2-install-k8s-builder.yaml b/test-network-k8s/kube/org2/org2-install-k8s-builder.yaml index 2b336f06e2..a32a44b818 100644 --- a/test-network-k8s/kube/org2/org2-install-k8s-builder.yaml +++ b/test-network-k8s/kube/org2/org2-install-k8s-builder.yaml @@ -9,6 +9,7 @@ kind: Job metadata: name: org2-install-k8s-builder spec: + ttlSecondsAfterFinished: 600 backoffLimit: 0 completions: 1 template: diff --git a/test-network-k8s/kube/org2/org2-peer1.yaml b/test-network-k8s/kube/org2/org2-peer1.yaml index 57f307abff..86111c82cc 100644 --- a/test-network-k8s/kube/org2/org2-peer1.yaml +++ b/test-network-k8s/kube/org2/org2-peer1.yaml @@ -53,6 +53,7 @@ data: CORE_PEER_FILESYSTEMPATH: /var/hyperledger/fabric/data/org2-peer1.org2.example.com CORE_LEDGER_SNAPSHOTS_ROOTDIR: /var/hyperledger/fabric/data/org2-peer1.org2.example.com/snapshots CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG: "{\"peername\":\"org2peer1\"}" + FABRIC_K8S_BUILDER_OBJECT_NAME_PREFIX: org2-peer1-cc CORE_LEDGER_STATE_STATEDATABASE: CouchDB CORE_LEDGER_STATE_COUCHDBCONFIG_MAXRETRIESONSTARTUP: "20" CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS: localhost:5984 diff --git a/test-network-k8s/kube/org2/org2-peer2.yaml b/test-network-k8s/kube/org2/org2-peer2.yaml index 8ba1958bef..8fc18b6ca4 100644 --- a/test-network-k8s/kube/org2/org2-peer2.yaml +++ b/test-network-k8s/kube/org2/org2-peer2.yaml @@ -52,6 +52,7 @@ data: CORE_PEER_FILESYSTEMPATH: /var/hyperledger/fabric/data/org2-peer2.org2.example.com CORE_LEDGER_SNAPSHOTS_ROOTDIR: /var/hyperledger/fabric/data/org2-peer2.org2.example.com/snapshots CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG: "{\"peername\":\"org2peer2\"}" + FABRIC_K8S_BUILDER_OBJECT_NAME_PREFIX: org2-peer2-cc CORE_LEDGER_STATE_STATEDATABASE: CouchDB CORE_LEDGER_STATE_COUCHDBCONFIG_MAXRETRIESONSTARTUP: "20" CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS: localhost:5984