Optimize Node.js Development Workflows in Kubernetes with Skaffold and Rancher Desktop

Rate this content
Bookmark

In this talk, you will learn how to optimise your Node.js development and release workflow to Kubernetes with Skaffold and Rancher Desktop. Using these tools together helps enhance the local K8s development experience mirroring a real cluster experience, as well as the release workflow you would have for your remote cluster. We will cover the challenges of local Kubernetes development, how Skaffold and Rancher Desktop help, demonstrations of local releases to a cluster and how to use the same configuration for remote cluster releases.

This talk has been presented at DevOps.js Conf 2022, check out the latest edition of this JavaScript Conference.

FAQ

Lucan de Muela is a Principal Technical Evangelist at SUSE.

The main tools discussed are Scaffold and Rancher Desktop.

Rancher Desktop simplifies the cluster management lifecycle by providing an intuitive UI that allows users to easily upgrade or reset their cluster with just a few clicks. It also lets users choose between ContainerD and DockerD as their container runtime.

Skaffold automates and abstracts the process of building and deploying container images, enhancing the inter-development loop by detecting local changes and triggering a deployment pipeline.

Lucan demonstrated how to use Rancher Desktop and Scaffold for local Kubernetes development. He showed how changes in the application code are detected by Scaffold, which then builds the application, runs tests, and deploys it locally, providing a seamless development experience.

In Rancher Desktop, users can update the Kubernetes version, toggle between ContainerD and DockerD for the container runtime, and modify the virtual machine's memory and CPU settings directly from the interface.

Scaffold uses a configuration file, typically named scaffold.yaml, to manage the build and deployment processes. This file contains definitions for building Docker images, running tests, and deploying resources using kubectl.

Lukonde Mwila
Lukonde Mwila
9 min
25 Mar, 2022

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Lucan de Muela discusses how to optimize Node.js development workflows in Kubernetes using Scaffold and Rancher Desktop. He highlights the developer experience, cluster management simplification with Rancher Desktop, and build/release workflow optimization with Scaffold. He also mentions the ability to update Kubernetes versions and choose a container runtime, as well as the option to reset the cluster for a safe development environment.

1. Optimizing Node.js Workflows in Kubernetes

Short description:

Hi, I'm Lucan de Muela, a Principal Technical Evangelist at SUSE. In this lightning talk, I'll show you how to optimize your Node.js development workflows in Kubernetes with Scaffold and Rancher Desktop. We'll consider the developer experience, how Rancher Desktop simplifies cluster management, optimizing build and release workflows with Scaffold, and a demo. Kubernetes solves real problems, and Rancher Desktop and Scaffold can complement core developer priorities while incorporating DevOps practices. Rancher Desktop is an intuitive UI that simplifies cluster management, and Skaffold automates the process of building and deploying container images. Let's take a quick look at them in action.

Hi there, I'm Lucan de Muela, or you can call me Luke. I'm going to be talking to you about optimizing your Node.js development workflows in Kubernetes with Scaffold and Rancher Desktop. I'm a Principal Technical Evangelist at SUSE, so you can feel free to get in touch with me on various social media platforms, whether it's Twitter or LinkedIn, following me on GitHub, or subscribing to my YouTube channel.

Now, this is a lightning talk, but I've still got some golden nuggets that you can walk away with in a short amount of time. For starters, we're going to consider the developer experience when building your Node.js apps for Kubernetes. Then, we'll look at how Rancher Desktop simplifies the cluster management life cycle, followed by optimizing build and release workflows with Scaffold, and then we'll cap it off with a demo. Which is usually everyone's favorite part.

Now, if you're a developer and you've got experience working on cloud-native apps, you might actually have been reluctant to tune into this session, because you want to focus on your application development. Kubernetes is predominantly seen as a separate world that shouldn't get in the way of what you should be prioritizing. Personally, I agree with that. However, there's a slight conundrum because Kubernetes does solve real problems. And your team might be dealing with those problems, and so Kubernetes might be a solution that's in the bigger picture of your architecture. So you have to be a part of the journey either way.

And this is where things get even trickier because there's different ideas around who should own what. Now, my goal is to demonstrate how Rancher Desktop and Scaffold can complement the core developer priorities and still incorporate DevOps practices like release workflows for application deployments to your Kubernetes cluster. An example of this would be going beyond NodeMod. Now, I love using NodeMod when building out my Node.js apps because it quickly rebuilds the changes and I get to see those reflected. But what if you could accomplish that with a full CICD pipeline on your local machine with all the intricacies abstracted away, but still remaining configurable for a local context as well as for remote deployments? We'll take a look at that shortly.

