How to do Canary Deployment with Kubernetes

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 27

  • @Abhishekkumar-su7pd
    @Abhishekkumar-su7pd 3 роки тому +1

    isn't it obivious, if you create 8 pods in v1 and 2pods in V2. it will route 80% of the traffic to v1. Is there any way to automate this thing? for example, it started with 80-20% and after succesful test it proceed further.

    • @nilesh-gule
      @nilesh-gule  3 роки тому +1

      hi Abhishek,
      Ideally it should route 80% oof the traffic. However, I did find that Kubernetes uses its own algorithm to distribute the traffic.
      Yes it is possible to automate this. This can be based on checking things like healthcheck endpoint or time bound checks for some metrics like error rates within span of 30 mins or 1 hour etc. Many CI CD tools allow you to progressively increase traffic in steps.
      Here is an example
      docs.harness.io/article/2xp0oyubjj-create-a-kubernetes-canary-deployment
      Istio service mesh allows to specify the traffic increments
      medium.com/containers-101/fully-automated-canary-deployments-in-kubernetes-70a671105273
      Hope this helps.

  • @RishiRajxtrim
    @RishiRajxtrim 19 днів тому +1

    great!

  • @sushilkumar-wl8kj
    @sushilkumar-wl8kj 2 роки тому +2

    Wow.. very nice way to explain.... thankyou

  • @lvjagadeesh
    @lvjagadeesh 11 місяців тому +1

    Nice video with practical demonstration! Can we automate this using single helm chart by having 2 deployment yaml in it? And deploy using azure devops yaml?

    • @nilesh-gule
      @nilesh-gule  11 місяців тому

      hi Jagadeesh,
      Thanks for appreciation. Yes it should be possible to achieve this using a Helm chart and to trigger the deployment using Azure DevOps or other CI CD platforms like Github actions, Gitlab or Jenkins etc. I have not tried it out. I have couple of videos relatd to Helm and CI CD using GitHUb actions coming soon. Subscribe tot his channel for those.
      If you are interested you can also raise a pull request to the Cloud Native Ninja series repository by making the necessary changes to deploy the application using Azure DevOps.
      github.com/NileshGule/cloud-native-ninja

    • @lvjagadeesh
      @lvjagadeesh 11 місяців тому +1

      @@nilesh-gule thanks for your reply! I have a doubt… after setting up the flagger can I still use existing nginx virtual server routes(vsr) for route configuration to my deployment workload and do load testing in flagger for progressive rollouts?

    • @nilesh-gule
      @nilesh-gule  11 місяців тому

      Yes you can do it. The whole purpose of canary deployment is to use it for progressive rollout. Another option is to use the Rolling Updates strategy.

  • @bhavanavavilala5953
    @bhavanavavilala5953 10 місяців тому +1

    The replicas are manually updated to depict the idea of canary deployment, but wn comes to live projects, this isn't the way Canary deployment works i suppose. Tools like kong for canary deployment are used tk provide weightage details on how much traffic should ne routed to v1 and v2

    • @nilesh-gule
      @nilesh-gule  10 місяців тому

      hi Bhavana,
      you are right. This demo shows how Canary deployment works in Kubernetes. In real life project you would use a CI/CD pipeline to update the Kubernetes release. It can also be done using GitOps. Kong Gateway or Istio service Mesh can be used to change the weightage.

  • @adrian88cash
    @adrian88cash 2 роки тому +1

    Thanks you very much!

    • @nilesh-gule
      @nilesh-gule  2 роки тому

      You're welcome! Glad that you found it useful

  • @Jilla-kutty
    @Jilla-kutty 2 роки тому +1

    Thank you so much for explanation. Please make video for difference between canary Vs Blue/green deployment.

    • @nilesh-gule
      @nilesh-gule  2 роки тому

      You can refer to this playlist
      I have covered different deployment strategies including Blue Green deployment, Rolling Updates, Canary Release and Recreate Strategy
      Kubernetes Deployment Strategies
      ua-cam.com/play/PLOPXEdTIaFO84i0PNQFOShRMr63OXn797.html

  • @rrryu4757
    @rrryu4757 2 роки тому +1

    Hey, do we need to keep pod count as 10 to split traffic between pods?

    • @nilesh-gule
      @nilesh-gule  2 роки тому +1

      You can keep the pod count to anything as per your application requirement. I took 10 as the count as it is easier to explain. Based on the selector and labels the Kubernetes service will be able to route the traffic to the matching pods.

    • @rrryu4757
      @rrryu4757 2 роки тому

      @@nilesh-gule Thank You!

  • @randra1
    @randra1 3 роки тому +1

    Awesome!

    • @nilesh-gule
      @nilesh-gule  3 роки тому

      Thanks. Glad you found it useful.

  • @subhankarhotta7094
    @subhankarhotta7094 2 роки тому +1

    Hi Nilesh, thanks for the wonderful explanation. This canary deployment could have also been done using kubectl rollout right?

    • @nilesh-gule
      @nilesh-gule  2 роки тому

      Yes, you can use kubectl rollout command as well.

  • @RafaelDurelli
    @RafaelDurelli 2 роки тому +1

    Nice video thanks a lot. Could u make a video using ingress such as traefik to control the percentage of traffic? Thanks a lot

    • @nilesh-gule
      @nilesh-gule  2 роки тому +1

      Thanks for the suggestion. Will add it to my to do list for upcoming videos

  • @parames3039
    @parames3039 2 роки тому +1

    Great video , blue green deployment with lambda services is it possible can you explain how can we achieve

    • @nilesh-gule
      @nilesh-gule  2 роки тому

      hi Parames,
      Let me try this out.