Skip to content

Commit

Permalink
fix(orchestrator): [k8s] use ports from config in port-forwarder
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola committed Dec 1, 2023
1 parent c7efb2a commit c580699
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions javascript/packages/orchestrator/src/providers/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export abstract class Client {
port: number,
identifier: string,
namespace?: string,
localport?: number,
): Promise<number>;
abstract runCommand(
args: string[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ export class KubeClient extends Client {
port: number,
identifier: string,
namespace?: string,
localPort?: number,
): Promise<number> {
let intents = 0;
const createTunnel = (
Expand Down Expand Up @@ -684,6 +685,7 @@ export class KubeClient extends Client {
port,
identifier,
namespace,
localPort,
);

let resolved = false;
Expand Down
10 changes: 10 additions & 0 deletions javascript/packages/orchestrator/src/spawner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,24 @@ export const spawnNode = async (
node.prometheusPrefix,
);
} else {
const external_port =
node.externalPorts![
node.substrateCliArgsVersion == 0 ? "wsPort" : "rpcPort"
];
const nodeIdentifier = `service/${podDef.metadata.name}`;
const fwdPort = await client.startPortForwarding(
endpointPort,
nodeIdentifier,
namespace,
external_port,
);

const external_port_prom = node.externalPorts!["prometheusPort"];
const nodePrometheusPort = await client.startPortForwarding(
PROMETHEUS_PORT,
nodeIdentifier,
namespace,
external_port_prom,
);

const listeningIp = opts.local_ip || LOCALHOST;
Expand Down

0 comments on commit c580699

Please sign in to comment.