Skaffold - How to Build and Deploy In Kubernetes

Поделиться
HTML-код
  • Опубликовано: 25 июл 2024
  • Skaffold allows us to build, push, and deploy applications into any Kubernetes environment by combining a myriad of tools like Docker, Kaniko, Bazel, jib, Buildpacks, Helm kpt, Kustomize, kubectl, etc.
    #skaffold #kubernetes #build #deploy
    Timecodes ⏱:
    00:00 Intro
    03:55 Setup
    04:41 Initialize
    07:47 Develop
    13:07 Supported tools
    14:21 Build & deploy
    21:26 Final thoughts
    ➡ Gist with the commands: gist.github.com/0466cff59d08c...
    🔗 Skaffold: skaffold.dev
    🎬 Kaniko: • Kaniko - Building Cont...
    🎬 Argo CD: • Argo CD - Applying Git...
    🎬 GitPod: • Gitpod - Instant Devel...
    📚 DevOps Catalog, Patterns, And Blueprints: www.devopstoolkitseries.com/p...
    📚 Books and courses: www.devopstoolkitseries.com
    🎤 Podcast: www.devopsparadox.com/
    💬 Live streams: / devopsparadox
    ➡ Follow me on Twitter: / vfarcic
    ➡ Follow me on LinkedIn: / viktorfarcic
  • НаукаНаука

