Skip to content

Commit

Permalink
Parametrize responseWaitTime, aliveTimeInterval, aliveExpirationTimeo…
Browse files Browse the repository at this point in the history
…ut and reconnectInterval
  • Loading branch information
dviejokfs committed Feb 8, 2024
1 parent 8911a1e commit 2f87190
Show file tree
Hide file tree
Showing 14 changed files with 2,022 additions and 94 deletions.
12 changes: 12 additions & 0 deletions api/hlf.kungfusoftware.es/v1alpha1/hlf_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,18 @@ type FabricPeerSpecGossip struct {
Endpoint string `json:"endpoint"`
UseLeaderElection bool `json:"useLeaderElection"`
OrgLeader bool `json:"orgLeader"`
// +kubebuilder:validation:Default=25s
// +optional
ReconnectInterval string `json:"reconnectInterval"`
// +kubebuilder:validation:Default=25s
// +optional
AliveExpirationTimeout string `json:"aliveExpirationTimeout"`
// +kubebuilder:validation:Default=5s
// +optional
AliveTimeInterval string `json:"aliveTimeInterval"`
// +kubebuilder:validation:Default=2s
// +optional
ResponseWaitTime string `json:"responseWaitTime"`
}
type Catls struct {
Cacert string `json:"cacert"`
Expand Down
8 changes: 4 additions & 4 deletions charts/hlf-peer/templates/configmap--peer--core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ data:
# Should be slightly bigger than digestWaitTime
requestWaitTime: 1500ms
# Time to wait before pull engine ends pull (unit: second)
responseWaitTime: 2s
responseWaitTime: {{.Values.peer.gossip.responseWaitTime | default "2s" }}
# Alive check interval(unit: second)
aliveTimeInterval: 5s
aliveTimeInterval: {{.Values.peer.gossip.aliveTimeInterval | default "5s" }}
# Alive expiration timeout(unit: second)
aliveExpirationTimeout: 25s
aliveExpirationTimeout: {{.Values.peer.gossip.aliveExpirationTimeout | default "25s"}}
# Reconnect interval(unit: second)
reconnectInterval: 25s
reconnectInterval: {{.Values.peer.gossip.reconnectInterval | default "25s"}}
# Max number of attempts to connect to a peer
maxConnectionAttempts: 120
# Message expiration factor for alive messages
Expand Down
5 changes: 5 additions & 0 deletions charts/hlf-peer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ peer:
orgLeader: "false"
useLeaderElection: "true"

reconnectInterval: "25s"
aliveExpirationTimeout: "25s"
aliveTimeInterval: "5s"
responseWaitTime: "2s"

tls:
server:
enabled: "true"
Expand Down
186 changes: 181 additions & 5 deletions config/crd/bases/hlf.kungfusoftware.es_fabriccas.yaml

Large diffs are not rendered by default.

186 changes: 181 additions & 5 deletions config/crd/bases/hlf.kungfusoftware.es_fabricchaincodes.yaml

Large diffs are not rendered by default.

186 changes: 181 additions & 5 deletions config/crd/bases/hlf.kungfusoftware.es_fabricchaincodetemplates.yaml

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion config/crd/bases/hlf.kungfusoftware.es_fabricexplorers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ spec:
resources:
description: ResourceRequirements describes the compute resource requirements.
properties:
claims:
description: "Claims lists the names of resources, defined in
spec.resourceClaims, that are used by this container. \n This
is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be set
for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims
of the Pod where this field is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand All @@ -68,7 +89,8 @@ spec:
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
required:
Expand Down
387 changes: 375 additions & 12 deletions config/crd/bases/hlf.kungfusoftware.es_fabricoperationsconsoles.yaml

Large diffs are not rendered by default.

190 changes: 183 additions & 7 deletions config/crd/bases/hlf.kungfusoftware.es_fabricoperatorapis.yaml

Large diffs are not rendered by default.

190 changes: 183 additions & 7 deletions config/crd/bases/hlf.kungfusoftware.es_fabricoperatoruis.yaml

Large diffs are not rendered by default.

211 changes: 205 additions & 6 deletions config/crd/bases/hlf.kungfusoftware.es_fabricorderernodes.yaml

Large diffs are not rendered by default.

503 changes: 471 additions & 32 deletions config/crd/bases/hlf.kungfusoftware.es_fabricpeers.yaml

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions controllers/peer/peer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1455,11 +1455,15 @@ func GetConfig(
DatabaseType: stateDb,
MspID: spec.MspID,
Gossip: Gossip{
Bootstrap: spec.Gossip.Bootstrap,
Endpoint: gossipEndpoint,
ExternalEndpoint: gossipExternalEndpoint,
OrgLeader: spec.Gossip.OrgLeader,
UseLeaderElection: spec.Gossip.UseLeaderElection,
Bootstrap: spec.Gossip.Bootstrap,
Endpoint: gossipEndpoint,
ExternalEndpoint: gossipExternalEndpoint,
OrgLeader: spec.Gossip.OrgLeader,
UseLeaderElection: spec.Gossip.UseLeaderElection,
ReconnectInterval: spec.Gossip.ReconnectInterval,
AliveExpirationTimeout: spec.Gossip.AliveExpirationTimeout,
AliveTimeInterval: spec.Gossip.AliveTimeInterval,
ResponseWaitTime: spec.Gossip.ResponseWaitTime,
},
TLS: TLSAuth{
Server: Server{Enabled: true},
Expand Down
14 changes: 9 additions & 5 deletions controllers/peer/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ type Image struct {
type Annotations struct {
}
type Gossip struct {
Bootstrap string `json:"bootstrap"`
Endpoint string `json:"endpoint"`
ExternalEndpoint string `json:"externalEndpoint"`
OrgLeader bool `json:"orgLeader"`
UseLeaderElection bool `json:"useLeaderElection"`
Bootstrap string `json:"bootstrap"`
Endpoint string `json:"endpoint"`
ExternalEndpoint string `json:"externalEndpoint"`
OrgLeader bool `json:"orgLeader"`
UseLeaderElection bool `json:"useLeaderElection"`
ReconnectInterval string `json:"reconnectInterval"`
AliveExpirationTimeout string `json:"aliveExpirationTimeout"`
AliveTimeInterval string `json:"aliveTimeInterval"`
ResponseWaitTime string `json:"responseWaitTime"`
}
type Server struct {
Enabled bool `json:"enabled"`
Expand Down

0 comments on commit 2f87190

Please sign in to comment.