-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "[CE-673] Add support of Peer/Orderer to operator"
- Loading branch information
Showing
19 changed files
with
1,131 additions
and
6 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/agent/fabric-operator/build/bin/templates/orderer/orderer_service.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
labels: | ||
k8s-app: "<name>" | ||
name: "<name>" | ||
spec: | ||
selector: | ||
k8s-app: "<name>" | ||
type: NodePort | ||
ports: | ||
- name: ordererport | ||
port: 7054 |
49 changes: 49 additions & 0 deletions
49
src/agent/fabric-operator/build/bin/templates/orderer/orderer_statefulset.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: "<name>" | ||
spec: | ||
serviceName: "<name>" | ||
selector: | ||
matchLabels: | ||
k8s-app: "<name>" | ||
type: orderer | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: ordererstorage | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
storageClassName: "default" | ||
resources: | ||
requests: | ||
storage: "1Gi" | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: "<name>" | ||
type: "orderer" | ||
component: "orderer" | ||
spec: | ||
volumes: | ||
- name: orderercerts | ||
secret: | ||
secretName: orderercerts | ||
- name: toolset | ||
configMap: | ||
name: fabric-configuration-toolset | ||
containers: | ||
- name: orderer | ||
image: "<image>" | ||
imagePullPolicy: Always | ||
env: | ||
- { name: "ORDERER_CFG_PATH", value: "/etc/hyperledger/" } | ||
- { name: "ORDERER_GENERAL_LEDGERTYPE", value: "file" } | ||
- { name: "ORDERER_FILELEDGER_LOCATION", value: "/etc/hyperledger/ledger/orderer" } | ||
- { name: "ORDERER_GENERAL_LOGLEVEL", value: "debug" } | ||
volumeMounts: | ||
- mountPath: "/etc/hyperledger/orderer" | ||
name: ordererstorage | ||
- mountPath: "/certs" | ||
name: orderercerts | ||
command: ["orderer"] | ||
|
13 changes: 13 additions & 0 deletions
13
src/agent/fabric-operator/build/bin/templates/peer/peer_service.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
labels: | ||
k8s-app: "<name>" | ||
name: "<name>" | ||
spec: | ||
selector: | ||
k8s-app: "<name>" | ||
type: NodePort | ||
ports: | ||
- name: peerport | ||
port: 7054 |
50 changes: 50 additions & 0 deletions
50
src/agent/fabric-operator/build/bin/templates/peer/peer_statefulset.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: "<name>" | ||
spec: | ||
serviceName: "<name>" | ||
selector: | ||
matchLabels: | ||
k8s-app: "<name>" | ||
type: peer | ||
replicas: 1 | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: peerstorage | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
storageClassName: "default" | ||
resources: | ||
requests: | ||
storage: "1Gi" | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: "<name>" | ||
type: "peer" | ||
component: "peer" | ||
spec: | ||
volumes: | ||
- name: peercerts | ||
secret: | ||
secretName: peercerts | ||
- name: toolset | ||
configMap: | ||
name: fabric-configuration-toolset | ||
containers: | ||
- name: peer | ||
image: "<image>" | ||
imagePullPolicy: Always | ||
env: | ||
- { name: "CORE_PEER_ID", value: "org1peer1" } | ||
- { name: "CORE_PEER_COMMITTER_ENABLED", value: "true" } | ||
- { name: "CORE_VM_ENDPOINT", value: "tcp://docker:2375" } | ||
- { name: "CORE_LOGGING_PEER", value: "debug" } | ||
volumeMounts: | ||
- mountPath: "/etc/hyperledger/peer" | ||
name: peerstorage | ||
- mountPath: "/certs" | ||
name: peercerts | ||
command: ["peer"] | ||
args: ["node", "start"] |
31 changes: 31 additions & 0 deletions
31
src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_orderer_cr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: fabric.hyperledger.org/v1alpha1 | ||
kind: Orderer | ||
metadata: | ||
name: orderer00 | ||
spec: | ||
storageSize: "1Gi" | ||
storageClass: "default" | ||
image: "hyperledger/fabric-orderer:1.4.1" | ||
# Add all the configurable peer parameters as | ||
# name-value pairs | ||
configParams: | ||
- name: ORDERER_CFG_PATH | ||
value: /shared/ | ||
- name: ORDERER_GENERAL_LEDGERTYPE | ||
value: file | ||
- name: ORDERER_FILELEDGER_LOCATION | ||
value: /shared/ledger/orderer | ||
- name: ORDERER_GENERAL_BATCHTIMEOUT | ||
value: 1s | ||
- name: ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT | ||
value: "10" | ||
- name: ORDERER_GENERAL_MAXWINDOWSIZE | ||
value: "1000" | ||
- name: ORDERER_GENERAL_ORDERERTYPE | ||
value: solo | ||
- name: ORDERER_GENERAL_LISTENADDRESS | ||
value: 0.0.0.0 | ||
- name: ORDERER_GENERAL_LISTENPORT | ||
value: "31010" | ||
- name: ORDERER_GENERAL_LOGLEVEL | ||
value: debug |
66 changes: 66 additions & 0 deletions
66
src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_orderer_crd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: orderers.fabric.hyperledger.org | ||
spec: | ||
group: fabric.hyperledger.org | ||
names: | ||
kind: Orderer | ||
listKind: OrdererList | ||
plural: orderers | ||
singular: orderer | ||
scope: Namespaced | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
configParams: | ||
items: | ||
properties: | ||
name: | ||
type: string | ||
value: | ||
type: string | ||
required: | ||
- name | ||
- value | ||
type: object | ||
type: array | ||
image: | ||
type: string | ||
storageClass: | ||
type: string | ||
storageSize: | ||
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
Important: Run "operator-sdk generate k8s" to regenerate code after | ||
modifying this file Add custom validation using kubebuilder tags: | ||
https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' | ||
type: string | ||
required: | ||
- storageSize | ||
- storageClass | ||
- image | ||
- configParams | ||
type: object | ||
status: | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true |
29 changes: 29 additions & 0 deletions
29
src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_peer_cr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: fabric.hyperledger.org/v1alpha1 | ||
kind: Peer | ||
metadata: | ||
name: peer01 | ||
spec: | ||
# Add fields here | ||
storageSize: "1Gi" | ||
storageClass: "default" | ||
image: "hyperledger/fabric-peer:1.4.1" | ||
# Add all the configurable peer parameters as | ||
# name-value pairs | ||
configParams: | ||
- name: CORE_PEER_ADDRESSAUTODETECT | ||
value: "true" | ||
- name: CORE_PEER_NETWORKID | ||
value: nid1 | ||
- name: CORE_PEER_ID | ||
value: org1peer1 | ||
- name: CORE_PEER_ADDRESS | ||
value: blockchain-org1peer1:30110 | ||
- name: CORE_PEER_LISTENADDRESS | ||
value: 0.0.0.0:30110 | ||
- name: CORE_PEER_EVENTS_ADDRESS | ||
value: 0.0.0.0:30111 | ||
- name: CORE_PEER_GOSSIP_BOOTSTRAP | ||
value: blockchain-org1peer1:30110 | ||
- name: CORE_PEER_GOSSIP_ORGLEADER | ||
value: "false" | ||
|
66 changes: 66 additions & 0 deletions
66
src/agent/fabric-operator/deploy/crds/fabric_v1alpha1_peer_crd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: peers.fabric.hyperledger.org | ||
spec: | ||
group: fabric.hyperledger.org | ||
names: | ||
kind: Peer | ||
listKind: PeerList | ||
plural: peers | ||
singular: peer | ||
scope: Namespaced | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
configParams: | ||
items: | ||
properties: | ||
name: | ||
type: string | ||
value: | ||
type: string | ||
required: | ||
- name | ||
- value | ||
type: object | ||
type: array | ||
image: | ||
type: string | ||
storageClass: | ||
type: string | ||
storageSize: | ||
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
Important: Run "operator-sdk generate k8s" to regenerate code after | ||
modifying this file Add custom validation using kubebuilder tags: | ||
https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html' | ||
type: string | ||
required: | ||
- storageSize | ||
- storageClass | ||
- image | ||
- configParams | ||
type: object | ||
status: | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,5 +56,7 @@ rules: | |
- fabric.hyperledger.org | ||
resources: | ||
- '*' | ||
- peers | ||
- orderers | ||
verbs: | ||
- '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.