<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ramón Lamana</title>
    <description>The latest articles on Forem by Ramón Lamana (@rlamana).</description>
    <link>https://forem.com/rlamana</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F211705%2Fbd60ba37-61af-4a7c-97ef-5784929a1f9f.jpeg</url>
      <title>Forem: Ramón Lamana</title>
      <link>https://forem.com/rlamana</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rlamana"/>
    <language>en</language>
    <item>
      <title>How to Develop and Debug Node.js Applications on Kubernetes</title>
      <dc:creator>Ramón Lamana</dc:creator>
      <pubDate>Thu, 24 Sep 2020 08:18:04 +0000</pubDate>
      <link>https://forem.com/okteto/how-to-develop-and-debug-node-js-applications-on-kubernetes-i4f</link>
      <guid>https://forem.com/okteto/how-to-develop-and-debug-node-js-applications-on-kubernetes-i4f</guid>
      <description>&lt;p&gt;&lt;a href="https://kubernetes.io/" rel="noopener noreferrer"&gt;Kubernetes&lt;/a&gt; is an open-source project for automating deployment, scaling, and management of containers. It has rapidly become the standard to run production workloads and the community around it is just great!&lt;/p&gt;

&lt;p&gt;But developing on Kubernetes presents some challenges. The typical development workflow looks like this: write code, build a Docker image, push it to the registry, redeploy, validate your changes and repeat. This flow is not only slow, but it also prevents us from benefiting from standard features of the Node.js ecosystem such as application hot-reloaders or debuggers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/okteto/okteto" rel="noopener noreferrer"&gt;Okteto&lt;/a&gt; was created to solve this problem. On this blog post, we will show you how Okteto improves the developer experience in Kubernetes for Node.js developers. You will be able to take full advantage of tools like &lt;code&gt;nodemon&lt;/code&gt;, dependency caching or IDE debuggers while developing your application directly on Kubernetes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Deploy the Node.js Sample App
&lt;/h2&gt;

&lt;p&gt;Get a local version of the Node.js Sample App by executing the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git clone https://github.com/okteto/node-getting-started
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;node-getting-started
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;k8s.yml&lt;/code&gt; file contains the &lt;a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="noopener noreferrer"&gt;Kubernetes manifests&lt;/a&gt; to deploy the Node.js Sample App. Run the application by executing:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can deploy to your own Kubernetes cluster or give &lt;a href="https://cloud.okteto.com/" rel="noopener noreferrer"&gt;Okteto Cloud&lt;/a&gt; a try. Okteto Cloud is a development platform for Kubernetes applications. Sign up today to get a free developer account with 4 CPUs and 8GB of RAM.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; k8s.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;deployment.apps "hello-world" created
service "hello-world" created
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is cool! You typed one command and a dev version of your application just runs 😎.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Install the Okteto CLI
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/okteto/okteto" rel="noopener noreferrer"&gt;Okteto CLI&lt;/a&gt; is an open-source project that lets you develop your applications directly on Kubernetes while taking advantage of well-known local tooling. We will use it to speed up our development cycle instead of using the typical development workflow based on building docker images and redeploying containers.&lt;/p&gt;

&lt;p&gt;Install the Okteto CLI:&lt;/p&gt;

&lt;h3&gt;
  
  
  MacOS / Linux
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;curl https://get.okteto.com &lt;span class="nt"&gt;-sSfL&lt;/span&gt; | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;Download &lt;a href="https://downloads.okteto.com/cli/okteto.exe" rel="noopener noreferrer"&gt;https://downloads.okteto.com/cli/okteto.exe&lt;/a&gt; and add it to your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Create your okteto manifest
&lt;/h2&gt;

&lt;p&gt;To start developing on the Node.js Sample App you first need to create an okteto manifest.&lt;br&gt;
With the Node.js Sample App deployed, run the following command to create your &lt;a href="https://dev.to/docs/reference/manifest"&gt;okteto manifest&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;okteto init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;This command walks you through creating an okteto manifest.
It only covers the most common items, and tries to guess sensible defaults.
See https://okteto.com/docs/reference/manifest for the official documentation about the okteto manifest.
Use the arrow keys to navigate: ↓ ↑ → ←
Select the deployment you want to develop:
  ▸ hello-world
    Use default values
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;okteto init&lt;/code&gt; command will scan the available deployments in your Kubernetes namespace, and ask you to pick one.&lt;br&gt;
Select the &lt;code&gt;hello-world&lt;/code&gt; deployment. It's the one we deployed on the previous step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt; ✓  hello-world
 ✓  Deployment 'hello-world' successfully analyzed
 ✓  okteto manifest (okteto.yml) created
 i  Run 'okteto up' to activate your development container
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;okteto init&lt;/code&gt; command creates the following &lt;code&gt;okteto.yml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;hello-world&lt;/span&gt;
&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;okteto/node:12&lt;/span&gt;
&lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
&lt;span class="na"&gt;sync&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.:/usr/src/app&lt;/span&gt;
&lt;span class="na"&gt;forward&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;3000:3000&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;9229:9229&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file defines how to activate a development container for the Node.js Sample App:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;name&lt;/code&gt;: the name of the Kubernetes deployment you want to put on development mode.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;image&lt;/code&gt;: the image used by the development container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;command&lt;/code&gt;: the start command of the development container. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sync&lt;/code&gt;: the folders that will be synchronized between your local machine and the development container. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;forward&lt;/code&gt;: a list of ports to forward from your development container.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, the &lt;code&gt;okteto init&lt;/code&gt; command creates a &lt;code&gt;.stignore&lt;/code&gt; file to indicate which files shouldn't be synchronized to your development container.&lt;br&gt;
This is useful to avoid synchronizing binaries, build artifacts, git metadata or dependencies like &lt;code&gt;node_modules&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4: Activate your development container
&lt;/h2&gt;