Комментарии • 42

  • @vimalneha
    @vimalneha 3 года назад +3

    This is exactly what I needed. Many thanks for letting us know.
    If you ever come to Munich, do let me know. I will take you around on a trip somewhere near Munich :-) Love this free channel.

  • @janjezek9333
    @janjezek9333 2 года назад +3

    Your videos are all awesome. 🚀 so tight an full of information nailed down to its essentials and melted into ~20minutes with content and caveats which are mostly not even documented in the manuals of the tools itself..

  • @underlecht
    @underlecht 3 года назад +1

    Your channel is discovery to me as i am a working with kubernetes and yes, I am the one using it at "oldest" way -- only yaml files. I see many great tools to speedup my work. I have multiple microservices, many configuration files all over the place, and now going to move to kustomize+skaffold. I saw two your videos and they are really great, without no knowledge about tool I get at least good intuition what it is built for and where could I use it for speed up my work. Going to watch more. Thank you very much !

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад

      You're welcome.
      Feel free to suggest a topic and I'll do my best to make a video out of it.

  • @JohnMitchellCalif
    @JohnMitchellCalif 2 года назад +1

    very clear and engaging! Subscribed

  • @yos2413
    @yos2413 2 года назад +1

    Thanks! This was helpful

  • @jaggyjut
    @jaggyjut 3 года назад +4

    Great video. Yes please a video on multi stage would be useful.

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад +1

      Something like ruclips.net/video/zpkqNPwEzac/видео.html :) ?

  • @shynggyskassen942
    @shynggyskassen942 Год назад +1

    THANK YOUUUU!!!!

  • @n4870s
    @n4870s 3 года назад +3

    Would love to see video for multistage builds as well as executing testa during build. Thanks

  • @andreykaparulin9214
    @andreykaparulin9214 3 года назад +1

    Thanks

  • @MrBofi82
    @MrBofi82 3 года назад +4

    Hi, great video and great tool! I have one suggestion for future show. It would be splendid if you can describe process of building image and deploying on development, QA and finally on production from point of naming convection for image builds. I think for example for every image that we build we need to have git id or tag commit in image name. Basically you can suggest few possibility how we can organize our build from development to production and to know in every moment which version we have on any environment. If you already cover this topic sorry :-).

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад +1

      That's a good one. Adding it to my TODO list...

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад

      @Pulse Care It should be building and updating the image. My best guess is that the image referenced in Skaffold manifest is not the same as the one used in the Helm chart.

  • @MarcoCarrozzo
    @MarcoCarrozzo 2 года назад +1

    very clear explanation of the tool. what if i want to execute a set of operations, with a lot of files change, before triggering the skaffold deploy again? should i run the delete - > build -> deploy commands in sequence or is there something more smart?

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад +1

      You can disable file system monitoring and run it when it suits you. There is no need to delete anything. Build and deploy should work.

  • @steven-t-e-shaw
    @steven-t-e-shaw 3 года назад +2

    Thanks, Skaffold looks pretty good. Do you know of any similar tools? I'm definitely all for a client-side vendor-agnostic tool like this. The closest other tools used to be Cloud Foundry and OpenShift. Both require server-side components though. Microsoft had a dev-only tool for k8s called Draft. I haven't looked at CF in years, it does seem to have switched from home-grown cluster management to Kubernetes. I want a truly vendor-agnostic tool though. It should deploy to anything e.g. AWS ECS, Lambda, Fargate, Cloud Run. Non-container dev configurations would be welcome too - as, I suppose for completeness, would non-container production workloads. I did find a Skaffold plugin for ECS on GitHub, so Skaffold is looking good on the vendor- and k8s-agnostic front. I'm not fond of YAML for configuration but, hey, that's the industry standard :).
    Thanks again for the video. Your channel is great!

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад +1

      I haven't used anything else that is similar to it or, at least, I cannot remember using something like it recently :(

    • @panteliskaramolegkos2693
      @panteliskaramolegkos2693 2 года назад +1

      I believe Cloud Code VSCode extension is doing something similar

    • @Matt-gx1mk
      @Matt-gx1mk 2 года назад +2

      Tilt is somewhat similar from what I've heard, though I haven't used Skaffold extensively enough to really say conclusively

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад

      ruclips.net/video/fkODRlobR9I/видео.html

  • @barefeg
    @barefeg 3 года назад

    One issue I have with skaffold is the lack of customization in the deployment step. I can hack around the building process to inject extra arguments when calling skaffold for example. But I can’t do the same on deploy. The hack is to do some of the deployment stuff during build and just kubectl apply

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад +1

      I feel the same and typically use the deployment part while developing, but skip it when deploying to permanent envs (e.g. production) in favor of solutions like Argo CD.

  • @amabamo5769
    @amabamo5769 3 года назад +1

    What do you think about bazel? I seen that SpaceX is using it, but by reading examples and tutorial i am confused it doesn't look clear for a simple minded man like me :D

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад +1

      I tried it a while ago, but did not get far. At the time, it was mostly for building Java and C++ and I already switched to Go. Did it extend its reach further?

    • @amabamo5769
      @amabamo5769 3 года назад +1

      @@DevOpsToolkit From what i see there are rules for many languages and for some frameworks like kubernetes too.

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад

      As you can see, I am not up to date with that one. Need to check it again...

  • @ManiandMadin
    @ManiandMadin 2 года назад +1

    How to implement scaffold using ci/cd, can you suggest any example

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад +1

      It should be straightforward. All you have to do is execute from a pipeline the same commands you'd run from your terminal. All CI/CD pipelines are following the same logic. They allow you to execute commands.

  • @alxx736
    @alxx736 3 года назад +1

    Here from Argentina! Hi ! What if 2 or more developers are coding in the same service ? Will they overwrite the pods in the remote cluster ? Which is the solution? Thanks in advance!

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад +1

      The solution is not to use `skaffold` or any other tool manually from your terminal, unless you're deploying to your private dev environment. Push changes to Git and let tools like Argo CD, Flux, or CI/CD pipelines do the work. In that case, you can control things through, let's say, PRs.

    • @alxx736
      @alxx736 3 года назад +1

      @@DevOpsToolkit Thanks ! I understand that,but i dont want to push the changes,i need to test my microservice,and of course i wont have all the microservice architecture replicated on my laptop. Telepresence it s great,but the same problem 2 or more developers working in the same service.

    • @DevOpsToolkit
      @DevOpsToolkit  3 года назад

      When you are running on your laptop, you do not have the issue of "2 or more developers coding in the same service", at least not for the app you're working on. Now, if you want to make the app running on your laptop communicate with an app running somewhere else, you can set up a cluster (or segment of a cluster) that will have the same releases as, let's say, production. In other words, you work on your app which communicates with other apps. You app can be running locally, in your namespace, or anywhere else.
      Now, I'm not sure why is there a problem if 2 or more developers work on the same app. Does everyone works in their own branch which is later merged to a common one or is everyone working on the same branch as well? If it's the latter, is everyone pushing changes to that branch and merging their local copy with the remote one? I have a feeling that the problem is not related to how you deploy an app.
      I almost certainly misunderstood your question. It might be easier to have a "real" chat. If that sounds good, please send me a private message on Twitter (@vfarcic) and we can organize a chat so that I better understand your use-case and, maybe, give a better answer.

  • @datacruncher1564
    @datacruncher1564 2 года назад +1

    Does Skaffold replace fluxcd and argocd?

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад +4

      That depends on how you look at it. Argo CD, Flux, Skaffold, Helm, Kustomize, etc. are the tools that are managing resources in your Kubernetes clusters. From that perspective, any of them (or a combination of them) is doing the same thing. However, the way they do that is very different. Skaffold as well as Helm and Kustomize are imperative. They do whatever you tell them to do it. Argo CD and Flux, on the other hand, are GitOps tools. They are not waiting for you to execute a command. They are constantly monitoring your Git repositories and making sure that they desired and the actual state are in sync.
      If I would have to choose (as I often do), I would not use Skaffold for anything but local development and switch to Argo CD or Flux when working with "real" servers.

    • @datacruncher1564
      @datacruncher1564 2 года назад +1

      @@DevOpsToolkit Thanks! I have a suggestion, nothing negative. But in joined frames, the gap between sentences was so short that I had to concentrate hard. Also your image was zoomed in and out. So it created distraction while focusing on the content. I watched, 2 other videos and felt the same, while watching the third video.
      Maybe the other audience didn't feel like me.

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад +1

      @@datacruncher1564 That's great feedback. Thanks a ton for that. I'll talk with the editor and see how we can improve it.
      Background about the current way it's edited: Only around 1/4 of the raw material ends up in a video. We remove all the mistakes, empty lag (e.g., me thinking what to do next), and so on. If we do not zoom in/out on cuts, it looks like a bit strange as well, especially since my head might not be in the same place. On the other hand, as you said, if we do zoom in/out, it is a distraction.
      In any case, this is great feedback. We'll try to improve how we do editing.

  • @pesceenrico9359
    @pesceenrico9359 2 года назад +1

    It's cool for very light projects, but if I need to download every code modification 100MB of dependencies the process becomes very slow!

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад +3

      You don't need to download all the dependencies every time you make changes to the code. Container image layers are cached as long as you have Dockerfile instructions in the correct order.

    • @pesceenrico9359
      @pesceenrico9359 2 года назад +1

      @@DevOpsToolkit thank you for the feedback!! is it the sync bidirectional?

    • @DevOpsToolkit
      @DevOpsToolkit  2 года назад +1

      @@pesceenrico9359 Not that I know. It goes from your laptop to the cluster/pod/container, and not the other way around.
      I'm curious about the use for for it being bidirectional.