Skip to content

Commit 01e85f4

Browse files
authored
add destination rules for sequencer high performance gRPC (#3402)
[static] Signed-off-by: Mateusz Błażejewski <mateusz.blazejewski@digitalasset.com>
1 parent 35ea4c5 commit 01e85f4

File tree

2 files changed

+262
-1
lines changed

2 files changed

+262
-1
lines changed

cluster/expected/infra/expected.json

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3395,6 +3395,74 @@
33953395
"provider": "",
33963396
"type": "kubernetes:security.istio.io/v1:AuthorizationPolicy"
33973397
},
3398+
{
3399+
"custom": true,
3400+
"id": "",
3401+
"inputs": {
3402+
"apiVersion": "networking.istio.io/v1beta1",
3403+
"kind": "DestinationRule",
3404+
"metadata": {
3405+
"name": "sv-1-global-domain-3-sequencer-high-perf-grpc-rule",
3406+
"namespace": "cluster-ingress"
3407+
},
3408+
"spec": {
3409+
"host": "global-domain-3-sequencer.sv-1.svc.cluster.local",
3410+
"trafficPolicy": {
3411+
"connectionPool": {
3412+
"http": {
3413+
"http1MaxPendingRequests": 10000,
3414+
"http2MaxRequests": 10000,
3415+
"maxConcurrentStreams": 10000,
3416+
"maxRequestsPerConnection": 0
3417+
},
3418+
"tcp": {
3419+
"maxConnections": 10000
3420+
}
3421+
},
3422+
"loadBalancer": {
3423+
"simple": "LEAST_REQUEST"
3424+
}
3425+
}
3426+
}
3427+
},
3428+
"name": "sv-1-global-domain-3-sequencer-high-perf-grpc-rule",
3429+
"provider": "",
3430+
"type": "kubernetes:networking.istio.io/v1beta1:DestinationRule"
3431+
},
3432+
{
3433+
"custom": true,
3434+
"id": "",
3435+
"inputs": {
3436+
"apiVersion": "networking.istio.io/v1beta1",
3437+
"kind": "DestinationRule",
3438+
"metadata": {
3439+
"name": "sv-1-global-domain-4-sequencer-high-perf-grpc-rule",
3440+
"namespace": "cluster-ingress"
3441+
},
3442+
"spec": {
3443+
"host": "global-domain-4-sequencer.sv-1.svc.cluster.local",
3444+
"trafficPolicy": {
3445+
"connectionPool": {
3446+
"http": {
3447+
"http1MaxPendingRequests": 10000,
3448+
"http2MaxRequests": 10000,
3449+
"maxConcurrentStreams": 10000,
3450+
"maxRequestsPerConnection": 0
3451+
},
3452+
"tcp": {
3453+
"maxConnections": 10000
3454+
}
3455+
},
3456+
"loadBalancer": {
3457+
"simple": "LEAST_REQUEST"
3458+
}
3459+
}
3460+
}
3461+
},
3462+
"name": "sv-1-global-domain-4-sequencer-high-perf-grpc-rule",
3463+
"provider": "",
3464+
"type": "kubernetes:networking.istio.io/v1beta1:DestinationRule"
3465+
},
33983466
{
33993467
"custom": true,
34003468
"id": "",
@@ -3431,6 +3499,142 @@
34313499
"provider": "",
34323500
"type": "kubernetes:security.istio.io/v1:AuthorizationPolicy"
34333501
},
3502+
{
3503+
"custom": true,
3504+
"id": "",
3505+
"inputs": {
3506+
"apiVersion": "networking.istio.io/v1beta1",
3507+
"kind": "DestinationRule",
3508+
"metadata": {
3509+
"name": "sv-da-1-global-domain-3-sequencer-high-perf-grpc-rule",
3510+
"namespace": "cluster-ingress"
3511+
},
3512+
"spec": {
3513+
"host": "global-domain-3-sequencer.sv-da-1.svc.cluster.local",
3514+
"trafficPolicy": {
3515+
"connectionPool": {
3516+
"http": {
3517+
"http1MaxPendingRequests": 10000,
3518+
"http2MaxRequests": 10000,
3519+
"maxConcurrentStreams": 10000,
3520+
"maxRequestsPerConnection": 0
3521+
},
3522+
"tcp": {
3523+
"maxConnections": 10000
3524+
}
3525+
},
3526+
"loadBalancer": {
3527+
"simple": "LEAST_REQUEST"
3528+
}
3529+
}
3530+
}
3531+
},
3532+
"name": "sv-da-1-global-domain-3-sequencer-high-perf-grpc-rule",
3533+
"provider": "",
3534+
"type": "kubernetes:networking.istio.io/v1beta1:DestinationRule"
3535+
},
3536+
{
3537+
"custom": true,
3538+
"id": "",
3539+
"inputs": {
3540+
"apiVersion": "networking.istio.io/v1beta1",
3541+
"kind": "DestinationRule",
3542+
"metadata": {
3543+
"name": "sv-da-1-global-domain-4-sequencer-high-perf-grpc-rule",
3544+
"namespace": "cluster-ingress"
3545+
},
3546+
"spec": {
3547+
"host": "global-domain-4-sequencer.sv-da-1.svc.cluster.local",
3548+
"trafficPolicy": {
3549+
"connectionPool": {
3550+
"http": {
3551+
"http1MaxPendingRequests": 10000,
3552+
"http2MaxRequests": 10000,
3553+
"maxConcurrentStreams": 10000,
3554+
"maxRequestsPerConnection": 0
3555+
},
3556+
"tcp": {
3557+
"maxConnections": 10000
3558+
}
3559+
},
3560+
"loadBalancer": {
3561+
"simple": "LEAST_REQUEST"
3562+
}
3563+
}
3564+
}
3565+
},
3566+
"name": "sv-da-1-global-domain-4-sequencer-high-perf-grpc-rule",
3567+
"provider": "",
3568+
"type": "kubernetes:networking.istio.io/v1beta1:DestinationRule"
3569+
},
3570+
{
3571+
"custom": true,
3572+
"id": "",
3573+
"inputs": {
3574+
"apiVersion": "networking.istio.io/v1beta1",
3575+
"kind": "DestinationRule",
3576+
"metadata": {
3577+
"name": "sv-global-domain-3-sequencer-high-perf-grpc-rule",
3578+
"namespace": "cluster-ingress"
3579+
},
3580+
"spec": {
3581+
"host": "global-domain-3-sequencer.sv.svc.cluster.local",
3582+
"trafficPolicy": {
3583+
"connectionPool": {
3584+
"http": {
3585+
"http1MaxPendingRequests": 10000,
3586+
"http2MaxRequests": 10000,
3587+
"maxConcurrentStreams": 10000,
3588+
"maxRequestsPerConnection": 0
3589+
},
3590+
"tcp": {
3591+
"maxConnections": 10000
3592+
}
3593+
},
3594+
"loadBalancer": {
3595+
"simple": "LEAST_REQUEST"
3596+
}
3597+
}
3598+
}
3599+
},
3600+
"name": "sv-global-domain-3-sequencer-high-perf-grpc-rule",
3601+
"provider": "",
3602+
"type": "kubernetes:networking.istio.io/v1beta1:DestinationRule"
3603+
},
3604+
{
3605+
"custom": true,
3606+
"id": "",
3607+
"inputs": {
3608+
"apiVersion": "networking.istio.io/v1beta1",
3609+
"kind": "DestinationRule",
3610+
"metadata": {
3611+
"name": "sv-global-domain-4-sequencer-high-perf-grpc-rule",
3612+
"namespace": "cluster-ingress"
3613+
},
3614+
"spec": {
3615+
"host": "global-domain-4-sequencer.sv.svc.cluster.local",
3616+
"trafficPolicy": {
3617+
"connectionPool": {
3618+
"http": {
3619+
"http1MaxPendingRequests": 10000,
3620+
"http2MaxRequests": 10000,
3621+
"maxConcurrentStreams": 10000,
3622+
"maxRequestsPerConnection": 0
3623+
},
3624+
"tcp": {
3625+
"maxConnections": 10000
3626+
}
3627+
},
3628+
"loadBalancer": {
3629+
"simple": "LEAST_REQUEST"
3630+
}
3631+
}
3632+
}
3633+
},
3634+
"name": "sv-global-domain-4-sequencer-high-perf-grpc-rule",
3635+
"provider": "",
3636+
"type": "kubernetes:networking.istio.io/v1beta1:DestinationRule"
3637+
},
34343638
{
34353639
"custom": true,
34363640
"id": "",

cluster/pulumi/infra/src/istio.ts

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,60 @@ function configurePublicInfo(ingressNs: k8s.core.v1.Namespace): k8s.apiextension
635635
: [];
636636
}
637637

