From e954b0be29d99f1f40bc898f93830cdab7959414 Mon Sep 17 00:00:00 2001 From: sheril5 Date: Wed, 29 May 2024 21:37:51 +0530 Subject: [PATCH] added req and limit to tekton task --- .../templates/cosign-verify.yaml | 13 +++++-- .../templates/cosign.yaml | 7 ++++ .../templates/deploy.yaml | 35 +++++++++++++++++++ .../templates/get-changed-files.yaml | 7 ++++ .../templates/get-commit-id.yaml | 7 ++++ .../templates/gitclone.yaml | 7 ++++ .../templates/github-set-status.yaml | 7 ++++ .../templates/gitlab-set-status.yaml | 7 ++++ .../templates/helm-deploy.yaml | 35 +++++++++++++++++++ .../templates/kaniko.yaml | 14 ++++++++ .../templates/qt-test.yaml | 7 ++++ 11 files changed, 143 insertions(+), 3 deletions(-) diff --git a/cicd/tekton-cluster-tasks/templates/cosign-verify.yaml b/cicd/tekton-cluster-tasks/templates/cosign-verify.yaml index df2d25a..171414b 100644 --- a/cicd/tekton-cluster-tasks/templates/cosign-verify.yaml +++ b/cicd/tekton-cluster-tasks/templates/cosign-verify.yaml @@ -8,12 +8,19 @@ spec: - description: The image to be signed by cosign. name: image type: string - steps: - - image: ghcr.io/kube-tarian/helmrepo-supporting-tools/cosign:v2.2.2 - name: cosign-sign - name: registry description: "registry" type: string + steps: + - image: ghcr.io/kube-tarian/helmrepo-supporting-tools/cosign:v2.2.2 + name: cosign-sign + resources: + limits: + cpu: 200m + memory: 300Mi + requests: + cpu: 3m + memory: 20Mi resources: {} script: | #!/usr/bin/env bash diff --git a/cicd/tekton-cluster-tasks/templates/cosign.yaml b/cicd/tekton-cluster-tasks/templates/cosign.yaml index bbbfbb3..7025ff9 100644 --- a/cicd/tekton-cluster-tasks/templates/cosign.yaml +++ b/cicd/tekton-cluster-tasks/templates/cosign.yaml @@ -21,6 +21,13 @@ spec: steps: - name: cosign-sign image: ghcr.io/kube-tarian/helmrepo-supporting-tools/cosign:v2.2.2 + resources: + limits: + cpu: 200m + memory: 300Mi + requests: + cpu: 3m + memory: 20Mi script: | #!/usr/bin/env bash mkdir -p ~/.docker/ diff --git a/cicd/tekton-cluster-tasks/templates/deploy.yaml b/cicd/tekton-cluster-tasks/templates/deploy.yaml index c975297..176ddf9 100644 --- a/cicd/tekton-cluster-tasks/templates/deploy.yaml +++ b/cicd/tekton-cluster-tasks/templates/deploy.yaml @@ -44,6 +44,13 @@ spec: - name: clone-repo image: ghcr.io/kube-tarian/helmrepo-supporting-tools/git:v2.26.2 + resources: + limits: + cpu: 50m + memory: 60Mi + requests: + cpu: 10m + memory: 20Mi env: - name: GIT_PROJECT_URL value: $(params.gitProjectUrl) @@ -55,6 +62,13 @@ spec: git clone https://${GIT_USERNAME}:${GIT_TOKEN}@${GIT_PROJECT_URL} /workspace/source - image: ghcr.io/kube-tarian/helmrepo-supporting-tools/git:v2.26.2 + resources: + limits: + cpu: 50m + memory: 60Mi + requests: + cpu: 10m + memory: 20Mi name: update-yaml env: - name: DIRECTORY @@ -74,6 +88,13 @@ spec: - name: commit-push-changes-gitops image: ghcr.io/kube-tarian/helmrepo-supporting-tools/git:v2.26.2 + resources: + limits: + cpu: 300m + memory: 200Mi + requests: + cpu: 50m + memory: 40Mi env: - name: USER_EMAIL value: $(params.userEmail) @@ -93,6 +114,13 @@ spec: - name: wait-for-argocd-rollout image: ghcr.io/kube-tarian/helmrepo-supporting-tools/argocd:v2.6.15 + resources: + limits: + cpu: 300m + memory: 200Mi + requests: + cpu: 50m + memory: 40Mi env: - name: ARGOCD_APP_NAME value: $(params.clusterName) @@ -110,6 +138,13 @@ spec: - name: check-argocd-status image: ghcr.io/kube-tarian/helmrepo-supporting-tools/argocd:v2.6.15 + resources: + limits: + cpu: 50m + memory: 60Mi + requests: + cpu: 10m + memory: 20Mi env: - name: ARGOCD_APP_NAME value: $(params.clusterName) diff --git a/cicd/tekton-cluster-tasks/templates/get-changed-files.yaml b/cicd/tekton-cluster-tasks/templates/get-changed-files.yaml index 9228879..b5c2b06 100644 --- a/cicd/tekton-cluster-tasks/templates/get-changed-files.yaml +++ b/cicd/tekton-cluster-tasks/templates/get-changed-files.yaml @@ -10,6 +10,13 @@ spec: steps: - name: get-changed-files image: ghcr.io/kube-tarian/helmrepo-supporting-tools/build1:latest + resources: + limits: + cpu: 200m + memory: 100Mi + requests: + cpu: 50m + memory: 30Mi script: | #!/bin/sh git config --global --add safe.directory /workspace/source diff --git a/cicd/tekton-cluster-tasks/templates/get-commit-id.yaml b/cicd/tekton-cluster-tasks/templates/get-commit-id.yaml index f886f76..678fe1e 100644 --- a/cicd/tekton-cluster-tasks/templates/get-commit-id.yaml +++ b/cicd/tekton-cluster-tasks/templates/get-commit-id.yaml @@ -11,6 +11,13 @@ spec: steps: - name: get-latest-commit-id image: ghcr.io/kube-tarian/helmrepo-supporting-tools/curl:latest + resources: + limits: + cpu: 200m + memory: 100Mi + requests: + cpu: 50m + memory: 30Mi script: | export TOKEN=`cat /workspace/basic-auth/password` COMMIT_ID=$(curl -s -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/$(params.REPONAME)/commits/$(params.REVISION)" | jq -r '.sha') diff --git a/cicd/tekton-cluster-tasks/templates/gitclone.yaml b/cicd/tekton-cluster-tasks/templates/gitclone.yaml index e4a69e6..b35246f 100644 --- a/cicd/tekton-cluster-tasks/templates/gitclone.yaml +++ b/cicd/tekton-cluster-tasks/templates/gitclone.yaml @@ -123,6 +123,13 @@ spec: steps: - name: clone image: "$(params.gitInitImage)" + resources: + limits: + cpu: 200m + memory: 100Mi + requests: + cpu: 50m + memory: 30Mi env: - name: HOME value: "$(params.userHome)" diff --git a/cicd/tekton-cluster-tasks/templates/github-set-status.yaml b/cicd/tekton-cluster-tasks/templates/github-set-status.yaml index ed9a793..6c18ee3 100644 --- a/cicd/tekton-cluster-tasks/templates/github-set-status.yaml +++ b/cicd/tekton-cluster-tasks/templates/github-set-status.yaml @@ -138,6 +138,13 @@ spec: value: $(params.SHEBANG) image: $(params.IMAGE) + resources: + limits: + cpu: 100m + memory: 200Mi + requests: + cpu: 2m + memory: 4Mi script: | #!$(params.SHEBANG) diff --git a/cicd/tekton-cluster-tasks/templates/gitlab-set-status.yaml b/cicd/tekton-cluster-tasks/templates/gitlab-set-status.yaml index e63bbdd..c6c140c 100644 --- a/cicd/tekton-cluster-tasks/templates/gitlab-set-status.yaml +++ b/cicd/tekton-cluster-tasks/templates/gitlab-set-status.yaml @@ -91,6 +91,13 @@ spec: steps: - name: set-status image: registry.access.redhat.com/ubi8/python-38@sha256:af6f93b81f9313de95966e8cd681edb9dbcb5fdbddc5a4cc365af8e4534096ef + resources: + limits: + cpu: 100m + memory: 200Mi + requests: + cpu: 2m + memory: 4Mi script: | #!/usr/libexec/platform-python diff --git a/cicd/tekton-cluster-tasks/templates/helm-deploy.yaml b/cicd/tekton-cluster-tasks/templates/helm-deploy.yaml index 81047bd..922603e 100644 --- a/cicd/tekton-cluster-tasks/templates/helm-deploy.yaml +++ b/cicd/tekton-cluster-tasks/templates/helm-deploy.yaml @@ -44,6 +44,13 @@ spec: - name: clone-repo image: ghcr.io/kube-tarian/helmrepo-supporting-tools/git:v2.26.2 + resources: + limits: + cpu: 50m + memory: 60Mi + requests: + cpu: 10m + memory: 20Mi env: - name: GIT_PROJECT_URL value: $(params.gitProjectUrl) @@ -55,6 +62,13 @@ spec: git clone https://${GIT_USERNAME}:${GIT_TOKEN}@${GIT_PROJECT_URL} /workspace/source - image: ghcr.io/kube-tarian/helmrepo-supporting-tools/git:v2.26.2 + resources: + limits: + cpu: 50m + memory: 60Mi + requests: + cpu: 10m + memory: 20Mi name: update-yaml env: - name: DIRECTORY @@ -73,6 +87,13 @@ spec: - name: commit-push-changes-gitops image: ghcr.io/kube-tarian/helmrepo-supporting-tools/git:v2.26.2 + resources: + limits: + cpu: 300m + memory: 200Mi + requests: + cpu: 50m + memory: 40Mi env: - name: USER_EMAIL value: $(params.userEmail) @@ -92,6 +113,13 @@ spec: - name: wait-for-argocd-rollout image: ghcr.io/kube-tarian/helmrepo-supporting-tools/argocd:v2.6.15 + resources: + limits: + cpu: 300m + memory: 200Mi + requests: + cpu: 50m + memory: 40Mi env: - name: ARGOCD_APP_NAME value: $(params.clusterName) @@ -109,6 +137,13 @@ spec: - name: check-argocd-status image: ghcr.io/kube-tarian/helmrepo-supporting-tools/argocd:v2.6.15 + resources: + limits: + cpu: 50m + memory: 60Mi + requests: + cpu: 10m + memory: 20Mi env: - name: ARGOCD_APP_NAME value: $(params.clusterName) diff --git a/cicd/tekton-cluster-tasks/templates/kaniko.yaml b/cicd/tekton-cluster-tasks/templates/kaniko.yaml index 9e3b2d3..63c53c4 100644 --- a/cicd/tekton-cluster-tasks/templates/kaniko.yaml +++ b/cicd/tekton-cluster-tasks/templates/kaniko.yaml @@ -46,6 +46,13 @@ spec: - name: build-and-push workingDir: $(workspaces.source.path) image: $(params.BUILDER_IMAGE) + resources: + limits: + cpu: 1000m + memory: 1500Mi + requests: + cpu: 500m + memory: 300Mi args: - $(params.EXTRA_ARGS) - --dockerfile=$(params.DOCKERFILE) @@ -62,6 +69,13 @@ spec: - name: write-url workingDir: $(workspaces.source.path) image: ghcr.io/kube-tarian/helmrepo-supporting-tools/bash:5.1.4 + resources: + limits: + cpu: 100m + memory: 200Mi + requests: + cpu: 2m + memory: 5Mi script: | set -e image="$(params.IMAGE)" diff --git a/cicd/tekton-cluster-tasks/templates/qt-test.yaml b/cicd/tekton-cluster-tasks/templates/qt-test.yaml index 0e92e2e..210f3d2 100644 --- a/cicd/tekton-cluster-tasks/templates/qt-test.yaml +++ b/cicd/tekton-cluster-tasks/templates/qt-test.yaml @@ -30,6 +30,13 @@ spec: steps: - name: install-and-run-qt image: ghcr.io/intelops/quality-trace/cli:latest + resources: + limits: + cpu: 100m + memory: 200Mi + requests: + cpu: 2m + memory: 5Mi script: | # Configure and Run Quality-trace CLI