From a6962723640edccab93cbc4d1df5a852fc865a33 Mon Sep 17 00:00:00 2001 From: Reeve Lorena <60775757+reeve24@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:01:02 +0100 Subject: [PATCH] fix: httpscaledobject yaml (#137) * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * fix: httpscaledobject yaml * wip * wip * wip * wip * wip * wip --------- Co-authored-by: Reeve Lorena --- .github/workflows/ci.yaml | 2 +- Dockerfile | 5 +-- .../resources/base/httpscaledobject.yml | 32 ++++++++++++------- .../base/patches/httpscaledobject.patch.json | 2 +- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 761c6c8..21f5035 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} with: diff --git a/Dockerfile b/Dockerfile index f514849..c75cedc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,8 +25,9 @@ RUN apk --no-cache --quiet update \ && apk add --no-cache --quiet rhash gettext moreutils curl bash git jq python3 py3-pip # AWS CLI -RUN pip3 install --no-python-version-warning --upgrade --quiet pip \ - && pip3 install --no-python-version-warning --quiet awscli +RUN pip3 install --no-python-version-warning --break-system-packages --upgrade pip + +RUN apk add --no-cache aws-cli # Kubectl # RUN curl -LO --silent https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl \ diff --git a/src/deploy/resources/base/httpscaledobject.yml b/src/deploy/resources/base/httpscaledobject.yml index 99f3236..a01ea96 100644 --- a/src/deploy/resources/base/httpscaledobject.yml +++ b/src/deploy/resources/base/httpscaledobject.yml @@ -1,15 +1,23 @@ -apiVersion: http.keda.sh/v1alpha1 kind: HTTPScaledObject +apiVersion: http.keda.sh/v1alpha1 metadata: - name: keda-http + name: keda-http spec: - host: "PLACEHOLDER" - targetPendingRequests: 100 - scaleTargetRef: - deployment: kube-review-deployment - service: kube-review-service - port: 80 - scaledownPeriod: 900 - replicas: - min: 0 - max: 1 + hosts: + - "PLACEHOLDER" + pathPrefixes: + - / + scaleTargetRef: + name: kube-review-deployment + kind: Deployment + apiVersion: apps/v1 + service: kube-review-service + port: 80 + replicas: + min: 0 + max: 1 + scalingMetric: + requestRate: + granularity: 1s + targetValue: 100 + window: 1m diff --git a/src/deploy/resources/base/patches/httpscaledobject.patch.json b/src/deploy/resources/base/patches/httpscaledobject.patch.json index 6c9a7d8..321257e 100644 --- a/src/deploy/resources/base/patches/httpscaledobject.patch.json +++ b/src/deploy/resources/base/patches/httpscaledobject.patch.json @@ -1,7 +1,7 @@ [ { "op": "replace", - "path": "/spec/host", + "path": "/spec/hosts/0", "value": "$KR_NAMESPACE.$KR_DOMAIN" } ]