Skip to content

Commit dc56d15

Browse files
committed
Merge branch 'feature/1.9.0-new' of https://github.com/hyperledger/bevel-operator-fabric into feature/1.9.0-new
Signed-off-by: David VIEJO <[email protected]>
2 parents ac4cc4d + 92d0275 commit dc56d15

36 files changed

+2009
-110
lines changed

.github/workflows/test-kubectl-plugin.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: helm/[email protected]
2626
with:
2727
cluster_name: kind
28-
node_image: kindest/node:v1.25.0
28+
node_image: kindest/node:v1.25.8
2929
config: .github/kind-config.yaml
3030

3131
- name: Install kubectl plugin
@@ -44,7 +44,7 @@ jobs:
4444
- name: Deploy operator
4545
run: |
4646
helm repo add kfs https://kfsoftware.github.io/hlf-helm-charts --force-update
47-
helm install hlf-operator --version=1.8.2 kfs/hlf-operator --set image.repository="${IMAGE}" --set image.tag="${TAG}" --set image.pullPolicy="IfNotPresent"
47+
helm install hlf-operator --version=1.9.0-beta4 kfs/hlf-operator --set image.repository="${IMAGE}" --set image.tag="${TAG}" --set image.pullPolicy="IfNotPresent"
4848
4949
- name: Install operator CRDs
5050
run: |
@@ -169,10 +169,10 @@ jobs:
169169
- name: Create Peer org
170170
run: |
171171
export PEER_IMAGE=hyperledger/fabric-peer
172-
export PEER_VERSION=2.4.6
172+
export PEER_VERSION=2.5.0
173173
174174
export CA_IMAGE=hyperledger/fabric-ca
175-
export CA_VERSION=1.5.6-beta2
175+
export CA_VERSION=1.5.6
176176
177177
kubectl hlf ca create --image=$CA_IMAGE --version=$CA_VERSION --storage-class=standard --capacity=2Gi --name=org1-ca \
178178
--enroll-id=enroll --hosts=org1-ca.localho.st --enroll-pw=enrollpw
@@ -190,10 +190,10 @@ jobs:
190190
- name: Create Orderer Org
191191
run: |
192192
export ORDERER_IMAGE=hyperledger/fabric-orderer
193-
export ORDERER_VERSION=2.4.6
193+
export ORDERER_VERSION=2.5.0
194194
195195
export CA_IMAGE=hyperledger/fabric-ca
196-
export CA_VERSION=1.5.6-beta2
196+
export CA_VERSION=1.5.6
197197
198198
kubectl hlf ca create --image=$CA_IMAGE --version=$CA_VERSION --storage-class=standard --capacity=2Gi --name=ord-ca \
199199
--enroll-id=enroll --enroll-pw=enrollpw --hosts=ord-ca.localho.st