638+
function configureSequencerHighPerformanceGrpcDestinationRules(
639+
ingressNs: k8s.core.v1.Namespace
640+
): Array<k8s.apiextensions.CustomResource> {
641+
return [
642+
...(function* () {
643+
for (const migration of DecentralizedSynchronizerUpgradeConfig.runningMigrations()) {
644+
for (const sv of allSvsToDeploy) {
645+
yield configureSequencerHighPerformanceGrpcDestinationRule(
646+
ingressNs,
647+
sv.nodeName,
648+
migration.id
649+
);
650+
}
651+
}
652+
})(),
653+
];
654+
}
655+
656+
function configureSequencerHighPerformanceGrpcDestinationRule(
657+
ingressNs: k8s.core.v1.Namespace,
658+
nodeName: string,
659+
migrationId: number
660+
): k8s.apiextensions.CustomResource {
661+
const sequencerName = `global-domain-${migrationId}-sequencer`;
662+
const ruleName = `${nodeName}-${sequencerName}-high-perf-grpc-rule`;
663+
return new k8s.apiextensions.CustomResource(ruleName, {
664+
apiVersion: 'networking.istio.io/v1beta1',
665+
kind: 'DestinationRule',
666+
metadata: {
667+
name: ruleName,
668+
namespace: ingressNs.metadata.name,
669+
},
670+
spec: {
671+
host: `${sequencerName}.${nodeName}.svc.cluster.local`,
672+
trafficPolicy: {
673+
loadBalancer: {
674+
simple: 'LEAST_REQUEST',
675+
},
676+
connectionPool: {
677+
http: {
678+
http1MaxPendingRequests: 10000,
679+
http2MaxRequests: 10000,
680+
maxConcurrentStreams: 10000,
681+
maxRequestsPerConnection: 0,
682+
},
683+
tcp: {
684+
maxConnections: 10000,
685+
},
686+
},
687+
},
688+
},
689+
});
690+
}
691+
638692
export function configureIstio(
639693
ingressNs: ExactNamespace,
640694
ingressIp: pulumi.Output<string>,
@@ -653,7 +707,10 @@ export function configureIstio(
653707
const gateways = configureGateway(ingressNs, gwSvc, cometBftSvc);
654708
const docsAndReleases = configureDocsAndReleases(true, gateways);
655709
const publicInfo = configurePublicInfo(ingressNs.ns);
656-
return [...gateways, ...docsAndReleases, ...publicInfo];
710+
const sequencerHighPerformanceGrpcRules = configureSequencerHighPerformanceGrpcDestinationRules(
711+
ingressNs.ns
712+
);
713+
return [...gateways, ...docsAndReleases, ...publicInfo, ...sequencerHighPerformanceGrpcRules];
657714
}
658715

659716
export function istioMonitoring(

0 commit comments

Comments
 (0)