Skip to content

Commit d832ab5

Browse files
committed
Revert "[release-line-0.3.21] Limit cometbft load balancer ports to only those actually used (#1191)"
This reverts commit 119434e. Signed-off-by: Moritz Kiefer <[email protected]>
1 parent 1984730 commit d832ab5

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

cluster/pulumi/common-sv/src/synchronizer/cometBftNodeConfigs.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class CometBftNodeConfigs {
3535
privateKey: staticConf.privateKey,
3636
identifier: this.nodeIdentifier,
3737
externalAddress: this.p2pExternalAddress(staticConf.nodeIndex),
38-
istioPort: istioCometbftExternalPort(this._domainMigrationId, staticConf.nodeIndex),
38+
istioPort: this.istioExternalPort(staticConf.nodeIndex),
3939
retainBlocks: staticConf.retainBlocks,
4040
validator: staticConf.validator,
4141
};
@@ -80,13 +80,13 @@ export class CometBftNodeConfigs {
8080
}
8181

8282
private p2pExternalAddress(nodeIndex: number): string {
83-
return `${CLUSTER_HOSTNAME}:${istioCometbftExternalPort(this._domainMigrationId, nodeIndex)}`;
83+
return `${CLUSTER_HOSTNAME}:${this.istioExternalPort(nodeIndex)}`;
8484
}
85-
}
8685

87-
export const istioCometbftExternalPort = (migrationId: number, nodeIndex: number): number => {
88-
// TODO(DACH-NY/canton-network-node#10482) Revisit port scheme
89-
return nodeIndex >= 10
90-
? Number(`26${migrationId}${nodeIndex}`)
91-
: Number(`26${migrationId}${nodeIndex}6`);
92-
};
86+
private istioExternalPort(nodeIndex: number) {
87+
// TODO(#10482) Revisit port scheme
88+
return nodeIndex >= 10
89+
? Number(`26${this._domainMigrationId}${nodeIndex}`)
90+
: Number(`26${this._domainMigrationId}${nodeIndex}6`);
91+
}
92+
}

cluster/pulumi/infra/src/istio.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import * as k8s from '@pulumi/kubernetes';
22
import * as pulumi from '@pulumi/pulumi';
33
import { local } from '@pulumi/command';
4-
import { dsoSize, istioCometbftExternalPort } from 'splice-pulumi-common-sv';
54
import { PodMonitor, ServiceMonitor } from 'splice-pulumi-common/src/metrics';
65

76
import {
87
activeVersion,
98
DecentralizedSynchronizerUpgradeConfig,
10-
DeploySvRunbook,
119
ExactNamespace,
1210
getDnsNames,
1311
HELM_MAX_HISTORY_SIZE,
@@ -160,18 +158,13 @@ function configureInternalGatewayService(
160158
) {
161159
const externalIPRanges = loadIPRanges();
162160
// see notes when installing a CometBft node in the full deployment
163-
const cometBftIngressPorts = DecentralizedSynchronizerUpgradeConfig.runningMigrations()
164-
.map(migrationInfo => migrationInfo.id)
165-
.flatMap((domain: number) => {
166-
return (DeploySvRunbook ? [0] : [])
167-
.concat(Array.from(Array(dsoSize).keys()).map(n => n + 1))
168-
.map(node => {
169-
return ingressPort(
170-
`cometbft-${domain}-${node}-gw`,
171-
istioCometbftExternalPort(domain, node)
172-
);
173-
});
161+
const cometBftIngressPorts = Array.from(
162+
Array(DecentralizedSynchronizerUpgradeConfig.highestMigrationId + 1).keys()
163+
).flatMap((domain: number) => {
164+
return Array.from(Array(10).keys()).map(node => {
165+
return ingressPort(`cometbft-${domain}-${node}-gw`, Number(`26${domain}${node}6`));
174166
});
167+
});
175168
return configureGatewayService(
176169
ingressNs,
177170
ingressIp,

0 commit comments

Comments
 (0)