diff --git a/src/main/k8s/dev/duchy_eks.cue b/src/main/k8s/dev/duchy_eks.cue index 70d7df40e18..687640ec0b8 100644 --- a/src/main/k8s/dev/duchy_eks.cue +++ b/src/main/k8s/dev/duchy_eks.cue @@ -33,12 +33,12 @@ _duchyCertName: "duchies/\(_duchyName)/certificates/\(_certificateId)" #StorageServiceAccount: "storage" #InternalServerResourceRequirements: #ResourceRequirements & { requests: { - cpu: "75m" + cpu: "500m" } } #HeraldResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { - cpu: "25m" + cpu: "200m" memory: "512Mi" } limits: { @@ -68,26 +68,27 @@ _duchyCertName: "duchies/\(_duchyName)/certificates/\(_certificateId)" } #HmssMillMaxHeapSize: "5G" #HmssMillMaxConcurrency: 5 +#ApiServerReplicas: 4 #FulfillmentResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { - cpu: "200m" - memory: "576Mi" + cpu: "500m" + memory: "2000Mi" } limits: { memory: ResourceRequirements.requests.memory } } -#FulfillmentMaxHeapSize: "320M" +#FulfillmentMaxHeapSize: "1500M" #ControlServiceResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { - cpu: "200m" - memory: "512Mi" + cpu: "500m" + memory: "3000Mi" } limits: { memory: ResourceRequirements.requests.memory } } -#ControlServiceMaxHeapSize: "320M" +#ControlServiceMaxHeapSize: "2500M" objectSets: [defaultNetworkPolicies] + [ for objectSet in duchy {objectSet}] @@ -144,8 +145,11 @@ duchy: #PostgresDuchy & { _javaOptions: maxHeapSize: #ControlServiceMaxHeapSize resources: #ControlServiceResourceRequirements } - spec: template: spec: #ServiceAccountPodSpec & { - serviceAccountName: #StorageServiceAccount + spec: { + replicas: #ApiServerReplicas + template: spec: #ServiceAccountPodSpec & { + serviceAccountName: #StorageServiceAccount + } } } "requisition-fulfillment-server-deployment": { @@ -153,16 +157,22 @@ duchy: #PostgresDuchy & { _javaOptions: maxHeapSize: #FulfillmentMaxHeapSize resources: #FulfillmentResourceRequirements } - spec: template: spec: #ServiceAccountPodSpec & { - serviceAccountName: #StorageServiceAccount + spec: { + replicas: #ApiServerReplicas + template: spec: #ServiceAccountPodSpec & { + serviceAccountName: #StorageServiceAccount + } } } "internal-api-server-deployment": { _container: { resources: #InternalServerResourceRequirements } - spec: template: spec: #ServiceAccountPodSpec & { - serviceAccountName: #InternalServerServiceAccount + spec: { + replicas: #ApiServerReplicas + template: spec: #ServiceAccountPodSpec & { + serviceAccountName: #InternalServerServiceAccount + } } } } diff --git a/src/main/k8s/dev/duchy_gke.cue b/src/main/k8s/dev/duchy_gke.cue index 25116f9ef8c..43926a76df4 100644 --- a/src/main/k8s/dev/duchy_gke.cue +++ b/src/main/k8s/dev/duchy_gke.cue @@ -34,12 +34,12 @@ _duchy_cert_name: "duchies/\(_duchy_name)/certificates/\(_certificateId)" #StorageServiceAccount: "storage" #InternalServerResourceRequirements: #ResourceRequirements & { requests: { - cpu: "75m" + cpu: "500m" } } #HeraldResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { - cpu: "25m" + cpu: "200m" memory: "512Mi" } limits: { @@ -69,26 +69,27 @@ _duchy_cert_name: "duchies/\(_duchy_name)/certificates/\(_certificateId)" } #HmssMillMaxHeapSize: "5G" #HmssMillMaxConcurrency: 5 +#ApiServerReplicas: 4 #FulfillmentResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { - cpu: "200m" - memory: "576Mi" + cpu: "500m" + memory: "2000Mi" } limits: { memory: ResourceRequirements.requests.memory } } -#FulfillmentMaxHeapSize: "320M" +#FulfillmentMaxHeapSize: "1500M" #ControlServiceResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { - cpu: "200m" - memory: "512Mi" + cpu: "500m" + memory: "3000Mi" } limits: { memory: ResourceRequirements.requests.memory } } -#ControlServiceMaxHeapSize: "320M" +#ControlServiceMaxHeapSize: "2500M" objectSets: [defaultNetworkPolicies] + [ for objectSet in duchy {objectSet}] @@ -134,8 +135,11 @@ duchy: #SpannerDuchy & { _container: { resources: #InternalServerResourceRequirements } - spec: template: spec: #ServiceAccountPodSpec & { - serviceAccountName: #InternalServerServiceAccount + spec: { + replicas: #ApiServerReplicas + template: spec: #ServiceAccountPodSpec & { + serviceAccountName: #InternalServerServiceAccount + } } } "herald-daemon-deployment": { @@ -155,8 +159,11 @@ duchy: #SpannerDuchy & { _javaOptions: maxHeapSize: #ControlServiceMaxHeapSize resources: #ControlServiceResourceRequirements } - spec: template: spec: #ServiceAccountPodSpec & { - serviceAccountName: #StorageServiceAccount + spec: { + replicas: #ApiServerReplicas + template: spec: #ServiceAccountPodSpec & { + serviceAccountName: #StorageServiceAccount + } } } "requisition-fulfillment-server-deployment": { @@ -164,8 +171,11 @@ duchy: #SpannerDuchy & { _javaOptions: maxHeapSize: #FulfillmentMaxHeapSize resources: #FulfillmentResourceRequirements } - spec: template: spec: #ServiceAccountPodSpec & { - serviceAccountName: #StorageServiceAccount + spec: { + replicas: #ApiServerReplicas + template: spec: #ServiceAccountPodSpec & { + serviceAccountName: #StorageServiceAccount + } } } } diff --git a/src/main/k8s/dev/kingdom_gke.cue b/src/main/k8s/dev/kingdom_gke.cue index 404d81f1d13..dd38a6a39d9 100644 --- a/src/main/k8s/dev/kingdom_gke.cue +++ b/src/main/k8s/dev/kingdom_gke.cue @@ -33,10 +33,23 @@ _systemApiAddressName: string @tag("system_api_address_name") // a thread, so this should be greater than the number of Heralds. #SystemServerGrpcThreads: 5 +#ApiServerReplicas: 2 + #InternalServerResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { cpu: "500m" - memory: "352Mi" + memory: "1024Mi" + } + limits: { + memory: ResourceRequirements.requests.memory + } +} + + +#PublicServerResourceRequirements: ResourceRequirements=#ResourceRequirements & { + requests: { + cpu: "500m" + memory: "1024Mi" } limits: { memory: ResourceRequirements.requests.memory @@ -45,8 +58,8 @@ _systemApiAddressName: string @tag("system_api_address_name") #OperationalMetricsJobResourceRequirements: ResourceRequirements=#ResourceRequirements & { requests: { - cpu: "10m" - memory: "256Mi" + cpu: "500m" + memory: "1024Mi" } limits: { memory: ResourceRequirements.requests.memory @@ -95,8 +108,12 @@ kingdom: #Kingdom & { _grpcThreadPoolSize: #InternalServerGrpcThreads resources: #InternalServerResourceRequirements } - spec: template: spec: #ServiceAccountPodSpec & { - serviceAccountName: #InternalServerServiceAccount + spec: { + replicas: #ApiServerReplicas + template: spec: #ServiceAccountPodSpec & { + serviceAccountName: #InternalServerServiceAccount + _javaOptions: maxHeapSize: "800M" + } } } "system-api-server": { @@ -104,6 +121,13 @@ kingdom: #Kingdom & { _grpcThreadPoolSize: #SystemServerGrpcThreads } } + "v2alpha-public-api-server": { + spec: replicas: #ApiServerReplicas + _container: { + resources: #PublicServerResourceRequirements + _javaOptions: maxHeapSize: "800M" + } + } } cronJobs: { diff --git a/src/main/terraform/aws/cmms/duchies.tf b/src/main/terraform/aws/cmms/duchies.tf index 69594d83949..6c14e55296f 100644 --- a/src/main/terraform/aws/cmms/duchies.tf +++ b/src/main/terraform/aws/cmms/duchies.tf @@ -28,7 +28,7 @@ module "clusters" { subnet_ids = module.vpc.private_subnets vpc_id = module.vpc.vpc_id default_instance_types = ["m5.large"] - default_max_node_count = 2 + default_max_node_count = 10 high_perf_instance_types = ["c5.xlarge"] high_perf_max_node_count = 20 } diff --git a/src/main/terraform/aws/examples/duchy/main.tf b/src/main/terraform/aws/examples/duchy/main.tf index adbc32fdeae..0777d1e3b87 100644 --- a/src/main/terraform/aws/examples/duchy/main.tf +++ b/src/main/terraform/aws/examples/duchy/main.tf @@ -85,7 +85,7 @@ module "cluster" { subnet_ids = module.vpc.private_subnets vpc_id = module.vpc.vpc_id default_instance_types = ["m5.large"] - default_max_node_count = 2 + default_max_node_count = 5 high_perf_instance_types = ["c5.xlarge"] high_perf_max_node_count = 20 } diff --git a/src/main/terraform/gcloud/cmms/duchies.tf b/src/main/terraform/gcloud/cmms/duchies.tf index ca881e728db..eeb32618828 100644 --- a/src/main/terraform/gcloud/cmms/duchies.tf +++ b/src/main/terraform/gcloud/cmms/duchies.tf @@ -31,7 +31,7 @@ module "default_node_pools" { name = "default" service_account = module.common.cluster_service_account machine_type = "e2-standard-2" - max_node_count = 2 + max_node_count = 10 } module "highmem_node_pools" { diff --git a/src/main/terraform/gcloud/cmms/kingdom.tf b/src/main/terraform/gcloud/cmms/kingdom.tf index b9db8ee059d..9163ebac51f 100644 --- a/src/main/terraform/gcloud/cmms/kingdom.tf +++ b/src/main/terraform/gcloud/cmms/kingdom.tf @@ -28,7 +28,7 @@ module "kingdom_default_node_pool" { cluster = module.kingdom_cluster.cluster service_account = module.common.cluster_service_account machine_type = "e2-custom-2-4096" - max_node_count = 3 + max_node_count = 5 } module "kingdom" {