Deploy a Nest.js App With Docker + Kubernetes on Google Cloud

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • In this tutorial, we Dockerize a Nest.js application and deploy it to a Kubernetes cluster using Google Kubernetes Engine.
    Github: github.com/mguay22/nestjs-k8s
    Install Docker: docs.docker.com/get-docker/
    Install Google Cloud SDK: cloud.google.com/sdk/docs/ins...
    Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/
  • Věda a technologie

Komentáře • 49

  • @mguay
    @mguay  Před 5 měsíci +1

    Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/

  • @Algo-Concept
    @Algo-Concept Před 3 měsíci +1

    Awesome ! So straight forward ! I was looking for a simple, quick and advanced tutorial of k8s, you made my day :)

  • @rohit-gupta
    @rohit-gupta Před rokem +1

    This is crazy. Free tutorial. i’ve been looking for a tutorial like this. Thanks a ton 🙏

  • @scottamolinari
    @scottamolinari Před 2 lety

    Funny, I was just about to go looking at how to do this. Thanks for the instruction.

  • @mariosfrixou7003
    @mariosfrixou7003 Před rokem

    I wish I could hit the like button more times. This a great tutorial thank you!

  • @shalitha98
    @shalitha98 Před 2 lety

    Thanks man, It's working perfectly :)

  • @felipechavesdeoliveira4785

    Great tutorial, I think you should have a series regarding nestjs + microservices. Something a little bit more real world-like. Anyways, you are a good communicator and make things easy to understand, thanks!

    • @mguay
      @mguay  Před rokem +3

      My new Ultimate Nest.js Microservices course will cover this! Stay tuned for its release in May.

  • @MarkusTheUnnamed
    @MarkusTheUnnamed Před rokem

    Great video man really appreciate it

  • @sz-sb1pe
    @sz-sb1pe Před rokem

    great content. Wondering what would be a good way to add the environment variable.

  • @selub1058
    @selub1058 Před 3 měsíci

    Great! Thank you.

  • @iamsekz
    @iamsekz Před rokem

    GKE autopilot is marvelous

  • @kemekenneth
    @kemekenneth Před rokem

    Awesome video Michael. However, I was wondering if the multiple steps can be combined into a single step.
    Can we rm -rf the node_modules then install --only=production?
    Also, is the 2nd COPY . . necessary since all we need is /usr/src/app/dist?

  • @ronsearch
    @ronsearch Před rokem

    Great tutorial. Thanks! Which one do you think is cheaper Digital Ocean or Google Kubernetes Cloud for production?

  • @saurabhtalele1537
    @saurabhtalele1537 Před rokem

    Great video Nice please also teach us how to deploy database... And to store env file for security.....❤❤❤

  • @titoffen
    @titoffen Před 2 lety +3

    Awesome tutorial Michael. I'm a Docker/Kubernetes n00b and this video has taught me so much! I love the way you guide your audience through. One thing I'd love to learn about is how to update an already-deployed container. I'm not sure about the terminology here... hot reload? Is there a way to streamline that process? Thank you! 🙏🏻

    • @mguay
      @mguay  Před 2 lety +2

      We can pass a custom command to the container in a docker-compose.yml file (like running Nest in dev mode). I have a new video coming out shortly that demonstrates this.

    • @titoffen
      @titoffen Před 2 lety

      @@mguay great! Thanks!

    • @TheBrorkanin
      @TheBrorkanin Před 7 měsíci

      Hey did you ever find out how to update the already-deployed container? 😅

  • @sachinmishra5218
    @sachinmishra5218 Před rokem

    Do you think we should add node_modules folder in docker container regardless running npm run build ? I think we should add .dockerfile file for node_modules because we don't need them

  • @tntg5
    @tntg5 Před 2 lety

    Thanks for your help!
    I followed your tutorial except for one step, where I made my docker repo private. That cause authentication issues and I could figure out a way to make it work. Even after configuring my docker credential in kubectl.
    Do you any recommendations on this issue?

  • @monawwarabdullah7438
    @monawwarabdullah7438 Před rokem

    your video are great, i learned about nest.js microservices.
    can you make a video on deploying multiple nest.js microservices to different ports (maybe using Docker)

  • @arv-ls7zw
    @arv-ls7zw Před měsícem

    Nice Video

  • @a.nk.r7209
    @a.nk.r7209 Před 2 lety

    I'm just learning the K8s and it's difficult for me to understand. Thanks for your tutorial

  • @leejinglim5893
    @leejinglim5893 Před rokem

    Can you make a video about how to setup CICD pipeline like jenkins to automate the deploying process to kubernetes on aws/google cloud?

  • @jonathanferreira-qx2eo

    Hey man, do you have any material explaining how to secure HTTPS our nestJS app on GKE ?

  • @michaelyao9389
    @michaelyao9389 Před 2 lety

    I just wondering what your ram size is? 32GB or 64GB? My 2015 16GB mbp struggles with running k8s locally.

  • @sadhakbj
    @sadhakbj Před rokem

    Awesome content, i have two questions:
    1. Locally if I want to have a completely localized docker development environment, how can I achieve that so that I can develop locally on any machine which does not have node or MySQL or any other required services installed?
    2. If I wanted to have a separate docker image for the MySQL / redis, how could I have achieved that? May be if my app on prod wants to communicate to google's cloudsql / aws rds?
    Please let me know if you have covered these things in any videos or you have premium udemy course which covers this, I am very eager to buy that if it exists.

  • @jithinpg619
    @jithinpg619 Před 11 měsíci

    Everything works for me as above procedure, but my real question is how can i map this static ip with my purchased domain in GCP?

  • @nishanthakumara8472
    @nishanthakumara8472 Před 2 lety

    Great explanation. Thanks
    Small question, How can we access this service on port 80 instead of 3000?

    • @mguay
      @mguay  Před 2 lety +1

      I believe we can just change the target port on the service.

  • @alexshubin1
    @alexshubin1 Před rokem

    2:40 I think it is better to run 'npm ci' instead of 'npm imstall' if you want to use package-lock. Otherwise why to copy it at all?

  • @avibhatnagar2963
    @avibhatnagar2963 Před rokem +2

    Everything worked perfectly for me till the end but When I am making the postman request, I get ECONNREFUSED error. How can i fix this?

    • @maheenmalik3922
      @maheenmalik3922 Před rokem

      I am having the same error. Were you able to resolve it?

    • @labhamjain3915
      @labhamjain3915 Před rokem

      Are you sure you are typing the correct url? Try going from browser first

  • @jithinpg619
    @jithinpg619 Před 11 měsíci

    how can i use this in cloud run?

  • @abc_cba
    @abc_cba Před rokem

    11:09 Hi here is where I am getting stuck with this error :
    $ kubectl create -f deployment.yaml
    "Unable to connect to the server: dial tcp: lookup kubernetes.docker.internal: no such host" please help

  • @umutyalcn1914
    @umutyalcn1914 Před 2 lety

    Great tutorial, i have a question how can i deploy with docker-compose file (contains Postgresql) on GCP?

    • @mguay
      @mguay  Před 2 lety +1

      Thank you! Take a look here: cloud.google.com/compute/docs/containers/deploying-containers

  • @user-pf4wy2em9r
    @user-pf4wy2em9r Před rokem

    Even i have followed the same steps.
    1) I will be able to run the application locally.
    2) I will be able to create docker image with same configuration by multi stage
    3) I have started through docker swarm an its working.
    4) will be able to push to registry as well.
    5) While i am trying to get the image to cluster and applying through deployment.yaml my containers are getting restart and going to crashback.
    6) I fi use your image its working.
    Can you please explain how and what is the change.
    Below is the image which i have created and uploaded to registery.(docker pull suryarh/nestjs:2)

  • @praveenbhawantha
    @praveenbhawantha Před rokem

    I have my node.js app, can i use that to follow the next steps? Or are there any changes that i have to add?

    • @mguay
      @mguay  Před rokem

      Everything should be about the same. Just make sure you’re using the correct port.

  • @MrGenbu
    @MrGenbu Před 6 měsíci

    There is no need for the last COPY . . , Like why did we build it even ?

  • @adriandrozman3404
    @adriandrozman3404 Před 2 lety

    Any plans to showcase a deployment to AWS K8S?

    • @mguay
      @mguay  Před 2 lety +2

      I could definitely give this a go.

    • @paneurhythmie
      @paneurhythmie Před rokem

      @@mguay I'll be interessted on that too. 😊

  • @clickclackcoder2544
    @clickclackcoder2544 Před 2 lety

    Is it okay if I define a namespace?

  • @dailymeow3283
    @dailymeow3283 Před 2 lety

    Your videos are great, just if you could zoom in your screen so we can watch on mobile