From b8f13842bcee2c551cf99dff11b49c89692668d8 Mon Sep 17 00:00:00 2001 From: EliseCastle23 Date: Wed, 8 May 2024 14:44:35 -0600 Subject: [PATCH 1/5] adding a priority class for aws-es-proxy and adding larger requests for etl-job to test in CI environment --- gen3/bin/kube-setup-aws-es-proxy.sh | 1 + kube/services/aws-es-proxy/aws-es-proxy-deploy.yaml | 1 + .../services/aws-es-proxy/aws-es-proxy-priority-class.yaml | 7 +++++++ kube/services/jobs/etl-job.yaml | 4 ++++ 4 files changed, 13 insertions(+) create mode 100644 kube/services/aws-es-proxy/aws-es-proxy-priority-class.yaml diff --git a/gen3/bin/kube-setup-aws-es-proxy.sh b/gen3/bin/kube-setup-aws-es-proxy.sh index f13a4d411..986c5bf05 100644 --- a/gen3/bin/kube-setup-aws-es-proxy.sh +++ b/gen3/bin/kube-setup-aws-es-proxy.sh @@ -21,6 +21,7 @@ if g3kubectl get secrets/aws-es-proxy > /dev/null 2>&1; then if ES_ENDPOINT="$(aws es describe-elasticsearch-domains --domain-names ${envname}-gen3-metadata-2 --query "DomainStatusList[*].Endpoints" --output text)" \ && [[ -n "${ES_ENDPOINT}" && -n "${envname}" ]]; then gen3 roll aws-es-proxy GEN3_ES_ENDPOINT "${ES_ENDPOINT}" + g3kubectl apply -f "${GEN3_HOME}/kube/services/aws-es-proxy/aws-es-proxy-priority-class.yaml" g3kubectl apply -f "${GEN3_HOME}/kube/services/aws-es-proxy/aws-es-proxy-service.yaml" gen3_log_info "kube-setup-aws-es-proxy" "The aws-es-proxy service has been deployed onto the k8s cluster." else diff --git a/kube/services/aws-es-proxy/aws-es-proxy-deploy.yaml b/kube/services/aws-es-proxy/aws-es-proxy-deploy.yaml index ad74fc25b..34f18d973 100644 --- a/kube/services/aws-es-proxy/aws-es-proxy-deploy.yaml +++ b/kube/services/aws-es-proxy/aws-es-proxy-deploy.yaml @@ -44,6 +44,7 @@ spec: - name: credentials secret: secretName: "aws-es-proxy" + priorityClassName: aws-es-proxy-high-priority containers: - name: esproxy GEN3_AWS-ES-PROXY_IMAGE|-image: quay.io/cdis/aws-es-proxy:0.8-| diff --git a/kube/services/aws-es-proxy/aws-es-proxy-priority-class.yaml b/kube/services/aws-es-proxy/aws-es-proxy-priority-class.yaml new file mode 100644 index 000000000..6bd619a22 --- /dev/null +++ b/kube/services/aws-es-proxy/aws-es-proxy-priority-class.yaml @@ -0,0 +1,7 @@ +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: + name: aws-es-proxy-high-priority +value: 1000000 +globalDefault: false +description: "Priority class for aws-es-proxy service" diff --git a/kube/services/jobs/etl-job.yaml b/kube/services/jobs/etl-job.yaml index 6b9b887ec..92a9a5c6a 100644 --- a/kube/services/jobs/etl-job.yaml +++ b/kube/services/jobs/etl-job.yaml @@ -43,6 +43,10 @@ spec: - name: tube imagePullPolicy: Always GEN3_TUBE_IMAGE + resources: + requests: + memory: 2Gi + cpu: 2 ports: - containerPort: 80 env: From 3573ff34363ce4b78bed13ddfcb5f9b7ea727115 Mon Sep 17 00:00:00 2001 From: EliseCastle23 Date: Wed, 8 May 2024 15:03:23 -0600 Subject: [PATCH 2/5] increasing requests and resources for cronjob too --- kube/services/jobs/etl-cronjob.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kube/services/jobs/etl-cronjob.yaml b/kube/services/jobs/etl-cronjob.yaml index 95b423deb..6cb13d05c 100644 --- a/kube/services/jobs/etl-cronjob.yaml +++ b/kube/services/jobs/etl-cronjob.yaml @@ -49,6 +49,10 @@ spec: ports: - containerPort: 80 GEN3_TUBE_IMAGE + resources: + requests: + memory: 2Gi + cpu: 2 env: - name: DICTIONARY_URL valueFrom: From c7a929aab1647cfdf989f34bd11c88f0fcd2fac0 Mon Sep 17 00:00:00 2001 From: EliseCastle23 Date: Wed, 8 May 2024 15:09:11 -0600 Subject: [PATCH 3/5] adding quotes --- kube/services/jobs/etl-cronjob.yaml | 4 ++-- kube/services/jobs/etl-job.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kube/services/jobs/etl-cronjob.yaml b/kube/services/jobs/etl-cronjob.yaml index 6cb13d05c..ff05220e5 100644 --- a/kube/services/jobs/etl-cronjob.yaml +++ b/kube/services/jobs/etl-cronjob.yaml @@ -51,8 +51,8 @@ spec: GEN3_TUBE_IMAGE resources: requests: - memory: 2Gi - cpu: 2 + memory: "2Gi" + cpu: "2" env: - name: DICTIONARY_URL valueFrom: diff --git a/kube/services/jobs/etl-job.yaml b/kube/services/jobs/etl-job.yaml index 92a9a5c6a..40bd55055 100644 --- a/kube/services/jobs/etl-job.yaml +++ b/kube/services/jobs/etl-job.yaml @@ -45,8 +45,8 @@ spec: GEN3_TUBE_IMAGE resources: requests: - memory: 2Gi - cpu: 2 + memory: "2Gi" + cpu: "2" ports: - containerPort: 80 env: From ea2fc66dca39e2403761da296b023fe11ec5dc67 Mon Sep 17 00:00:00 2001 From: EliseCastle23 Date: Wed, 8 May 2024 15:13:16 -0600 Subject: [PATCH 4/5] missed that the jobs already had a limit. Fixed the syntax error. --- kube/services/jobs/etl-cronjob.yaml | 10 ++++------ kube/services/jobs/etl-job.yaml | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/kube/services/jobs/etl-cronjob.yaml b/kube/services/jobs/etl-cronjob.yaml index ff05220e5..ef60b1c28 100644 --- a/kube/services/jobs/etl-cronjob.yaml +++ b/kube/services/jobs/etl-cronjob.yaml @@ -49,10 +49,6 @@ spec: ports: - containerPort: 80 GEN3_TUBE_IMAGE - resources: - requests: - memory: "2Gi" - cpu: "2" env: - name: DICTIONARY_URL valueFrom: @@ -99,8 +95,10 @@ spec: subPath: user.yaml resources: limits: - cpu: 1 - memory: 10Gi + cpu: 2 + memory: 15Gi + requests: + cpu: 2 command: ["/bin/bash"] args: - "-c" diff --git a/kube/services/jobs/etl-job.yaml b/kube/services/jobs/etl-job.yaml index 40bd55055..6915a925c 100644 --- a/kube/services/jobs/etl-job.yaml +++ b/kube/services/jobs/etl-job.yaml @@ -43,10 +43,6 @@ spec: - name: tube imagePullPolicy: Always GEN3_TUBE_IMAGE - resources: - requests: - memory: "2Gi" - cpu: "2" ports: - containerPort: 80 env: @@ -95,8 +91,10 @@ spec: subPath: user.yaml resources: limits: - cpu: 1 - memory: 10Gi + cpu: 2 + memory: 15Gi + requests: + cpu: 2 command: ["/bin/bash" ] args: - "-c" From 103aa2af223b0aceabb4ad9093242ac537e77265 Mon Sep 17 00:00:00 2001 From: EliseCastle23 Date: Wed, 8 May 2024 15:16:37 -0600 Subject: [PATCH 5/5] reducing memory --- kube/services/jobs/etl-cronjob.yaml | 2 +- kube/services/jobs/etl-job.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kube/services/jobs/etl-cronjob.yaml b/kube/services/jobs/etl-cronjob.yaml index ef60b1c28..3c3828dac 100644 --- a/kube/services/jobs/etl-cronjob.yaml +++ b/kube/services/jobs/etl-cronjob.yaml @@ -96,7 +96,7 @@ spec: resources: limits: cpu: 2 - memory: 15Gi + memory: 10Gi requests: cpu: 2 command: ["/bin/bash"] diff --git a/kube/services/jobs/etl-job.yaml b/kube/services/jobs/etl-job.yaml index 6915a925c..266b0410c 100644 --- a/kube/services/jobs/etl-job.yaml +++ b/kube/services/jobs/etl-job.yaml @@ -92,7 +92,7 @@ spec: resources: limits: cpu: 2 - memory: 15Gi + memory: 10Gi requests: cpu: 2 command: ["/bin/bash" ]