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

Initial step towards v2 #731

Merged
merged 8 commits into from
Apr 8, 2020
Merged

Initial step towards v2 #731

merged 8 commits into from
Apr 8, 2020

Conversation

zroubalik
Copy link
Member

@zroubalik zroubalik commented Apr 6, 2020

Initial step towards v2.

This version should able to scale any Resource that implements /scale subresource, ie. Deployment, StatefulSet, ArgoRollout etc. KEDA should be able to get secrets from container and TriggerAuthentication - the same as previous version.

Scaling of Job is not implemented yet.

Instructions on how to try this version, please give it a try:

git clone git@github.com:zroubalik/keda.git -b v2
cd keda
kubectl apply -f deploy/crds/keda.sh_scaledobjects_crd.yaml
kubectl apply -f deploy/crds/keda.sh_scaledjob_crd.yaml
kubectl apply -f deploy/crds/keda.sh_triggerauthentications_crd.yaml
kubectl apply -f deploy/
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: {scaled-object-name}
spec:
  scaleTargetRef:
    apiVersion:    {apiVersion-of-object-to-scale}     # Optional. Default: apps/v1
    kind:          {kind-of-object-to-scale}.          # Optional. Default: Deployment
    name:          {name-of-object-to-scale}
    containerName: {name-of-container-to-lookup-env}   # Optional.
  pollingInterval: 30  # Optional. Default: 30 seconds
  cooldownPeriod:  300 # Optional. Default: 300 seconds
  minReplicaCount: 0   # Optional. Default: 0
  maxReplicaCount: 100 # Optional. Default: 100
  triggers:
  # {list of triggers to activate the deployment}

Major changes

  • update operator-sdk & deps, k8s v0.17.4
  • introduce version 2.0.0-alpha1
  • change apiGroup to keda.sh
  • introduce separate ScaledObject and ScaledJob
  • ScaledObject scales any resource with /scale subresource

Fixes #703
Fixes #701
Fixes #552
Fixes #595
Fixes #497
Partial fix for #653

pkg/util/gvkr.go Outdated Show resolved Hide resolved
@@ -7,7 +7,7 @@ import (

servicebus "github.com/Azure/azure-service-bus-go"

"github.com/Azure/azure-amqp-common-go/v2/auth"
"github.com/Azure/azure-amqp-common-go/v3/auth"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious about the update. Is it intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to update as much dependencies to the latest versions as possible. This was brought by updating some of the Azure deps. I was forced to update this particular import due to changes in the api. We can try to revert this, if you think that it is a problem.

@zroubalik
Copy link
Member Author

I will follow up with more PRs once this one gets into v2 branch. There are still things to be done, eg. ScaledJobs, refactoring of resolvEnv functions, autoscaling v2beta2, etc.

I didn't want to put all the changes into one PR, as it would be hard to review it.

Once you are OK with this PR, let me know and I will push these commits into v2 branch. master branch is not being affected by this PR.

@tomkerkhove
Copy link
Member

You are a hero!

ycabrer and others added 8 commits April 8, 2020 13:06
…re#732)

Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
@zroubalik
Copy link
Member Author

I am going to merge this one into v2 branch and follow up with some PRs that are building on top of this initial work.

@tomkerkhove
Copy link
Member

Ok for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants