Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New ScalingSet CRD to deploy isolated interceptors+scalers #1014

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ jobs:
- name: Test
run: ARCH=${{ matrix.name }} make test

- name: Test Summary
uses: test-summary/action@032c8a9cec6aaa3c20228112cae6ca10a3b29336 # v2.3
with:
paths: |
**/*-test-report.xml
if: always()

statics:
name: Static Checks
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,6 @@ admin/Cargo.lock
*.csr
*.srl
*.ext

# test results
*-test-report.xml
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ issues:
- dupl
- unparam
- revive
- path: tests
linters:
- stylecheck
- revive
# Exclude gci check for //+kubebuilder:scaffold:imports comments. Waiting to
# resolve https://github.com/kedacore/keda/issues/4379
- path: operator/controllers/http/suite_test.go
Expand Down
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_COMMIT_SHORT ?= $(shell git rev-parse --short HEAD)

COSIGN_FLAGS ?= -y -a GIT_HASH=${GIT_COMMIT} -a GIT_VERSION=${VERSION} -a BUILD_DATE=${DATE}
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.30

define DOMAINS
basicConstraints=CA:FALSE
Expand Down Expand Up @@ -73,13 +75,19 @@ clean-test-certs:
rm -r certs || true

# Test targets
test: fmt vet test-certs
go test ./...

e2e-test:
.PHONY: install-test-deps
install-test-deps:
go install github.com/jstemmer/go-junit-report/v2@latest
go install gotest.tools/gotestsum@latest

test: fmt vet test-certs install-test-deps envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" gotestsum --junitfile unit-test-report.xml

e2e-test: install-test-deps
go run -tags e2e ./tests/run-all.go

e2e-test-local:
e2e-test-local: install-test-deps
SKIP_SETUP=true go run -tags e2e ./tests/run-all.go

# Docker targets
Expand Down Expand Up @@ -170,6 +178,10 @@ lint: ## Run golangci-lint against code.
pre-commit: ## Run static-checks.
pre-commit run --all-files

ENVTEST = $(shell pwd)/bin/setup-envtest
envtest: ## Install envtest-setup if necessary.
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-tools/cmd/[email protected]
Expand Down
361 changes: 361 additions & 0 deletions config/crd/bases/http.keda.sh_clusterhttpscalingsets.yaml

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions config/crd/bases/http.keda.sh_httpscaledobjects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ spec:
type: string
type: object
type: object
scalingSet:
description: |-
ScalingSet to be used for this HTTPScaledObject, if empty, default
interceptor and scaler will be used
properties:
kind:
description: Kind of the resource being referred to. Defaults
to HTTPScalingSet.
enum:
- HTTPScalingSet
- ClusterHTTPScalingSet
type: string
name:
description: Name of the scaling set
type: string
type: object
targetPendingRequests:
description: (optional) DEPRECATED (use ScalingMetric instead) Target
metric value
Expand Down
Loading
Loading