Now, the first tool in this solution is Rancher Desktop. RD is a desktop application available on Windows, Linux, and Mac. It's an electron-based application that wraps a host of components under the hood with a virtual machine running K3S and either ContainerD or DockerD, depending on your configuration choice. In the end, you have an intuitive UI that simplifies the cluster management process, and you can easily upgrade or reset your cluster with just a few clicks.

The second tool in this solution, or one-two punch in mind, is Skaffold. And Skaffold's goal is to simplify the Kubernetes development workflow by automating and abstracting away the process of building and deploying container images. The inter-development loop of iteratively coding, building, and testing your apps is something that can be enhanced by Skaffold, because it will take your local changes and trigger a pipeline for deployment whenever it detects them. And this is especially helpful for debugging your apps before they end up in the final target cluster. So using RD and Skaffold enables developers to stay focused on application optimization because they give you the combination of a cluster that's easy to interact with and manage, and a configurable workflow process that is automated and abstracts the DevOps details. So let's take a look at this in action real quick. As you can see, I've got Rancher Desktop open and running, and I'm currently in the Kubernetes settings section. And over here, a lot of the main things that happen around your Kubernetes cluster management and optimization would actually be consolidated in this particular section.

2. Updating Kubernetes Version and Cluster Reset

Short description:

You can easily update your Kubernetes version and choose a container runtime. You can modify the virtual machine and reset the cluster. There's also a reset button for hard resets, providing a safe environment for local cluster development.

So as you can see, I can easily update my Kubernetes version just by using this dropdown over here. And this will obviously depend on the particular version that you or your team have agreed upon. In addition to that, if you wanted to choose a particular container runtime between ContainerD and DockerD, that's something that you can toggle with over here. And then you have different situations when it comes to your applications. You might find that some are memory intensive, some are compute intensive, but you want to have the opportunity to modify the virtual machine that you're working with. And so you can do that over here by updating the particular memory in the CPU, and that will just reset your cluster. And also, if you did need to do a hard reset to delete all the workloads and the configuration that you had set up, for whatever reason, you could simply hit the reset button over here. And that's cool, especially when it comes to local cluster development because you have the safety of the blast radius not impacting other people or other teams. But nonetheless, you want to be able to have a nice way of just ejecting and starting all over again.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Levelling up Monorepos with npm Workspaces
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Levelling up Monorepos with npm Workspaces
Top Content
NPM workspaces help manage multiple nested packages within a single top-level package, improving since the release of NPM CLI 7.0. You can easily add dependencies to workspaces and handle duplications. Running scripts and orchestration in a monorepo is made easier with NPM workspaces. The npm pkg command is useful for setting and retrieving keys and values from package.json files. NPM workspaces offer benefits compared to Lerna and future plans include better workspace linking and adding missing features.
It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Node Congress 2022Node Congress 2022
26 min
It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Top Content
The talk discusses the importance of supply chain security in the open source ecosystem, highlighting the risks of relying on open source code without proper code review. It explores the trend of supply chain attacks and the need for a new approach to detect and block malicious dependencies. The talk also introduces Socket, a tool that assesses the security of packages and provides automation and analysis to protect against malware and supply chain attacks. It emphasizes the need to prioritize security in software development and offers insights into potential solutions such as realms and Deno's command line flags.
Automating All the Code & Testing Things with GitHub Actions
React Advanced 2021React Advanced 2021
19 min
Automating All the Code & Testing Things with GitHub Actions
Top Content
We will learn how to automate code and testing with GitHub Actions, including linting, formatting, testing, and deployments. Automating deployments with scripts and Git hooks can help avoid mistakes. Popular CI-CD frameworks like Jenkins offer powerful orchestration but can be challenging to work with. GitHub Actions are flexible and approachable, allowing for environment setup, testing, deployment, and custom actions. A custom AppleTools Eyes GitHub action simplifies visual testing. Other examples include automating content reminders for sharing old content and tutorials.
Fine-tuning DevOps for People over Perfection
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Fine-tuning DevOps for People over Perfection
Top Content
DevOps is a journey that varies for each company, and remote work makes transformation challenging. Pull requests can be frustrating and slow, but success stories like Mateo Colia's company show the benefits of deploying every day. Challenges with tools and vulnerabilities require careful consideration and prioritization. Investing in documentation and people is important for efficient workflows and team growth. Trust is more important than excessive control when deploying to production.
Towards a Standard Library for JavaScript Runtimes
Node Congress 2022Node Congress 2022
34 min
Towards a Standard Library for JavaScript Runtimes
Top Content
There is a need for a standard library of APIs for JavaScript runtimes, as there are currently multiple ways to perform fundamental tasks like base64 encoding. JavaScript runtimes have historically lacked a standard library, causing friction and difficulty for developers. The idea of a small core has both benefits and drawbacks, with some runtimes abusing it to limit innovation. There is a misalignment between Node and web browsers in terms of functionality and API standards. The proposal is to involve browser developers in conversations about API standardization and to create a common standard library for JavaScript runtimes.
ESM Loaders: Enhancing Module Loading in Node.js
JSNation 2023JSNation 2023
22 min
ESM Loaders: Enhancing Module Loading in Node.js
ESM Loaders enhance module loading in Node.js by resolving URLs and reading files from the disk. Module loaders can override modules and change how they are found. Enhancing the loading phase involves loading directly from HTTP and loading TypeScript code without building it. The loader in the module URL handles URL resolution and uses fetch to fetch the source code. Loaders can be chained together to load from different sources, transform source code, and resolve URLs differently. The future of module loading enhancements is promising and simple to use.

