KEDA: Kubernetes Event-Driven Autoscaling

แชร์
ฝัง

ความคิดเห็น • 83

  • @DevOpsToolkit
    @DevOpsToolkit  2 ปีที่แล้ว +2

    How do you scale your Kubernetes applications?

    • @nickolicbojan
      @nickolicbojan 2 ปีที่แล้ว +4

      We introduced KEDA on one of the projects with combination Python+Celery+Redis and in works as advertised in Production for scaling Deployment.
      We are also in the process of implementing it on another project where we have a dozen of different Python containers (could require significant resources) that we will orchestrate with Kafka events as they are sequential in execution by nature. We should save on resources needed for the cluster significantly since Python apps are resource hungry and processing is not time sensitive.

    • @juanitoMint
      @juanitoMint 6 หลายเดือนก่อน

      @@nickolicbojan
      You can also scale based on consumer lag for that scenario considering you have enough partitions for consumer group!
      🦾

    • @juanitoMint
      @juanitoMint 6 หลายเดือนก่อน +1

      We used HPA and VPA + Karpenter but have trouble one fighting each other on some edge cases, must be very aware about the polling events and evals

    • @DevOpsToolkit
      @DevOpsToolkit  6 หลายเดือนก่อน +2

      @juanitoMint HPA abd VPA tend to be mutually exclusive. Most of the time you can use of those but not both.

  • @felipeozoski
    @felipeozoski ปีที่แล้ว +2

    Tech videos have never been so entertaining 😊

  • @zenobikraweznick
    @zenobikraweznick ปีที่แล้ว +2

    I've just started learning for the CKAD and came across your channel, this is awesome!, thank you!

  • @stormrage8872
    @stormrage8872 2 ปีที่แล้ว +4

    Been using KEDA for over a year and it's amazing at doing what it should do. Although, connecting to default HPA on any cloud environment is an issue, as in it has to comply with the HPA timeouts and sometimes the messages are processed before the service is even able to scale, so you end up with 5 pods doing nothing for 30 seconds. I think they need a separate HPA implementation to be really really great

    • @juanitoMint
      @juanitoMint 6 หลายเดือนก่อน +1

      Did you try playing around with readinessProbe and startupProbe cause those are there for mitigating that specific situation

  • @emilelandsberg2073
    @emilelandsberg2073 2 ปีที่แล้ว +1

    Woah, great video. Really appreciate your content! Awesome. 😎🙏

  • @felipeozoski
    @felipeozoski ปีที่แล้ว +2

    Love this channel ❤ for real!!!

  • @meyogi
    @meyogi 2 ปีที่แล้ว +1

    Thank you ! Had KEDA in my 'TOTEST' list for a while but your video came at the right time : I were struggling with prometheus-adapter configuration to scale from custom metrics with HPA v2 (Istio metrics from Prometheus) instead of using CPU... But prometheus-adapter is such a nightmare to configure that I had to reach out a maintainer on Slack who confessed that this project is going to slowly be sunsetted and advised me to go back to 'metrics-server' for defaut metrics API+ KEDA for custom metrics ! 😅
    KEDA result : installation + creation of a ScaledObject + test = successful in 10 minutes ! So simple and efficient 👍
    (bye bye prometheus-adapter 👋)

  • @agun21st
    @agun21st ปีที่แล้ว +2

    I am using Karpenter to scale K8s resources from your video.

  • @АндрейБелый-ъ6х
    @АндрейБелый-ъ6х 2 หลายเดือนก่อน +1

    Спасибо!

  • @awstherapy
    @awstherapy 2 ปีที่แล้ว +1

    👋Viktor
    I really do appreciate all your content, it keeps up to date
    there's only one thing that you may enhance , get rid of that sound echo, I generally launch your video in background so , the sound quality becomes suddenly very important.
    thanks again

  • @vyrwu
    @vyrwu 2 หลายเดือนก่อน +1

    Be careful with the AWS CloudWatch scaler. We enabled it experimentally on a very short polling interval, and begun generating hundreds of $$$ of cost in calling CW API due to high cardinality of metrics we were pulling.

  • @vladoportos
    @vladoportos 2 ปีที่แล้ว +1

    Excelent as always !

  • @kamalsyed4237
    @kamalsyed4237 7 หลายเดือนก่อน +1

    awesome video, thanks

  • @marchenkoalexandr
    @marchenkoalexandr 2 ปีที่แล้ว +3

    The key thing here is that KEDA is yet another layer of abstractions on top of HPA and RS, which has its own drawbacks e.g. while scaling down a random pod will be killed instead of an idle one 🤷‍♂️

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว +2

      The same would happen without KEDA (with only HPA).
      The problem in that situation is not KEDA but Deployment and you will be in the same situation when upgrading a release as well. If killing a random pod is not acceptable, you need to look for a different resource type, something other than Deployment.

  • @steveheslouin3174
    @steveheslouin3174 2 ปีที่แล้ว +1

    i should tell my k6 folks for the sponsoring xD

  • @geofftsjy
    @geofftsjy 3 หลายเดือนก่อน +1

    I've been eyeballing KEDA to scale to 0 when an environment is not in use-not for production, but for dev, test, and staging environments. I already have a service that does this for non-k8s resources, and I think it would be perfect to add support for k8s resources to my service.

    • @DevOpsToolkit
      @DevOpsToolkit  3 หลายเดือนก่อน +1

      It depends on at least two factors.
      1. Do you have a metric that can be used to scale it up and
      2. Do you need to queue requests when it is scaled to zero.

  • @joebowbeer
    @joebowbeer 2 ปีที่แล้ว +1

    Now that you've covered KEDA, check out its sibling DAPR.

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว

      Something like th-cam.com/video/-4sHUvfk2Eg/w-d-xo.html :)

  • @Vinod_Kumar827
    @Vinod_Kumar827 6 หลายเดือนก่อน +1

    Nice video. May what is the difference between KEDA and Argo Workflow?

    • @DevOpsToolkit
      @DevOpsToolkit  6 หลายเดือนก่อน

      KEDA is used to scale kubernetes resources while argo workflows is a pipelines solution similar to Jenkins and GitHub actions.

  • @lalbinati
    @lalbinati 11 หลายเดือนก่อน +1

    Great video Viktor! thank you :)
    What would you suggest in a scenario where deployment names are not static. i.e. containing version numbers or other variable fields?
    ScaledObject "name" field doesn't seem to allow wildcards and its a mandatory field

    • @DevOpsToolkit
      @DevOpsToolkit  11 หลายเดือนก่อน +2

      I'm guessing that names are dynamic because the resources like deployments are created dynamically through some templating tool. If that's the case, can't use use that same tool to generate keda manifests as well? Alternatively, you can use admissions controllers (e.g. kyverno) to auto generate keda resources whenever deployments that match some criteria are created.

    • @juanitoMint
      @juanitoMint 6 หลายเดือนก่อน +1

      @@DevOpsToolkit Generator patters would be the simplest solution if you generate deployments then generate keda manifests as well !

  • @felipeozoski
    @felipeozoski ปีที่แล้ว +1

  • @pragyadikshit9243
    @pragyadikshit9243 3 หลายเดือนก่อน

    Awesome video

  • @1984zAm
    @1984zAm ปีที่แล้ว +1

    Hi, thanks for your video, it's nice and friendly, I have a question in your video, your pod was managed by a Deployment(no HPA), after you setup the keda autoscaling, the HPA is managing the pods, so what happened to the Deployment? is it removed or it's no longer related to the pod? is the replicas set in the Deployment working any more? thanks

    • @DevOpsToolkit
      @DevOpsToolkit  ปีที่แล้ว

      HPA is managing the deployments, not the Pods.

  • @rohitkothari7862
    @rohitkothari7862 2 ปีที่แล้ว +1

    How do you think Keda compares with Argo Events? When should one be preferred over the other? Say, I currently have different k8s job/deployment scaling needs based on AWS SQS queue and the incoming traffic (no. of requests) to my app. While Keda sounds obvious to be used here, is there any reason why Argo Events couldn't be used especially since Argo Events can also be used with triggers other than HPA or k8s Jobs (like Slack)?

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว

      In theory, you can use Argo events to trigger changes to HPA, but that is not it's primary goal and would require a few workarounds. KEDA is specifically designed for scaling.

  • @soumyadipchatterjee2267
    @soumyadipchatterjee2267 หลายเดือนก่อน +1

    You increase the load testing through K6 but how you reduce load by K6 ? Can you please elaborate

    • @DevOpsToolkit
      @DevOpsToolkit  หลายเดือนก่อน

      I'm not sure I understood the question.

  • @vishalpaalakurthi8197
    @vishalpaalakurthi8197 5 หลายเดือนก่อน +1

    Its good. But how do you handle long running transaction with lower resources and avoid the scaledown of that specific pod

    • @DevOpsToolkit
      @DevOpsToolkit  5 หลายเดือนก่อน

      When kubernetes starts the process of removing a pod (it does not matter what initiated a removal), it sends a sigterm signal to processes inside containers and waits for them to respond before it actually shuts them down. So it all depends on the processes your running.
      As a sidenote, sigterm is used in Linix in general and is not specific to containers or kubernetes.

    • @vishalpaalakurthi8197
      @vishalpaalakurthi8197 5 หลายเดือนก่อน

      What kind of response does it expect ? SIGTERM is not an rest or http call

    • @DevOpsToolkit
      @DevOpsToolkit  5 หลายเดือนก่อน

      SIGTERM is not HTTP. It's a signal Linux is sending to processes before it shuts them down. It is not specific to Kubernetes. It's a signal that, for example, a process would receive if you would execute `kill` to stop it. Your application should respond to it no matter whether it's running directly, in a container, or wherever else.
      You might want to check www.gnu.org/software/libc/manual/html_node/Termination-Signals.html.

  • @viniciusmmedeiros
    @viniciusmmedeiros 7 หลายเดือนก่อน +1

    I am using some different stack on my applications, such as Liferay and MariaDb. Can I use Keda, or even those are not in the scalers list, it is not possible to use?

    • @DevOpsToolkit
      @DevOpsToolkit  7 หลายเดือนก่อน

      As long as what you're using can be scaled horizontally and it runs in or is managed by kubernetes, the answer is yes.

  • @juanitoMint
    @juanitoMint 6 หลายเดือนก่อน +1

    So KEDA is mutating the deployments and HPA right?

    • @DevOpsToolkit
      @DevOpsToolkit  6 หลายเดือนก่อน +1

      Only HPA which, in turn, is mutating deployments.

  • @samavasi89
    @samavasi89 2 ปีที่แล้ว +1

    This looks really cool , Could you explain in high level why scaling to 0 would need knative to queue requests to the application in this case ?

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว +2

      You do not need KNative but you need something to queue requests.

    • @samavasi89
      @samavasi89 2 ปีที่แล้ว +2

      @@DevOpsToolkit What about in use case that we don’t care for lost requests when app is scaled to 0 , would it be a stupid idea to have such autoscaler for ephemeral pull request type environments that we can bring back to life only when teams want to resume their testing on (in some cases we can’t afford deleting and recreating due to using some hardcoded service nodeports that we want to persist or due to slow app startup etc) . Or does that sound like a stupid idea ?! I appreciate your inputs , been watching you on Udemy for business and here for quite a while , your explanations and the fact that you provide gists for all demos is amazing 👏!

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว +1

      @@samavasi89 ​ That's not a stupid idea at all. If you do not mind a lost request, and if you have some data you can use to decide when to scale, KEDA alone should work.

    • @piteros
      @piteros ปีที่แล้ว +1

      @@DevOpsToolkit in such case KEDA ScaledObject should have some kind of switch on/off. RIght now, I'm facing such issue, that I'm not able to simply scale down test environments to zero using KEDA (based on CPU/Memory metrics). The only way to achieve that, at the moment, is to move ScaledObjects definitions between directories in gitops repo.

    • @DevOpsToolkit
      @DevOpsToolkit  ปีที่แล้ว

      You cannot use metrics like memory and cpu to scale to zero since, in that case, there would be nothing to indicate when to scale back to one. You should use something like requests to decide when to go to zero replicas.

  • @bhavanishankar8300
    @bhavanishankar8300 ปีที่แล้ว +1

    Hello Sir,
    It is possible to use HPA with event driven autoscaling like for example to use or trigger the queue's??

    • @DevOpsToolkit
      @DevOpsToolkit  ปีที่แล้ว

      I'm not sure I understood the question. Would you like to scale pods based on queues or to put something into a queue based on some event? If it's the former, the answer is yes. If it's the latter, I suggest trying out Argo Events.

  • @choochtrain
    @choochtrain 10 หลายเดือนก่อน +1

    How can you tell (and/or control) how often the query is executed?

    • @DevOpsToolkit
      @DevOpsToolkit  10 หลายเดือนก่อน

      I remember there is a param to set the frequency but i never had the need to use it so i don't remember what is the exact param. The important thing is that it's possible to set it up and you'll need to search it in the docs.

  • @anukriti67
    @anukriti67 ปีที่แล้ว +1

    Can keda use two different events to scale ? Like if it could use both rps and some service bus event to trigger autoscaling?

    • @DevOpsToolkit
      @DevOpsToolkit  ปีที่แล้ว

      You can have multiple triggers so yes. That is doable scenario. However, bear in mind that might produce unexpected results with two triggers "fighting" who will scale up and down.

  • @zyondevelopment5717
    @zyondevelopment5717 ปีที่แล้ว +1

    Can Keda work alongside ArgoEvents? Would ArgoEvents handle the CI/CD Pipeline and Keda handle autoscaling? Or can Keda also handle CI/CD Pipeline... or vice versa?

    • @DevOpsToolkit
      @DevOpsToolkit  ปีที่แล้ว +1

      KEDA is handling only auto scaling and argo events is only in charge of receiving/watching and processing events. Neither is doing ci (pipelines) not CD (Deployments).

    • @zyondevelopment5717
      @zyondevelopment5717 ปีที่แล้ว +1

      @@DevOpsToolkit Thanks for clarifying.

  • @papasy228
    @papasy228 2 ปีที่แล้ว +1

    Can you combine this with ArgoCD? Would you use the ignoreDifferences field in the spec of the ArgoCD application?

    • @joebowbeer
      @joebowbeer 2 ปีที่แล้ว +5

      There's no problem combining with ArgoCD, similar to how HPA and ArgoCD do not conflict. The dynamically determined desired number of replicas is not manged by ArgoCD.

  • @LazarTas
    @LazarTas 2 ปีที่แล้ว +1

    Haven't got time to test but just something out of my head. Can Keda target my own HPA which is already present?

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว

      I haven't tried that combination (never had the need for it) so I'm not sure whether that's an option.

    • @joebowbeer
      @joebowbeer 2 ปีที่แล้ว +1

      To be clear, you only want one of KEDA or HPA scaling each resource. See the KEDA FAQ

    • @LazarTas
      @LazarTas 2 ปีที่แล้ว +1

      We are heavy into Pulumi so we have HPA as part of our deployments that's why i asked. Thanks for the great content Viktor

    • @PixelRobots
      @PixelRobots 2 ปีที่แล้ว +2

      @@LazarTas You will probably want to replace your HPA with Keda unless your current HPA's are fit for purpose.

  • @mzs114
    @mzs114 2 ปีที่แล้ว

    How does this compare to stock HPA? We are planning to remove Keda as the stock HPA seems to have matured.

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว

      KEDA gives you more options than HPA alone.

  • @alittlerain2110
    @alittlerain2110 2 ปีที่แล้ว +1

    Can you do same one for KEDA Selenium Grid Scaler please?

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว +1

      Adding it to my TODO list... :)

    • @thalai143
      @thalai143 หลายเดือนก่อน +1

      Were you
      Able to deploy it

  • @happyanand
    @happyanand 2 ปีที่แล้ว +1

    Can you showcase something on brainboard please ..

    • @DevOpsToolkit
      @DevOpsToolkit  2 ปีที่แล้ว +1

      Adding it to my TODO list...

  • @Babbili
    @Babbili ปีที่แล้ว +1

    can i scale Node resource ?

    • @Babbili
      @Babbili ปีที่แล้ว +1

      if they're virtualized

    • @DevOpsToolkit
      @DevOpsToolkit  ปีที่แล้ว +1

      Yes you can, horizontally. That's what cluster scalers do.