Skip to content

Commit

Permalink
feat: New ScalingSet CRD to deploy isolated interceptors+scalers
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <[email protected]>
  • Loading branch information
JorTurFer committed May 12, 2024
1 parent 7d1740a commit 4e793d6
Show file tree
Hide file tree
Showing 70 changed files with 5,474 additions and 104 deletions.
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
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ GO_LDFLAGS="-X github.com/kedacore/http-add-on/pkg/build.version=${VERSION} -X g
GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_COMMIT_SHORT ?= $(shell git rev-parse --short HEAD)

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29

define DOMAINS
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
Expand Down Expand Up @@ -71,13 +74,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 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 @@ -160,6 +169,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 @@ -151,6 +151,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 SscalingMetric instead) Target
metric value
Expand Down
Loading

0 comments on commit 4e793d6

Please sign in to comment.