Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions cluster/pulumi/common-sv/src/synchronizer/cometBftNodeConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CometBftNodeConfigs {
privateKey: staticConf.privateKey,
identifier: this.nodeIdentifier,
externalAddress: this.p2pExternalAddress(staticConf.nodeIndex),
istioPort: this.istioExternalPort(staticConf.nodeIndex),
istioPort: istioCometbftExternalPort(this._domainMigrationId, staticConf.nodeIndex),
retainBlocks: staticConf.retainBlocks,
validator: staticConf.validator,
};
Expand Down Expand Up @@ -80,13 +80,13 @@ export class CometBftNodeConfigs {
}

private p2pExternalAddress(nodeIndex: number): string {
return `${CLUSTER_HOSTNAME}:${this.istioExternalPort(nodeIndex)}`;
}

private istioExternalPort(nodeIndex: number) {
// TODO(#10482) Revisit port scheme
return nodeIndex >= 10
? Number(`26${this._domainMigrationId}${nodeIndex}`)
: Number(`26${this._domainMigrationId}${nodeIndex}6`);
return `${CLUSTER_HOSTNAME}:${istioCometbftExternalPort(this._domainMigrationId, nodeIndex)}`;
}
}

export const istioCometbftExternalPort = (migrationId: number, nodeIndex: number): number => {
// TODO(DACH-NY/canton-network-node#10482) Revisit port scheme
return nodeIndex >= 10
? Number(`26${migrationId}${nodeIndex}`)
: Number(`26${migrationId}${nodeIndex}6`);
};
19 changes: 13 additions & 6 deletions cluster/pulumi/infra/src/istio.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as k8s from '@pulumi/kubernetes';
import * as pulumi from '@pulumi/pulumi';
import { local } from '@pulumi/command';
import { dsoSize, istioCometbftExternalPort } from 'splice-pulumi-common-sv';
import { PodMonitor, ServiceMonitor } from 'splice-pulumi-common/src/metrics';

import {
activeVersion,
DecentralizedSynchronizerUpgradeConfig,
DeploySvRunbook,
ExactNamespace,
getDnsNames,
HELM_MAX_HISTORY_SIZE,
Expand Down Expand Up @@ -158,13 +160,18 @@ function configureInternalGatewayService(
) {
const externalIPRanges = loadIPRanges();
// see notes when installing a CometBft node in the full deployment
const cometBftIngressPorts = Array.from(
Array(DecentralizedSynchronizerUpgradeConfig.highestMigrationId + 1).keys()
).flatMap((domain: number) => {
return Array.from(Array(10).keys()).map(node => {
return ingressPort(`cometbft-${domain}-${node}-gw`, Number(`26${domain}${node}6`));
const cometBftIngressPorts = DecentralizedSynchronizerUpgradeConfig.runningMigrations()
.map(migrationInfo => migrationInfo.id)
.flatMap((domain: number) => {
return (DeploySvRunbook ? [0] : [])
.concat(Array.from(Array(dsoSize).keys()).map(n => n + 1))
.map(node => {
return ingressPort(
`cometbft-${domain}-${node}-gw`,
istioCometbftExternalPort(domain, node)
);
});
});
});
return configureGatewayService(
ingressNs,
ingressIp,
Expand Down