Workshops on related topic

Node.js Masterclass
Node Congress 2023Node Congress 2023
109 min
Node.js Masterclass
Top Content
Workshop
Matteo Collina
Matteo Collina
Have you ever struggled with designing and structuring your Node.js applications? Building applications that are well organised, testable and extendable is not always easy. It can often turn out to be a lot more complicated than you expect it to be. In this live event Matteo will show you how he builds Node.js applications from scratch. You’ll learn how he approaches application design, and the philosophies that he applies to create modular, maintainable and effective applications.

Level: intermediate
Build and Deploy a Backend With Fastify & Platformatic
JSNation 2023JSNation 2023
104 min
Build and Deploy a Backend With Fastify & Platformatic
WorkshopFree
Matteo Collina
Matteo Collina
Platformatic allows you to rapidly develop GraphQL and REST APIs with minimal effort. The best part is that it also allows you to unleash the full potential of Node.js and Fastify whenever you need to. You can fully customise a Platformatic application by writing your own additional features and plugins. In the workshop, we’ll cover both our Open Source modules and our Cloud offering:- Platformatic OSS (open-source software) — Tools and libraries for rapidly building robust applications with Node.js (https://oss.platformatic.dev/).- Platformatic Cloud (currently in beta) — Our hosting platform that includes features such as preview apps, built-in metrics and integration with your Git flow (https://platformatic.dev/). 
In this workshop you'll learn how to develop APIs with Fastify and deploy them to the Platformatic Cloud.
Building a Hyper Fast Web Server with Deno
JSNation Live 2021JSNation Live 2021
156 min
Building a Hyper Fast Web Server with Deno
WorkshopFree
Matt Landers
Will Johnston
2 authors
Deno 1.9 introduced a new web server API that takes advantage of Hyper, a fast and correct HTTP implementation for Rust. Using this API instead of the std/http implementation increases performance and provides support for HTTP2. In this workshop, learn how to create a web server utilizing Hyper under the hood and boost the performance for your web apps.
0 to Auth in an Hour Using NodeJS SDK
Node Congress 2023Node Congress 2023
63 min
0 to Auth in an Hour Using NodeJS SDK
WorkshopFree
Asaf Shen
Asaf Shen
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool.
We will enhance a full-stack JS application (Node.JS backend + React frontend) to authenticate users with OAuth (social login) and One Time Passwords (email), including:- User authentication - Managing user interactions, returning session / refresh JWTs- Session management and validation - Storing the session for subsequent client requests, validating / refreshing sessions
At the end of the workshop, we will also touch on another approach to code authentication using frontend Descope Flows (drag-and-drop workflows), while keeping only session validation in the backend. With this, we will also show how easy it is to enable biometrics and other passwordless authentication methods.
Table of contents- A quick intro to core authentication concepts- Coding- Why passwordless matters
Prerequisites- IDE for your choice- Node 18 or higher
Deploying React Native Apps in the Cloud
React Summit 2023React Summit 2023
88 min
Deploying React Native Apps in the Cloud
WorkshopFree
Cecelia Martinez
Cecelia Martinez
Deploying React Native apps manually on a local machine can be complex. The differences between Android and iOS require developers to use specific tools and processes for each platform, including hardware requirements for iOS. Manual deployments also make it difficult to manage signing credentials, environment configurations, track releases, and to collaborate as a team.
Appflow is the cloud mobile DevOps platform built by Ionic. Using a service like Appflow to build React Native apps not only provides access to powerful computing resources, it can simplify the deployment process by providing a centralized environment for managing and distributing your app to multiple platforms. This can save time and resources, enable collaboration, as well as improve the overall reliability and scalability of an app.
In this workshop, you’ll deploy a React Native application for delivery to Android and iOS test devices using Appflow. You’ll also learn the steps for publishing to Google Play and Apple App Stores. No previous experience with deploying native applications is required, and you’ll come away with a deeper understanding of the mobile deployment process and best practices for how to use a cloud mobile DevOps platform to ship quickly at scale.