&lt;p&gt;Next, execute the following command to activate your development container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;okteto up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt; ✓  Development container activated
 ✓  Files synchronized
    Namespace: default
    Name:      hello-world
&lt;/span&gt;&lt;span class="gp"&gt;    Forward:   3000 -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;3000
&lt;span class="gp"&gt;               9229 -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;9229
&lt;span class="go"&gt;
Welcome to your development container. Happy coding!
&lt;/span&gt;&lt;span class="gp"&gt;default:hello-world app&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Working in your development container is the same as working on your local machine.&lt;br&gt;
Start by installing your dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;default:hello-world app&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;yarn &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 2.09s.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the application in hot-reload mode by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;default:hello-world app&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nodemon index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;yarn run v1.22.4
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nodemon index.js
&lt;span class="go"&gt;[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
Starting hello-world server...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okteto automatically forwards port &lt;code&gt;3000&lt;/code&gt; from your local computer to the development container, making it accessible via &lt;code&gt;localhost&lt;/code&gt;. Test your application by running the command below in a local shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;curl localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Hello world!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Develop directly in Kubernetes
&lt;/h2&gt;

&lt;p&gt;Open the &lt;code&gt;index.js&lt;/code&gt; file in your favorite local IDE and modify the response message on line 5 to be &lt;em&gt;Hello world from the cluster!&lt;/em&gt;. Save your changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello world from the cluster!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okteto will synchronize your changes to your development container.&lt;br&gt;
Take a look at the development container shell and notice how the changes are detected by &lt;code&gt;nodemon&lt;/code&gt; automatically hot reloaded.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;[nodemon] restarting due to changes...
[nodemon] starting `node index.js`
Starting hello-world server...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test your application by running the command below in a local shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;curl localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Hello world from the cluster!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool! Your code changes were instantly applied to Kubernetes. No commit, build or push required 😎!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Debug directly in Kubernetes
&lt;/h2&gt;

&lt;p&gt;Okteto enables you to debug your applications directly from your favorite IDE.&lt;br&gt;
Let's take a look at how that works in VS Code, one of the most popular IDEs for Node development.&lt;br&gt;
If you haven't done it yet, install the Node.js extension available from Visual Studio marketplace.&lt;/p&gt;

&lt;p&gt;Cancel the execution of &lt;code&gt;nodemon index.js&lt;/code&gt; from the development container shell by pressing &lt;code&gt;ctrl + c&lt;/code&gt;.&lt;br&gt;
Rerun your application in debug mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;default:hello-world app&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;node &lt;span class="nt"&gt;--inspect-brk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0.0.0.0:9229 index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Debugger listening on ws://0.0.0.0:9229/73d8d793-b0c3-4310-86ee-3a42938a5df1
For help, see: https://nodejs.org/en/docs/inspector
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the &lt;em&gt;Debug&lt;/em&gt; extension and run the &lt;em&gt;Connect to okteto&lt;/em&gt; debug configuration (or press the F5 shortcut):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"configurations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Connect to okteto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"request"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"attach"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"localhost"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;9229&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"localRoot"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${workspaceFolder}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"remoteRoot"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/usr/src/app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"skipFiles"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;node_internals&amp;gt;/**"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add a breakpoint on &lt;code&gt;index.js&lt;/code&gt;, line 5. Call your application again by running the command below from a local shell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;curl localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The execution will halt at your breakpoint. You can then inspect the request, the available variables, etc...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8j84qi3oohwy0rcp8otc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8j84qi3oohwy0rcp8otc.png" alt="VS Code Debug View"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your code is running in Kubernetes, but you can debug it from your local machine without any extra services or tools.&lt;br&gt;
Pretty cool no? 😉&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusions
&lt;/h1&gt;

&lt;p&gt;Kubernetes has the potential to be a great development platform, providing replicable, resource-efficient and production-like development environments. We have shown you how to use &lt;a href="https://github.com/okteto/okteto" rel="noopener noreferrer"&gt;Okteto&lt;/a&gt; to create a development workflow that also lets you take advantage of features like hot reloaders or debuggers while developing your application directly on Kubernetes. &lt;/p&gt;

&lt;p&gt;Visit our &lt;a href="https://okteto.com/" rel="noopener noreferrer"&gt;website&lt;/a&gt; to know more about how to improve your team developer productivity with Okteto. Follow us &lt;a href="https://twitter.com/oktetohq" rel="noopener noreferrer"&gt;on Twitter&lt;/a&gt; and join our &lt;a href="https://kubernetes.slack.com/messages/CM1QMQGS0/" rel="noopener noreferrer"&gt;#okteto&lt;/a&gt; channel in the &lt;a href="http://slack.k8s.io/" rel="noopener noreferrer"&gt;Kubernetes community Slack&lt;/a&gt; to share your feedback with our community.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>node</category>
      <category>cloudnative</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
