Skip to content

Commit c5f2f21

Browse files
[release-line-0.4.1] only filter cometbft ports by migrations (#1205)
* Revert "[release-line-0.4.1] Limit cometbft load balancer ports to only those actually used (#1193)" This reverts commit efaea62. Signed-off-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org> * Only filter cometbft ports by migrations Changing the dependency structure is too much of a mess and this seems good enough. [static] Signed-off-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org> --------- Signed-off-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org> Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
1 parent efaea62 commit c5f2f21

File tree

3 files changed

+109
-20
lines changed

3 files changed

+109
-20
lines changed

cluster/expected/infra/expected.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,54 @@
14591459
"protocol": "TCP",
14601460
"targetPort": 26316
14611461
},
1462+
{
1463+
"name": "cometbft-3-2-gw",
1464+
"port": 26326,
1465+
"protocol": "TCP",
1466+
"targetPort": 26326
1467+
},
1468+
{
1469+
"name": "cometbft-3-3-gw",
1470+
"port": 26336,
1471+
"protocol": "TCP",
1472+
"targetPort": 26336
1473+
},
1474+
{
1475+
"name": "cometbft-3-4-gw",
1476+
"port": 26346,
1477+
"protocol": "TCP",
1478+
"targetPort": 26346
1479+
},
1480+
{
1481+
"name": "cometbft-3-5-gw",
1482+
"port": 26356,
1483+
"protocol": "TCP",
1484+
"targetPort": 26356
1485+
},
1486+
{
1487+
"name": "cometbft-3-6-gw",
1488+
"port": 26366,
1489+
"protocol": "TCP",
1490+
"targetPort": 26366
1491+
},
1492+
{
1493+
"name": "cometbft-3-7-gw",
1494+
"port": 26376,
1495+
"protocol": "TCP",
1496+
"targetPort": 26376
1497+
},
1498+
{
1499+
"name": "cometbft-3-8-gw",
1500+
"port": 26386,
1501+
"protocol": "TCP",
1502+
"targetPort": 26386
1503+
},
1504+
{
1505+
"name": "cometbft-3-9-gw",
1506+
"port": 26396,
1507+
"protocol": "TCP",
1508+
"targetPort": 26396
1509+
},
14621510
{
14631511
"name": "cometbft-4-0-gw",
14641512
"port": 26406,
@@ -1470,6 +1518,54 @@
14701518
"port": 26416,
14711519
"protocol": "TCP",
14721520
"targetPort": 26416
1521+
},
1522+
{
1523+
"name": "cometbft-4-2-gw",
1524+
"port": 26426,
1525+
"protocol": "TCP",
1526+
"targetPort": 26426
1527+
},
1528+
{
1529+
"name": "cometbft-4-3-gw",
1530+
"port": 26436,
1531+
"protocol": "TCP",
1532+
"targetPort": 26436
1533+
},
1534+
{
1535+
"name": "cometbft-4-4-gw",
1536+
"port": 26446,
1537+
"protocol": "TCP",
1538+
"targetPort": 26446
1539+
},
1540+
{
1541+
"name": "cometbft-4-5-gw",
1542+
"port": 26456,
1543+
"protocol": "TCP",
1544+
"targetPort": 26456
1545+
},
1546+
{
1547+
"name": "cometbft-4-6-gw",
1548+
"port": 26466,
1549+
"protocol": "TCP",
1550+
"targetPort": 26466
1551+
},
1552+
{
1553+
"name": "cometbft-4-7-gw",
1554+
"port": 26476,
1555+
"protocol": "TCP",
1556+
"targetPort": 26476
1557+
},
1558+
{
1559+
"name": "cometbft-4-8-gw",
1560+
"port": 26486,
1561+
"protocol": "TCP",
1562+
"targetPort": 26486
1563+
},
1564+
{
1565+
"name": "cometbft-4-9-gw",
1566+
"port": 26496,
1567+
"protocol": "TCP",
1568+
"targetPort": 26496
14731569
}
14741570
]
14751571
},

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class CometBftNodeConfigs {
3737
privateKey: staticConf.privateKey,
3838
identifier: this.nodeIdentifier,
3939
externalAddress: this.p2pExternalAddress(staticConf.nodeIndex),
40-
istioPort: istioCometbftExternalPort(this._domainMigrationId, staticConf.nodeIndex),
40+
istioPort: this.istioExternalPort(staticConf.nodeIndex),
4141
retainBlocks: staticConf.retainBlocks,
4242
validator: staticConf.validator,
4343
};
@@ -82,13 +82,13 @@ export class CometBftNodeConfigs {
8282
}
8383

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

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

cluster/pulumi/infra/src/istio.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
import * as k8s from '@pulumi/kubernetes';
44
import * as pulumi from '@pulumi/pulumi';
55
import { local } from '@pulumi/command';
6-
import { dsoSize, istioCometbftExternalPort } from 'splice-pulumi-common-sv';
76
import { spliceConfig } from 'splice-pulumi-common/src/config/config';
87
import { PodMonitor, ServiceMonitor } from 'splice-pulumi-common/src/metrics';
98

109
import {
1110
activeVersion,
1211
DecentralizedSynchronizerUpgradeConfig,
13-
DeploySvRunbook,
1412
ExactNamespace,
1513
getDnsNames,
1614
HELM_MAX_HISTORY_SIZE,
@@ -159,16 +157,11 @@ function configureInternalGatewayService(
159157
const externalIPRanges = loadIPRanges();
160158
// see notes when installing a CometBft node in the full deployment
161159
const cometBftIngressPorts = DecentralizedSynchronizerUpgradeConfig.runningMigrations()
162-
.map(migrationInfo => migrationInfo.id)
160+
.map(m => m.id)
163161
.flatMap((domain: number) => {
164-
return (DeploySvRunbook ? [0] : [])
165-
.concat(Array.from(Array(dsoSize).keys()).map(n => n + 1))
166-
.map(node => {
167-
return ingressPort(
168-
`cometbft-${domain}-${node}-gw`,
169-
istioCometbftExternalPort(domain, node)
170-
);
171-
});
162+
return Array.from(Array(10).keys()).map(node => {
163+
return ingressPort(`cometbft-${domain}-${node}-gw`, Number(`26${domain}${node}6`));
164+
});
172165
});
173166
return configureGatewayService(
174167
ingressNs,

0 commit comments

Comments
 (0)