README.md

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ kind: Cluster
7373
apiVersion: kind.x-k8s.io/v1alpha4
7474
nodes:
7575
- role: control-plane
76+
image: kindest/node:v1.25.8
7677
extraPortMappings:
7778
- containerPort: 30949
7879
hostPort: 80
@@ -96,7 +97,7 @@ To install helm: [https://helm.sh/docs/intro/install/](https://helm.sh/docs/intr
9697
```bash
9798
helm repo add kfs https://kfsoftware.github.io/hlf-helm-charts --force-update
9899

99-
helm install hlf-operator --version=1.8.2 kfs/hlf-operator
100+
helm install hlf-operator --version=1.9.0-beta4 -- kfs/hlf-operator
100101
```
101102

102103

@@ -197,27 +198,27 @@ EOF
197198

198199
```bash
199200
export PEER_IMAGE=hyperledger/fabric-peer
200-
export PEER_VERSION=2.4.6
201+
export PEER_VERSION=2.5.0
201202

202203
export ORDERER_IMAGE=hyperledger/fabric-orderer
203-
export ORDERER_VERSION=2.4.6
204+
export ORDERER_VERSION=2.5.0
204205

205206
export CA_IMAGE=hyperledger/fabric-ca
206-
export CA_VERSION=1.5.6-beta2
207+
export CA_VERSION=1.5.6
207208
```
208209

209210

210211
### Environment Variables for ARM (Mac M1)
211212

212213
```bash
213-
export PEER_IMAGE=bswamina/fabric-peer
214-
export PEER_VERSION=2.4.6
214+
export PEER_IMAGE=hyperledger/fabric-peer
215+
export PEER_VERSION=2.5.0
215216

216-
export ORDERER_IMAGE=bswamina/fabric-orderer
217-
export ORDERER_VERSION=2.4.6
217+
export ORDERER_IMAGE=hyperledger/fabric-orderer
218+
export ORDERER_VERSION=2.5.0
218219

219220
export CA_IMAGE=hyperledger/fabric-ca
220-
export CA_VERSION=1.5.6-beta2
221+
export CA_VERSION=1.5.6
221222

222223
```
223224

@@ -364,41 +365,6 @@ openssl s_client -connect orderer0-ord.localho.st:443
364365
```
365366

366367

367-
## Prepare connection string to interact with orderer
368-
369-
To prepare the connection string, we have to:
370-
371-
- Get the connection string without users
372-
- Register a user in the certification authority for signature
373-
- Get the certificates using the user created above
374-
- Attach the user to the connection string
375-
376-
1. Get the connection string without users
377-
378-
```bash
379-
kubectl hlf inspect --output ordservice.yaml -o OrdererMSP
380-
```
381-
382-
2. Register a user in the TLS certification authority
383-
384-
```bash
385-
kubectl hlf ca register --name=ord-ca --user=admin --secret=adminpw \
386-
--type=admin --enroll-id enroll --enroll-secret=enrollpw --mspid=OrdererMSP
387-
```
388-
389-
3. Get the certificates using the certificate
390-
391-
```bash
392-
kubectl hlf ca enroll --name=ord-ca --user=admin --secret=adminpw --mspid OrdererMSP \
393-
--ca-name ca --output admin-ordservice.yaml
394-
```
395-
396-
4. Attach the user to the connection string
397-
398-
```
399-
kubectl hlf utils adduser --userPath=admin-ordservice.yaml --config=ordservice.yaml --username=admin --mspid=OrdererMSP
400-
```
401-
402368
## Create channel
403369

404370
To create the channel we need to first create the wallet secret, which will contain the identities used by the operator to manage the channel

api/hlf.kungfusoftware.es/v1alpha1/hlf_types.go

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package v1alpha1
1818

1919
import (
2020
"fmt"
21+
2122
"github.com/kfsoftware/hlf-operator/pkg/status"
2223
"k8s.io/api/networking/v1beta1"
2324
kubeclock "k8s.io/apimachinery/pkg/util/clock"
@@ -317,9 +318,11 @@ type Component struct {
317318
External *ExternalCertificate `json:"external"`
318319
}
319320
type ExternalCertificate struct {
320-
SecretName string `json:"secretName"`
321-
CertificateKey string `json:"certificateKey"`
322-
PrivateKeyKey string `json:"privateKeyKey"`
321+
SecretName string `json:"secretName"`
322+
SecretNamespace string `json:"secretNamespace"`
323+
RootCertificateKey string `json:"rootCertificateKey"`
324+
CertificateKey string `json:"certificateKey"`
325+
PrivateKeyKey string `json:"privateKeyKey"`
323326
}
324327

325328
func (c *Component) CAUrl() string {
@@ -341,6 +344,10 @@ type TLS struct {
341344
Csr Csr `json:"csr"`
342345
Enrollid string `json:"enrollid"`
343346
Enrollsecret string `json:"enrollsecret"`
347+
348+
// +optional
349+
// +nullable
350+
External *ExternalCertificate `json:"external"`
344351
}
345352
type Enrollment struct {
346353
Component Component `json:"component"`
@@ -1429,10 +1436,23 @@ type FabricOperatorAPISpec struct {
14291436

14301437
// FabricNetworkConfigSpec defines the desired state of FabricNetworkConfig
14311438
type FabricNetworkConfigSpec struct {
1432-
Organization string `json:"organization"`
1433-
Internal bool `json:"internal"`
1439+
Organization string `json:"organization"`
1440+
1441+
Internal bool `json:"internal"`
1442+
14341443
Organizations []string `json:"organizations"`
1435-
SecretName string `json:"secretName"`
1444+
1445+
Namespaces []string `json:"namespaces"`
1446+
1447+
// HLF Identities to be included in the network config
1448+
Identities []FabricNetworkConfigIdentity `json:"identities"`
1449+
1450+
SecretName string `json:"secretName"`
1451+
}
1452+
1453+
type FabricNetworkConfigIdentity struct {
1454+
Name string `json:"name"`
1455+
Namespace string `json:"namespace"`
14361456
}
14371457

14381458
// FabricNetworkConfigStatus defines the observed state of FabricNetworkConfig
@@ -1551,6 +1571,56 @@ type FabricChaincodeList struct {
15511571
Items []FabricChaincode `json:"items"`
15521572
}
15531573

1574+
// FabricMainChannelStatus defines the observed state of FabricMainChannel
1575+
type FabricIdentityStatus struct {
1576+
Conditions status.Conditions `json:"conditions"`
1577+
Message string `json:"message"`
1578+
// Status of the FabricCA
1579+
Status DeploymentStatus `json:"status"`
1580+
}
1581+
1582+
// +genclient
1583+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1584+
// +k8s:defaulter-gen=true
1585+
// +kubebuilder:subresource:status
1586+
// +kubebuilder:resource:scope=Namespaced,shortName=fabricidentity,singular=fabricidentity
1587+
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.status"
1588+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
1589+
// +k8s:openapi-gen=true
1590+
1591+
// FabricIdentity is the Schema for the hlfs API
1592+
type FabricIdentity struct {
1593+
metav1.TypeMeta `json:",inline"`
1594+
metav1.ObjectMeta `json:"metadata,omitempty"`
1595+
Spec FabricIdentitySpec `json:"spec,omitempty"`
1596+
Status FabricIdentityStatus `json:"status,omitempty"`
1597+
}
1598+
1599+
// +kubebuilder:object:root=true
1600+
1601+
// FabricIdentityList contains a list of FabricIdentity
1602+
type FabricIdentityList struct {
1603+
metav1.TypeMeta `json:",inline"`
1604+
metav1.ListMeta `json:"metadata,omitempty"`
1605+
Items []FabricIdentity `json:"items"`
1606+
}
1607+
1608+
// FabricIdentitySpec defines the desired state of FabricIdentity
1609+
type FabricIdentitySpec struct {
1610+
// +kubebuilder:validation:MinLength=1
1611+
Cahost string `json:"cahost"`
1612+
// +kubebuilder:validation:MinLength=1
1613+
Caname string `json:"caname"`
1614+
Caport int `json:"caport"`
1615+
Catls Catls `json:"catls"`
1616+
// +kubebuilder:validation:MinLength=1
1617+
Enrollid string `json:"enrollid"`
1618+
// +kubebuilder:validation:MinLength=1
1619+
Enrollsecret string `json:"enrollsecret"`
1620+
// +kubebuilder:validation:MinLength=1
1621+
MSPID string `json:"mspid"`
1622+
}
1623+
15541624
// FabricMainChannelStatus defines the observed state of FabricMainChannel
15551625
type FabricMainChannelStatus struct {
15561626
Conditions status.Conditions `json:"conditions"`
@@ -1616,6 +1686,7 @@ type FabricMainChannelSpec struct {
16161686
// Consenters are the orderer nodes that are part of the channel consensus
16171687
Consenters []FabricMainChannelConsenter `json:"orderers"`
16181688
}
1689+
16191690
type FabricMainChannelAdminPeerOrganizationSpec struct {
16201691
// MSP ID of the organization
16211692
MSPID string `json:"mspID"`
@@ -1940,5 +2011,6 @@ func init() {
19402011
SchemeBuilder.Register(&FabricOperatorUI{}, &FabricOperatorUIList{})
19412012
SchemeBuilder.Register(&FabricOperatorAPI{}, &FabricOperatorAPIList{})
19422013
SchemeBuilder.Register(&FabricMainChannel{}, &FabricMainChannelList{})
2014+
SchemeBuilder.Register(&FabricIdentity{}, &FabricIdentityList{})
19432015
SchemeBuilder.Register(&FabricFollowerChannel{}, &FabricFollowerChannelList{})
19442016
}

0 commit comments

Comments
 (0)