<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Henrique Cavarsan on Medium]]></title>
        <description><![CDATA[Stories by Henrique Cavarsan on Medium]]></description>
        <link>https://medium.com/@hencavarsan?source=rss-223dff4d3fe0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*48comR2vMM0BB3Nd645RLA.jpeg</url>
            <title>Stories by Henrique Cavarsan on Medium</title>
            <link>https://medium.com/@hencavarsan?source=rss-223dff4d3fe0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 15:51:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hencavarsan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[kftui — A better way to manage kubectl port-forwards]]></title>
            <link>https://blog.devops.dev/kftui-a-better-way-to-manage-kubectl-port-forwards-11d86716ddf3?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/11d86716ddf3</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Mon, 25 Aug 2025 13:53:04 GMT</pubDate>
            <atom:updated>2025-08-25T13:53:04.005Z</atom:updated>
            <content:encoded><![CDATA[<h3>kftui — A better way to manage kubectl port-forwards</h3><blockquote><em>First of all — kftray and kftui are independent, cross-platform applications. They help you set up and manage multiple port-forwarding settings easily. Both apps are basically the same tool with different interfaces. kftray is the GUI version with windows and buttons. kftui is the terminal version that runs in your command line. They share the same database and configs. Set up a port-forward in kftray’s GUI, and you’ll see it in kftui too. Save something in kftui, and it shows up in kftray. You can use whichever one you prefer or switch between them.</em></blockquote><p>So… the kftray/kftui docs are pretty messy right now, and I figured writing this blog post would be easier than fixing everything properly. I’ll organize the docs later, but this should cover what kftui does and how to use it.</p><p>kftui has most of the same stuff as kftray, but this guide is just about the terminal version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*OYLLJivTqd9foRcK.png" /></figure><h3>Why Build a Terminal Interface?</h3><p>I built kftui to address some practical limitations of GUI applications. Terminal interfaces use significantly fewer system resources, which matters in resource-constrained environments. They work well over SSH connections without requiring X11 forwarding or remote desktop setups.</p><p>From a development perspective, maintaining one codebase in Rust is simpler than managing separate frontend and backend projects. This approach reduces complexity and keeps the tool focused on core functionality.</p><p>If you’ve worked with multiple kubectl port-forward processes in different terminal windows, you know how quickly it becomes difficult to manage. kftui provides a centralized way to handle these connections.</p><h3>Installation</h3><p>You’ll need curl or wget installed. Windows users need PowerShell.</p><p><strong>Unix-like systems (Linux, macOS, WSL):</strong></p><p>Using cargo:</p><pre>cargo install kftui</pre><p>Using Homebrew:</p><pre>brew tap hcavarsan/kftray<br>brew install kftui</pre><p>Using curl:</p><pre>bash &lt;(curl -s https://raw.githubusercontent.com/hcavarsan/kftray/main/hacks/kftui_installer.sh)</pre><p>Using wget:</p><pre>bash &lt;(wget -qO- https://raw.githubusercontent.com/hcavarsan/kftray/main/hacks/kftui_installer.sh)</pre><p><strong>Windows:</strong></p><pre>Invoke-Expression ((New-Object System.Net.WebClient).DownloadString(&#39;https://raw.githubusercontent.com/hcavarsan/kftray/main/hacks/kftui_installer.ps1&#39;))</pre><p>After installation, restart your terminal and verify it works:</p><pre>kftui</pre><h3>Basic Usage</h3><p>Start with a simple configuration file. Create config.json:</p><pre>[<br>  {<br>    &quot;alias&quot;: &quot;my-api&quot;,<br>    &quot;context&quot;: &quot;minikube&quot;,<br>    &quot;namespace&quot;: &quot;default&quot;,<br>    &quot;service&quot;: &quot;api-service&quot;,<br>    &quot;local_port&quot;: 8080,<br>    &quot;remote_port&quot;: 80,<br>    &quot;protocol&quot;: &quot;tcp&quot;,<br>    &quot;workload_type&quot;: &quot;service&quot;<br>  }<br>]</pre><p>Launch kftui with this configuration:</p><pre>kftui --configs-path config.json</pre><p>The interface displays your configuration in the “Stopped” table on the left. Press f to start the port-forward. The configuration moves to the &quot;Running&quot; table on the right, and your service becomes accessible at localhost:8080. Press f again to stop it.</p><h3>Persistent Storage</h3><p>To avoid specifying the config file path repeatedly, save configurations to kftui’s database:</p><pre>kftui --configs-path config.json --save</pre><p>After saving, run kftui without arguments to access your stored configurations. This approach works well for frequently used port-forward setups.</p><h3>Configuration Sources</h3><p>kftui supports several ways to load configurations, each suited to different workflows.</p><h3>Local Files</h3><p>Load configurations from local JSON files:</p><pre>kftui --configs-path /path/to/config.json</pre><h3>GitHub Repositories</h3><p>Import configurations from version-controlled repositories:</p><pre>kftui --github-url https://github.com/your-team/k8s-configs --configs-path environments/dev.json</pre><p>This method works well for teams that maintain environment-specific configurations in version control.</p><h3>Inline JSON</h3><p>Pass JSON configuration directly for scripting scenarios:</p><pre>kftui --json &#39;[{&quot;alias&quot;:&quot;test&quot;,&quot;namespace&quot;:&quot;default&quot;,&quot;service&quot;:&quot;my-service&quot;,&quot;local_port&quot;:8080,&quot;remote_port&quot;:80,&quot;protocol&quot;:&quot;tcp&quot;,&quot;workload_type&quot;:&quot;service&quot;}]&#39;</pre><h3>Standard Input</h3><p>Read configurations from stdin for pipeline integration:</p><pre>echo &#39;[{&quot;alias&quot;:&quot;api&quot;,...}]&#39; | kftui --stdin</pre><h3>Command-Line Options</h3><p><strong>--save</strong>: Store configurations in the database for future use<br> <strong>--flush</strong>: Clear existing configurations before importing new ones<br> <strong>--auto-start</strong>: Start all port-forwards immediately after loading<br> <strong>--non-interactive</strong>: Run without the interface for automation scripts</p><h3>Service Auto-Discovery</h3><p>Rather than manually creating configuration files, kftui can discover services through Kubernetes annotations. This approach keeps port-forward configurations synchronized with service definitions.</p><p>Add annotations to your Kubernetes services:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: monitoring-stack<br>  namespace: observability<br>  annotations:<br>    kftray.app/configs: &quot;grafana-3000-3000,prometheus-9090-9090,alertmanager-9093-9093&quot;<br>spec:<br>  selector:<br>    app: monitoring<br>  ports:<br>    - name: grafana<br>      port: 3000<br>    - name: prometheus<br>      port: 9090<br>    - name: alertmanager<br>      port: 9093</pre><p>The annotation format is alias-local_port-remote_port. Multiple configurations are separated by commas.</p><p>To use auto-discovery, navigate to the top menu in kftui and select “Auto Add”. Choose your Kubernetes context from the available options, and kftui will create configurations for all annotated services in that context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*qrOBx2RvgvqFBGUu.png" /></figure><h3>Interface Organization</h3><p>The interface consists of four main areas:</p><p><strong>Top menu bar</strong>: Contains Help, Auto Add, Import, Export, Settings, About, and Exit options<br> <strong>Stopped configurations</strong> (left): Displays configurations ready to start<br> <strong>Running configurations</strong> (right): Shows active port-forwards with status information<br> <strong>Details panel</strong> (bottom): Provides information about the selected configuration</p><h3>Menu Navigation</h3><p>The top menu provides seven functions:</p><ul><li><strong>Help</strong>: Display usage information and keyboard shortcuts</li><li><strong>Auto Add</strong>: Discover services from your Kubernetes cluster</li><li><strong>Import</strong>: Load configuration files through a file browser</li><li><strong>Export</strong>: Save current configurations to a JSON file</li><li><strong>Settings</strong>: Configure application behavior</li><li><strong>About</strong>: Show version and project information</li><li><strong>Exit</strong>: Stop all active port-forwards and close the application</li></ul><p>Navigate menu items with ←/→ arrow keys and press Enter to select.</p><h3>Application Settings</h3><p>Access settings by pressing s or selecting Settings from the menu.</p><ul><li><strong>Disconnect Timeout</strong>: Configure automatic disconnection after a specified period of inactivity. Set to 0 to disable automatic timeouts.</li><li><strong>Network Monitor</strong>: Enable or disable network connectivity monitoring. When enabled, kftui monitors network status and attempts to reconnect dropped port-forwards.</li></ul><p>Settings persist between application sessions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*MB3rFeUDuuIZpSnZ.png" /></figure><h3>HTTP Request Logging</h3><p>kftui provides HTTP request and response logging for debugging network traffic through port-forwards.</p><p>Enable logging by setting &quot;http_logs_enabled&quot;: true in your configuration file, or toggle it for existing configurations by pressing l in the interface.</p><h3>HTTP Logs Viewer</h3><p>Press Shift+V to open the HTTP logs viewer, which operates in two modes:</p><h4>List Mode (default view):</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Hb8thJVSZF25nhuz.png" /></figure><ul><li>Displays all HTTP requests with timestamps and status codes</li><li>Navigate requests with ↑/↓ arrow keys</li><li>Use PageUp/PageDown to scroll through multiple entries</li><li>Press Enter on any request to view detailed information</li><li>Press a to toggle automatic scrolling for new requests</li></ul><h4>Detail Mode (activated by pressing Enter on a request):</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*uvcr8hhwTQH-Jqff.png" /></figure><ul><li>Shows complete request and response information including headers and body content</li><li>Scroll through details with ↑/↓ arrow keys</li><li>Use PageUp/PageDown for faster navigation</li><li>Press r to replay the selected request</li><li>Press Esc to return to list mode</li></ul><h3>HTTP Logs Configuration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/0*ajrnbvkx_Ir7akK6.png" /></figure><p>Press L to configure HTTP logging behavior:</p><ul><li>Enable or disable logging for individual configurations</li><li>Set maximum log file size (1–1000 MB)</li><li>Configure retention period (1–365 days)</li><li>Enable automatic cleanup of old log files</li></ul><h3>Complete Keyboard Reference</h3><p>Key Function f Start or stop port-forward i Import configurations e Export configurations d Delete selected configurations a Select all configurations Space Toggle individual selection Tab Switch between interface components ←/→ Navigate menu items s Open settings h Show help information q Show about information l Toggle HTTP logging L Configure HTTP logging V View HTTP logs o Open HTTP logs in external editor ↑/↓ Navigate within sections PageUp/PageDown Scroll through content Home/End Jump to first/last item Ctrl+C Exit application</p><h3>Configuration File Structure</h3><p>Configuration files use JSON format with the following fields:</p><pre>{<br>  &quot;alias&quot;: &quot;my-service&quot;,           // Display name in interface<br>  &quot;namespace&quot;: &quot;production&quot;,       // Kubernetes namespace (required)<br>  &quot;service&quot;: &quot;api-service&quot;,        // Target service name<br>  &quot;local_port&quot;: 8080,             // Local binding port<br>  &quot;remote_port&quot;: 80,              // Remote service port<br>  &quot;protocol&quot;: &quot;tcp&quot;,              // Network protocol (required)<br>  &quot;workload_type&quot;: &quot;service&quot;,     // Target type: &quot;service&quot; or &quot;pod&quot;<br>  &quot;context&quot;: &quot;prod-cluster&quot;,      // Kubernetes context<br>  &quot;kubeconfig&quot;: &quot;/path/to/config&quot;, // Kubeconfig file path<br>  &quot;http_logs_enabled&quot;: true       // Enable HTTP logging<br>}</pre><p>The minimum required fields are namespace and protocol. When ports are not specified, kftui attempts to determine appropriate values from the service definition.</p><h3>What kftui Can Do</h3><p>kftui handles pretty much everything the kftray GUI does, just through terminal commands and keyboard shortcuts. The auto-discovery stuff saves time by reading your Kubernetes service annotations instead of making you type configs manually. The HTTP logging is useful for debugging API calls and seeing what requests are going through your port-forwards.</p><p>If you work mostly in terminals or need to manage port-forwards over SSH, kftui covers everything without needing a desktop environment.</p><h3>Demo Video</h3><p>In this quick demo video, I’ve tested both tools with the same setup — port forwarding to a service while running curl in a loop. Then deleted all pods with kubectl delete pods — all — force to see how each handles recovery.</p><ul><li>kubectl port forward: When pods get deleted, the port forward just dies even though it’s forwarding to a service. All requests fail and you have to manually restart it.</li><li>kftray: Loses maybe one request when pods get deleted. The watcher detects changes immediately and reconnects to new pods as they come up. The curl loop keeps going like nothing happened.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdBzFdejBBpc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdBzFdejBBpc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdBzFdejBBpc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/370b8955625a29f8deac00a934584881/href">https://medium.com/media/370b8955625a29f8deac00a934584881/href</a></iframe><h3>Additional Resources</h3><p>For more information:</p><ul><li><a href="https://github.com/hcavarsan/kftray/blob/main/docs/kftui/INSTALL.md">Installation Guide</a></li><li><a href="https://github.com/hcavarsan/kftray/blob/main/docs/kftui/USAGE.md">Usage Guide</a></li><li><a href="https://github.com/hcavarsan/kftray/releases">Latest Release</a></li></ul><p>If you find kftray or kftui useful, consider starring the project on <a href="https://github.com/hcavarsan/kftray">GitHub</a> ⭐</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11d86716ddf3" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kftui-a-better-way-to-manage-kubectl-port-forwards-11d86716ddf3">kftui — A better way to manage kubectl port-forwards</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging Kubernetes Services with KFtray’s HTTP Logs and VS Code REST Client Extension]]></title>
            <link>https://blog.devops.dev/debugging-kubernetes-services-with-kftrays-http-logs-and-vs-code-rest-client-extension-7bd5e527ef14?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bd5e527ef14</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[platform]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 21:20:44 GMT</pubDate>
            <atom:updated>2025-03-06T12:09:31.764Z</atom:updated>
            <content:encoded><![CDATA[<p>Learn how to debug Kubernetes services using KFtray’s HTTP logging with VS Code’s REST Client extension to capture and replay requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyNC3ZhUCGBBkqViV8j4vQ.png" /></figure><p>If you’ve worked with Kubernetes, you already know the debugging headaches it can cause. But what makes it particularly difficult?</p><p>First, there’s the distributed architecture. Your applications run across multiple nodes and namespaces, with traffic flowing through various system layers.</p><p>Second, environments constantly change. Pods start, stop, and reschedule themselves. Configuration changes happen frequently.</p><p>And production environments? They add a whole new level of complexity. Issues often manifest differently in production due to scale, load, or configuration variations. Security policies typically restrict direct access to services.</p><p>Have you ever found a bug in development that behaves completely differently in production? You’re not alone.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#common-debugging-options-for-kubernetes">Common Debugging Options for Kubernetes</a></h3><p>Most developers rely on a few standard approaches when debugging Kubernetes services. Each has its strengths — and limitations.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#manual-request-tools">Manual Request Tools</a></h3><p>Tools like Postman, Insomnia, and curl let you test endpoints directly. They’re useful for simple tests, but they come with constraints:</p><ul><li>Each request must be manually created</li><li>They can’t capture live traffic patterns</li><li>You often need multiple tools during a debugging session</li></ul><p>These tools work well in controlled situations but may fall short when dealing with complex, real-world traffic patterns.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#proxy-based-solutions">Proxy-Based Solutions</a></h3><p>Proxy tools like Charles Proxy and mitmproxy provide deeper traffic visibility. But there’s more to it:</p><ul><li>Certificate management can be complex</li><li>Workflow integration isn’t always smooth</li><li>They sometimes capture too much traffic</li></ul><p>While useful, these tools often feel disconnected from your development environment, requiring constant context switching.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#network-analysis-tools">Network Analysis Tools</a></h3><p>Low-level tools like Wireshark offer comprehensive traffic inspection but generally provide more information than needed:</p><ul><li>They have a steep learning curve</li><li>The level of detail can be overwhelming</li><li>They lack application context</li></ul><p>These tools are great at network-level debugging but can make application-level analysis more complex than necessary.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#an-alternative-approach-with-kftray-http-logging">An Alternative Approach with KFtray HTTP Logging</a></h3><p>I’ve found that KFtray offers an approach to Kubernetes debugging by adding HTTP traffic logging capabilities to standard port-forwarding.</p><p>It functions as a proxy layer that:</p><ul><li>Records HTTP traffic through port-forwards</li><li>Maintains standard port-forward functionality</li><li>Integrates with existing development workflows</li></ul><p>This approach provides additional visibility into service interactions while using familiar port-forwarding mechanics.</p><p>You might be asking yourself: “How does this actually work with VS Code?” That’s what i’ll explore next.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#how-kftrays-http-logging-works">How KFtray’s HTTP Logging Works</a></h3><p>When you enable HTTP logging for a port-forward configuration in KFtray, a series of events unfolds:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*RRnXUteOz0RY105kDAyOmg.png" /></figure><ol><li>Start a port forward with http logging option enabled</li><li>The app itself captures incoming HTTP requests</li><li>Requests are forwarded to your Kubernetes service</li><li>Responses are captured on their return journey</li><li>Complete request-response pairs are logged with correlation IDs</li></ol><p>This process enables traffic capture without requiring application changes or additional debugging tools.</p><p>And these logs are formatted in a way that works seamlessly with VS Code.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#setting-up-http-logging-in-kftray">Setting Up HTTP Logging in KFtray</a></h3><p>Setting up HTTP logging in KFtray is an simple process that begins with downloading and installing KFtray v0.16.1 or later from the <a href="https://github.com/hcavarsan/kftray/releases">GitHub releases page</a>. Once you have KFtray installed, you’ll need to configure your port-forward settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*SI1ah354QGS4PqgM.gif" /></figure><p>Start by launching KFtray and creating a new port-forward configuration. You’ll need to specify your Kubernetes environment details, including your desired context and the namespace where your service runs. Make sure to enter the correct service name — this is the Kubernetes service you want to monitor.</p><p>Next, configure your port settings. The local port is where you’ll access the service on your machine, while the remote port is where the service runs in your Kubernetes cluster. Give your configuration a descriptive name that helps you identify it easily later. This name will be particularly helpful when you’re managing multiple port-forwards.</p><p>With your configuration in place, enable the port-forward by toggling the switch in the KFtray interface. Then, click the menu icon next to your port-forward configuration and enable HTTP logging. This simple step activates the logging feature for your selected port-forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*0XgHLNwm9hrD5FKY.gif" /></figure><p>KFtray will now automatically capture all HTTP traffic flowing through your port-forward. The logs are saved to $HOME/.kftray/http_logs/, and each log file is named using your configuration ID and local port for easy reference.</p><p>Now that you have logging set up, let’s explore what makes these logs particularly valuable for debugging and development.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#understanding-the-http-log-format">Understanding the HTTP Log Format</a></h3><p>The HTTP logs generated by KFtray are structured in a specific format that’s compatible with VS Code’s REST Client extension. Each entry contains complete details about the HTTP interaction:</p><blockquote><em>curl ‘</em><a href="http://127.0.0.1:8787/gzip"><em>http://127.0.0.1:8787/gzip</em></a><em>&#39; — compressed -H ‘User-Agent: Test’</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*VMmooGt3Eh7I0nkm.png" /></figure><pre># ----------------------------------------<br># Trace ID: 651bc5a5-fb13-46ec-b471-473f08a1f828<br># Request at: 2025-03-05T16:56:00.076606+00:00<br>GET /gzip HTTP/1.1<br>Host: 127.0.0.1:8787<br>Accept: */*<br>Accept-Encoding: deflate, gzip<br>User-Agent: Test<br><br>#&lt;empty body&gt;<br><br>###<br># ----------------------------------------<br># Trace ID: 651bc5a5-fb13-46ec-b471-473f08a1f828<br># Response at: 2025-03-05T16:56:00.079206+00:00<br># Took: 2 ms<br>HTTP/1.1 200 OK<br>Access-Control-Allow-Credentials: true<br>Access-Control-Allow-Origin: *<br>Content-Encoding: gzip<br>Content-Length: 150<br>Content-Type: application/json; encoding=utf-8<br>Date: Wed, 05 Mar 2025 16:56:00 GMT<br><br>{<br>  &quot;headers&quot;: {<br>    &quot;Accept&quot;: [<br>      &quot;*/*&quot;<br>    ],<br>    &quot;Accept-Encoding&quot;: [<br>      &quot;deflate, gzip&quot;<br>    ],<br>    &quot;Host&quot;: [<br>      &quot;127.0.0.1:8787&quot;<br>    ],<br>    &quot;User-Agent&quot;: [<br>      &quot;Test&quot;<br>    ]<br>  },<br>  &quot;origin&quot;: &quot;127.0.0.1:56846&quot;,<br>  &quot;gzipped&quot;: true<br>}</pre><p>The log format includes several key components:</p><ul><li><strong>Trace ID</strong>: Each request-response pair shares a unique identifier</li><li><strong>Timestamps and Duration</strong>: Useful for identifying performance issues</li><li><strong>Complete HTTP Details</strong>: Includes headers, status codes, and body content</li></ul><p>This format is what makes the logs directly usable with VS Code’s REST Client.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#integrating-with-vs-code-rest-client">Integrating with VS Code REST Client</a></h3><p>The REST Client extension for VS Code is a powerful tool for testing HTTP requests. When combined with KFtray’s logs, it creates a workflow for debugging Kubernetes services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sNyRNb7jO7R4cu8W.gif" /></figure><p>To use this integration:</p><ul><li>Install the REST Client extension from the VS Code marketplace</li><li>Open a KFtray-generated log file in VS Code</li><li>The extension automatically recognizes HTTP requests in the file</li><li>Use the “Send Request” button to replay any captured request</li></ul><blockquote>Note: You can modify parameters, headers, or body content before replaying a request,<br>making it easy to test different scenarios.</blockquote><blockquote>Note: This approach works alongside existing debugging tools rather than replacing them.<br>It can complement your current development workflow.</blockquote><p>This integration allows you to conduct debugging within your code editor, potentially reducing the need to switch between multiple tools.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#how-can-it-help">How can it help?</a></h3><p>Here are some common scenarios in which these tools can be useful.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#diagnosing-intermittent-api-errors">Diagnosing Intermittent API Errors</a></h3><p>Production services sometimes experience sporadic errors that are difficult to reproduce. This approach can help:</p><ul><li>Enable HTTP logging for the service’s port-forward</li><li>Monitor the application until the error occurs</li><li>Review the HTTP logs for failing requests:</li></ul><pre># ----------------------------------------<br># Trace ID: 5525d312-5582-46ad-85d1-0fd3710f824e<br># Response at: 2025-03-01T15:34:09.901304+00:00<br># Took: 144 ms<br>HTTP/1.1 500 Internal Server Error<br>Content-Type: application/json<br><br>{<br>  &quot;error&quot;: &quot;Failed to connect to database&quot;,<br>  &quot;code&quot;: &quot;DB_CONNECTION_ERROR&quot;<br>}</pre><ul><li>Use VS Code REST Client to replay the exact request to verify the error pattern</li></ul><p>This method can help make intermittent failures more reproducible and easier to debug.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#tracking-microservice-communication">Tracking Microservice Communication</a></h3><p>Microservice architectures create complex communication patterns that can be difficult to visualize. HTTP logging helps by capturing traffic across multiple service port-forwards, recording complete request and response cycles, maintaining trace ID correlation across services, and providing timing data for each interaction. This visibility can help identify communication patterns and potential areas for optimization.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#troubleshooting-authentication-flows">Troubleshooting Authentication Flows</a></h3><p>Authentication systems typically involve multiple steps of token exchange and validation. With HTTP logging, you can:</p><ul><li>Record complete authentication request sequences</li><li>Preserve header information and token data</li><li>Replay requests with modified parameters</li><li>Maintain the full context of authentication flows</li></ul><p>All that being said, the real value comes from how these tools fit into your existing development workflow.</p><h3><a href="https://kftray.app/blog/posts/12-kftray-http-logs-vscode#conclusion">Conclusion</a></h3><p>Combining KFtray’s HTTP logging with VS Code’s REST Client extension offers an additional option for debugging Kubernetes services. This approach provides a way to capture and replay HTTP traffic that can simplify some debugging scenarios.</p><p>The format compatibility between KFtray’s logs and VS Code REST Client creates a workflow that includes:</p><ul><li>Capturing service interactions with context</li><li>Documenting intermittent issues</li><li>Providing request replay capabilities</li><li>Supplementing existing debugging approaches</li></ul><p>i believe this combination of tools could be helpful in certain Kubernetes debugging scenarios. i’m curious to see how you might apply this approach to your own debugging challenges.</p><p>If you’re interested in exploring this further, you can find more information on the <a href="https://github.com/hcavarsan/kftray">KFtray GitHub repository</a>.</p><p>Feedback and contributions are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bd5e527ef14" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/debugging-kubernetes-services-with-kftrays-http-logs-and-vs-code-rest-client-extension-7bd5e527ef14">Debugging Kubernetes Services with KFtray’s HTTP Logs and VS Code REST Client Extension</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging HTTP Traffic in kubectl port-forward with KFtray]]></title>
            <link>https://blog.devops.dev/debugging-http-traffic-in-kubectl-port-forward-with-kftray-1e0e67af750e?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e0e67af750e</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 21:08:12 GMT</pubDate>
            <atom:updated>2024-06-15T18:34:39.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zm71c0iDDrLRgzeRYj2E7w.png" /></figure><p>KFtray is a application that can be integrated into the system tray for easy interaction with kubectl port-forward commands. A additional feature has joined recently in new version 0.11.7, one that can make HTTP traffic traces logs; this is an new method that simplifies debugging. This article provides a short guide on how to get started with the new feature.</p><h3>Using the New Feature — HTTP Traffic Logging</h3><p>To utilize the new HTTP traffic logging feature, ensure you have the latest version of KFtray installed. Visit the <a href="https://github.com/hcavarsan/kftray/releases">GitHub releases page</a> and download the latest version of KFtray for your operating system. Follow the installation instructions specific to your OS to complete the setup.</p><p>Once installed, Ensure the version number displayed in the logo icon tooltip matches the latest release v0.11.7.</p><h4>Step 1: Open KFtray</h4><p>Launch KFtray by clicking its icon or typing kftray in the terminal if you installed it using Homebrew..This will open the main interface when you click the system tray icon, where you can manage your configurations.</p><h4>Step 2: Turn On HTTP Logging</h4><ol><li><strong>Open Settings:</strong> Click the KFtray icon in your system tray and select the configuration panel from the menu.</li><li><strong>Start Port Forward</strong>: Toggle the switch button to enable the configured port forwarding.</li><li><strong>Pick a Configuration:</strong> In the same row of the switch button, click the hamburger icon to open the configurations from the forwarded port.</li><li><strong>Enable Logging:</strong> Locate the “Enable HTTP Logging” and click it to turn on HTTP logging for that configuration.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*zW1MI9nhvUTpGv1x.gif" /></figure><h4>Step 3: View HTTP Logs</h4><ol><li><strong>Find Logs:</strong> HTTP logs are automatically saved in the directory $HOME/.kftray/http_logs/{config_id}_{local_port}. Each log file is named based on the configuration ID and local port for easy identification.</li><li><strong>Open Logs:</strong> To view the logs, click the log icon button next to your configuration. This will open the log file in your default text editor, allowing you to inspect the HTTP requests and responses.</li><li><strong>Trace IDs:</strong> Each request and response in the log has the same trace ID, making it easier to identify linked requests and responses when handling multiple parallel requests.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*uo2rA3MQxjN_JCdH.gif" /></figure><h4>HTTP Logs Sample</h4><pre>cat $HOME/.kftray/http_sniff/1_8080.log</pre><pre>  ----------------------------------------<br>  Trace ID: 5525d312-5582-46ad-85d1-0fd3710f824e<br>  Request at: 2024-06-13T15:34:09.756706+00:00<br>  Method: GET<br>  Path: /json<br>  Version: 1</pre><pre>  Headers:<br>  Host: 127.0.0.1:8081<br>  Connection: keep-alive<br>  sec-ch-ua: &quot;Not/A)Brand&quot;;v=&quot;8&quot;, &quot;Chromium&quot;;v=&quot;126&quot;, &quot;Google Chrome&quot;;v=&quot;126&quot;<br>  sec-ch-ua-mobile: ?0<br>  sec-ch-ua-platform: &quot;macOS&quot;<br>  Upgrade-Insecure-Requests: 1<br>  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7<br>  Sec-Fetch-Site: none<br>  Sec-Fetch-Mode: navigate<br>  Sec-Fetch-User: ?1<br>  Sec-Fetch-Dest: document<br>  Accept-Encoding: gzip, deflate, br, zstd<br>  Accept-Language: en-US,en;q=0.9,pt;q=0.8<br></pre><pre>  Body:<br>  &lt;empty&gt;</pre><pre>  ----------------------------------------<br>  Trace ID: 5525d312-5582-46ad-85d1-0fd3710f824e<br>  Response at: 2024-06-13T15:34:09.901304+00:00<br>  Took: 144 ms<br>  Status: 200</pre><pre>  Headers:<br>  Access-Control-Allow-Credentials: true<br>  Access-Control-Allow-Origin: *<br>  Content-Length: 421<br>  Content-Type: application/json; encoding=utf-8<br>  Date: Thu, 13 Jun 2024 15:34:10 GMT<br></pre><pre>  Body:<br>  {<br>    &quot;slideshow&quot;: {<br>      &quot;author&quot;: &quot;Yours Truly&quot;,<br>      &quot;date&quot;: &quot;date of publication&quot;,<br>      &quot;slides&quot;: [<br>        {<br>          &quot;title&quot;: &quot;Wake up to WonderWidgets!&quot;,<br>          &quot;type&quot;: &quot;all&quot;<br>        },<br>        {<br>          &quot;items&quot;: [<br>            &quot;Why &lt;em&gt;WonderWidgets&lt;/em&gt; are great&quot;,<br>            &quot;Who &lt;em&gt;buys&lt;/em&gt; WonderWidgets&quot;<br>          ],<br>          &quot;title&quot;: &quot;Overview&quot;,<br>          &quot;type&quot;: &quot;all&quot;<br>        }<br>      ],<br>      &quot;title&quot;: &quot;Sample Slide Show&quot;<br>    }<br>  }</pre><h3>Step 4: Clean Logs Folder</h3><p>To manage disk space and keep your logs organized, you can clean the logs folder and check the size of the logs folder from kftray.</p><ol><li><strong>Open Main Menu:</strong> Click the system tray icon to open the main window, then click the hamburger icon in the bottom-left corner. You should see a button Prune Logs (0.00 MB) that displays the size of the HTTP logs folder.</li><li><strong>Prune Logs:</strong> Click the Prune Logs button to remove all the HTTP log files from the logs folder and reclaim disk space.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*U84lt1xhczecYF36.gif" /></figure><h3>Real-World Use Cases</h3><h4>Debugging CLI Tools</h4><p>When using CLI tools that abstract HTTP calls, such as LocalStack, it can be challenging to debug the underlying HTTP requests and responses. HTTP logging in KFtray can help you capture and analyze these interactions.</p><p><strong>Example:</strong> If you’re using a CLI tool like LocalStack to simulate AWS services locally, enable HTTP logging for the configurations that interact with LocalStack. The logs will capture all HTTP requests and responses made by the CLI tool, including trace IDs to link related requests and responses. This makes it easier to debug issues and understand the behavior of the CLI tool.</p><h4>Save History of HTTP Requests and Don’t Lose Made Requests</h4><p>By enabling HTTP logging, you can save a history of all HTTP requests and responses. This ensures that you don’t lose any made requests, which is especially useful for debugging and auditing purposes.</p><p><strong>Example:</strong> If you need to review past interactions or troubleshoot issues that occurred previously, the saved logs will provide a complete history of HTTP traffic, including trace IDs to link related requests and responses.</p><h4>Fixing Microservices Issues</h4><p>When developing a microservice architecture, use HTTP logging to view detailed request and response data. This helps identify issues in interactions between services.</p><p><strong>Example:</strong> If a service interaction fails intermittently, enable HTTP logging for the configurations involved. Use the logs to pinpoint the problem, such as incorrect request parameters or unexpected response formats. The trace IDs will help you link related requests and responses.</p><h4>Security Audits</h4><p>Capture and review HTTP traffic logs to ensure no sensitive data is exposed in requests or responses. This is crucial for maintaining security compliance.</p><p><strong>Example:</strong> Enable HTTP logging for configurations handling sensitive data. Regularly review the logs to verify that no private information is being leaked. The trace IDs will help you track the flow of sensitive data through your system.</p><h4>Solving Intermittent Problems</h4><p>Capture HTTP traffic during the occurrence of intermittent issues to find patterns or anomalies that may be causing the problems.</p><p><strong>Example:</strong> Users report sporadic issues with your web application. Enable HTTP logging for the related configurations and capture traffic during the problem periods. Analyze the logs to identify any patterns or anomalies. Use the trace IDs to correlate requests and responses during the issue periods.</p><h4>Boosting Performance</h4><p>Monitor HTTP logs to identify slow endpoints and optimize the performance of your application.</p><p><strong>Example:</strong> If certain endpoints are slow, enable HTTP logging for those configurations. Use the logs to identify the bottlenecks and optimize the endpoints for better performance. Trace IDs will help you follow the request-response cycle and pinpoint delays.</p><h3>Quick Demo</h3><p>This video demonstrates the complete flow of this new feature.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZ1rCFu3VZAQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZ1rCFu3VZAQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZ1rCFu3VZAQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e118ec220569c738594f5954d23a202d/href">https://medium.com/media/e118ec220569c738594f5954d23a202d/href</a></iframe><h4>New in v0.11.7</h4><ul><li><strong>Toggle HTTP Logs:</strong> Easily enable/disable HTTP logs for configurations, saved in $HOME/.kftray/http_logs/{config_id}_{local_port}.</li><li><strong>Clean Logs Folder:</strong> New button to tidy up the logs folder.</li><li><strong>Logging Controls:</strong> Buttons to turn HTTP logging on or off for each configuration.</li><li><strong>Open Logs with Default Editor:</strong> Icon button to open HTTP logs with your default OS text editor.</li><li><strong>Trace IDs for Requests and Responses:</strong> Each request and response in the log has the same trace ID to help identify linked requests and responses when handling multiple parallel requests.</li><li><strong>Better Connection Reliability:</strong> Improvements in the KFtray server and desktop client.</li><li><strong>Smaller Bundle Sizes:</strong> More efficient installation.</li></ul><h3>Wrap-Up</h3><p>The new logging of HTTP traffic in KFtray v0.11.7 takes the work out of debugging and simplifies it. Turn logging on for your configurations and you’ll be fixing issues in minutes. Trace IDs enable easy request and response correlation even when handling multiple requests in parallel.</p><p><strong>Star us on </strong><a href="https://github.com/hcavarsan/kftray"><strong>GitHub</strong></a><strong> ⭐</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e0e67af750e" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/debugging-http-traffic-in-kubectl-port-forward-with-kftray-1e0e67af750e">Debugging HTTP Traffic in kubectl port-forward with KFtray</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Port Forward Transition from SPDY to WebSockets in Kubernetes 1.30]]></title>
            <link>https://blog.devops.dev/kubernetes-1-30-spdy-to-websockets-transition-83ef274324a2?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/83ef274324a2</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 21:37:56 GMT</pubDate>
            <atom:updated>2024-05-01T18:39:26.071Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fHBqEpUDODVgeTjA" /></figure><h3>Introduction</h3><p>One of the changes in the latest Kubernetes version, 1.30 (Uwubnetes) is the transition from SPDY to websocket for some of the kubectl commands. Most of the updates get most of the attention, but this is no less important.</p><h3>Understanding SPDY:</h3><p>Google created SPDY to improve HTTP by speeding up webpage load times and enhancing security with a session layer. It allowed multiple data streams to be sent simultaneously, prioritized request values, and optimized communication by compressing headers. However, SPDY was deprecated in 2016 and replaced by HTTP/2, which is more advanced. Therefore, for technologies like Kubernetes that require better and standards communication methods, SPDY is no longer relevant.</p><h3>Why WebSockets?</h3><p>WebSockets use a bidirectional communication protocol over a single TCP connection, widely supported in web servers, proxies, and network gateways. This increases compatibility and communication performance for kubectl commands. Here are some points about WebSockets:</p><ul><li>WebSockets allow for full-duplex communication, so it’s very efficient to send and receive data. It requires no multiple connections, that would require handshakes.</li><li>This technology reduces overhead and allows for high-speed data exchanges, which is especially interesting for Kubernetes-related tasks.</li><li>WebSockets are protocol-independent so they may be used for communication over any full-duplex single-connection protocol, which will reduce latency and help in real-time command execution.</li><li>WebSockets keep a persistent connection and thus use resources more efficiently and cut the number of TCP connections used, in turn reducing the amount of network overhead.</li><li>The use of WebSockets fix issues that older protocols like SPDY had, and it’s more compatible with modern web technologies.</li></ul><p>The migration from SPDY to WebSockets in Kubernetes makes it much easier to communicate control messages, which will allow for better cluster management and stability.</p><h3>Kep 4006</h3><p>The SPDY protocol was deprecated in 2016. In 2023, a proposal was opened in the Kubernetes community to change the protocol for commands like port-forward, attach, exec, and portforward that use upgraded connections.</p><p><a href="https://github.com/kubernetes/enhancements/issues/4006">Link to proposal</a><br><a href="https://opengraph.githubassets.com/1/kubernetes/enhancements/issues/4006">Link to issue</a></p><h3>Implementation Overview:</h3><p>WebSocket support in Kubernetes and kubectl starts with an HTTP handshake that upgrades the connection to a WebSocket, like as the SPDY. The WebSocket framing method provides improved technique for data framing for streams such as stdin, stdout, and stderr through framing with a channel identifier. This is an extension of the technique once used by SPDY through binary data framing.</p><p>As a fallback mechanism in case WebSocket support is not available on the server, a fallback to SPDY is utilized. The initial performance assessments demonstrated that WebSocket is as efficient as, or even a little better than, SPDY for standard kubectl operations, and continuing performance testing is intended to better performance across multiple use cases. There are many implications from this transition, including greater network compatibility in settings where strong proxy and firewall policies are in place, and better integration with external tools.</p><h3>API server changes:</h3><p>The API server now supports the WebSocket protocol by replacing SPDY with explicit headers to enable bidirectional streams. Additionally, the StreamTranslatorProxy has been added to help create WebSocket connections from clients to internal SPDY connections in Kubernetes.</p><p>The management of WebSocket frames is critical, especially for the occasional use of the ping/pong frames to keep the WebSocket connection alive. This feature was first introduced in an alpha version that one could use through the feature gate for port forwarding Websockets within the API server and a corresponding flag in kubectl.</p><h3>Client (kubectl) Changes:</h3><p>On the client side, it added an upgrade to WebSocket for port forwarding, along with signing, response processing, and data serialization and deserialization over the WebSocket. This gives the user the ability to enable WebSocket port forwarding through environment variables. To make this transition easy, kubectl has also introduced mechanisms to handle errors and reliability, with error handling during its alpha and beta phases, along with a fallback to SPDY in case the WebSocket connection fails to ensure that service continuity is not lost.</p><h3>Websockets in kubectl port-forward with Kind</h3><h3>Setup Env</h3><p>Before creating my environment, Docker, Kind, and Go have to be installed on the machine. All of these are needed for developing and deploying our Kubernetes cluster on our local machines. Let’s set up the environment with Kubernetes 1.30.</p><p>Let’s start by setting up the necessary environment variables and dependencies:</p><pre># Set Go environment variables<br>export GOPATH=$HOME/go<br>export GOROOT=/usr/local/go<br>export PATH=$PATH:$GOROOT/bin:$GOPATH/bin<br><br># Create a directory for Kubernetes source<br>mkdir -p $GOPATH/src/k8s.io<br>cd $GOPATH/src/k8s.io<br><br># Clone the Kubernetes repository<br>git clone https://github.com/kubernetes/kubernetes.git<br>cd kubernetes</pre><h4>Install Dependencies on Mac M1</h4><p>For those uses Mac with an M1 chip:</p><pre>brew install bash<br>brew install gnu-tar</pre><h3>Building the kubernetes and kubectl 1.30 image</h3><p>To build the images and kubectl, we need to have Go 1.22 or later. Then, execute some commands:</p><pre># Checkout to the Kubernetes 1.30 release<br>git checkout release-1.30<br><br># Build a node image using Kind<br>kind build node-image<br><br># Build the kubectl in this version<br>make kubectl KUBE_BUILD_PLATFORMS=darwin/arm64<br><br># kubectl artifact output path : $GOPATH/kubernetes/_output/dockerized/bin/darwin/arm64/kubectl<br>chmod +x $GOPATH/kubernetes/_output/dockerized/bin/darwin/arm64/kubectl</pre><h3>Kind Cluster Configs</h3><p>First, set up the kind cluster with 1.30 images by creating a config.yaml file with featureGates PortForwardWebsockets enabled:</p><pre>kind: Cluster<br>apiVersion: kind.x-k8s.io/v1alpha4<br>featureGates:<br>  &quot;PortForwardWebsockets&quot;: true<br>nodes:<br>- role: control-plane<br>  image: kindest/node:latest<br>- role: worker<br>  image: kindest/node:latest<br>- role: worker<br>  image: kindest/node:latest</pre><h3>Create the cluster</h3><p>When you have your configuration file set up you can add the cluster with the following command:</p><pre># Change default kubeconfig path to have only with kind test cluster<br>export KUBECONFIG=~/.kube/kind-kind<br>kind create cluster --name kind-1-30 --config config.yaml</pre><h3>Deploy a sample app</h3><p>You can test your new WebSocket capability by deploying a simple application and using the cluster to connect by port forwarding:</p><pre>git clone https://github.com/digitalocean/kubernetes-sample-apps.git<br>cd kubernetes-sample-apps<br>kubectl apply -k bookinfo-example/kustomizeForward the Port Using WebSockets</pre><p>Enable the WebSocket port forwarding :</p><pre>export KUBECTL_PORT_FORWARD_WEBSOCKETS=&quot;true&quot;<br>$GOPATH/kubernetes/_output/dockerized/bin/darwin/arm64/kubectl -v6 port-forward svc/productpage -n bookinfo 9080:9080Now, open http://localhost:9080/ in your browser. You should get responses from the echoserver.</pre><h3>Verifying WebSocket Port Forwarding</h3><p>To confirm if WebSocket port forwarding is active, review the kubectl logs:</p><p><strong>This is the log with SDPY (default):</strong></p><pre>I0422 17:32:50.963059   11299 round_trippers.go:466] curl -v -XPOST  -H &quot;X-Stream-Protocol-Version: portforward.k8s.io&quot; -H &quot;User-Agent: kubectl/v1.31.0 (darwin/arm64) kubernetes/cae35db&quot; &#39;https://192.168.68.109:6443/api/v1/namespaces/bookinfo/pods/productpage-v1-64c658687d-5bhsg/portforward&#39;<br>I0422 17:32:50.965663   11299 round_trippers.go:510] HTTP Trace: Dial to tcp:192.168.68.109:6443 succeed<br>I0422 17:32:50.978422   11299 round_trippers.go:553] POST https://192.168.68.109:6443/api/v1/namespaces/bookinfo/pods/productpage-v1-64c658687d-5bhsg/portforward 101 Switching Protocols in 15 milliseconds<br>I0422 17:32:50.978440   11299 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 2 ms TLSHandshake 0 ms Duration 15 ms<br>I0422 17:32:50.978444   11299 round_trippers.go:577] Response Headers:<br>I0422 17:32:50.978448   11299 round_trippers.go:580]     Upgrade: SPDY/3.1<br>I0422 17:32:50.978450   11299 round_trippers.go:580]     X-Stream-Protocol-Version: portforward.k8s.io<br>I0422 17:32:50.978453   11299 round_trippers.go:580]     Connection: Upgrade</pre><p><strong>This is the logs with Websocket enabled:</strong></p><pre>17:29:21.504179    7561 tunneling_dialer.go:75] Before WebSocket Upgrade Connection...<br>I0422 17:29:21.504194    7561 round_trippers.go:466] curl -v -XGET  -H &quot;Sec-Websocket-Protocol: SPDY/3.1+portforward.k8s.io&quot; -H &quot;User-Agent: kubectl/v1.31.0 (darwin/arm64) kubernetes/cae35db&quot; &#39;https://192.168.68.109:6443/api/v1/namespaces/bookinfo/pods/productpage-v1-64c658687d-5bhsg/portforward&#39;<br>I0422 17:29:21.506351    7561 round_trippers.go:510] HTTP Trace: Dial to tcp:192.168.68.109:6443 succeed<br>I0422 17:29:21.519936    7561 round_trippers.go:553] GET https://192.168.68.109:6443/api/v1/namespaces/bookinfo/pods/productpage-v1-64c658687d-5bhsg/portforward 101 Switching Protocols in 15 milliseconds<br>I0422 17:29:21.519954    7561 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 2 ms TLSHandshake 4 ms ServerProcessing 8 ms Duration 15 ms<br>I0422 17:29:21.519958    7561 round_trippers.go:577] Response Headers:<br>I0422 17:29:21.519962    7561 round_trippers.go:580]     Sec-Websocket-Accept: +AqmlgtoGPP/Rlfw6oAZMCN34SY=<br>I0422 17:29:21.519964    7561 round_trippers.go:580]     Sec-Websocket-Protocol: SPDY/3.1+portforward.k8s.io<br>I0422 17:29:21.519966    7561 round_trippers.go:580]     Upgrade: websocket<br>I0422 17:29:21.519968    7561 round_trippers.go:580]     Connection: Upgrade<br>I0422 17:29:21.519973    7561 tunneling_dialer.go:85] negotiated protocol: portforward.k8s.io</pre><p>The logs show that the protocol upgrade to SPDY via WebSocket was successful in Kubernetes 1.30</p><h3>KEP Roadmap Port Forward over Websockets</h3><p><strong>Alpha Release (Kubernetes 1.30):</strong></p><p>WebSocket support added. Feature enabled via the KUBECTL_PORT_FORWARD_WEBSOCKETS=true env var on the client side and PortForwardWebsockets alpha feature flag should be enabled on the API Server,.</p><p>Focus in the alpha phase would be testing from all perspectives, user feedback, and updating developer and user documentation for this alpha feature.</p><p><strong>Beta Release(Target 1.31):</strong></p><p>More extensive testing for performance fine-tuning, user feedback, and updated documentation, the documentation will be updated regularly with the changes during the beta phase improvements.</p><p>User community feedback will be the basis in making the feature stable and usable.</p><p><strong>Stable Release (Target 1.32):</strong></p><p>Ensure WebSocket support transitions from beta to stable with alpha feature flags removed and publish a deprecation notice to officially mark the transition away from SPDY-based port forwarding.</p><h3>KEP Roadmap RemoteCommand over websockets (exec, cp, attach)</h3><p><strong>Beta release (Kubernetes 1.30):</strong></p><p>WebSocket for RemoteCommand (exec, cp, attach) will be on by default. The feature gates to the client and server are expected to ensure that the SPDY replacement has as little impact on the user as possible.</p><p>The biggest emphasis here is on making the changes transparent to the user and, for those who are wary of this new implementation, will always have the choice to disable it.</p><p><strong>Path to Stability:</strong></p><p>Post 1.30 and leading up to the 1.32 release, the focus will be on refinement in WebSocket functionality, all aimed at reaching zero known critical bugs.</p><h3>Conclusion</h3><p>And thats all, folks. This hopefully explains the important protocol communication change in Kubernetes. I’ve had too many issues due to SPDY and lack of compatibility with new load balancers, proxies, etc., which was so complicated that I found myself at work. Now I see this migration from SPDY to WebSockets, so I’m a bit excited.</p><p>Looking forward, I’ll let you know if there are any updates about this KEP</p><p>Also, maybe there’ll be errors or misinformation in this post; I’m just human after all. Feel free to let me know if you find anything off on social media or post a comment here at the blog. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83ef274324a2" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kubernetes-1-30-spdy-to-websockets-transition-83ef274324a2">Port Forward Transition from SPDY to WebSockets in Kubernetes 1.30</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Debugging: Handling Multiple kubectl port-forward from your System Tray]]></title>
            <link>https://blog.devops.dev/kubernetes-debugging-handling-multiple-kubectl-port-forward-from-your-tray-1980332efef7?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1980332efef7</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Fri, 29 Mar 2024 16:15:57 GMT</pubDate>
            <atom:updated>2024-04-01T17:07:10.511Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQw6NWRK8FzGvqXJM7ZGVA.png" /></figure><h3>The Pain of Kubernetes Debugging with Kubectl Port Forward</h3><p>As an SRE, one of my primary responsibilities is debugging Kubernetes applications and infrastructure. The go-to tool for debugging pods in Kubernetes is kubectl port-forward. However, this utility has several limitations that often make the debugging process tedious and frustrating.</p><ul><li><strong>Lack of Auto-Reconnect for Unstable Connections</strong> The kubectl port-forward command does not automatically reconnect if the connection is interrupted for any reason. This means if there is an issue with the network or Kubernetes API server, the port forward will stop working, and I have to manually restart it. For debugging unstable applications, this missing feature results in a poor experience and loss of productivity.</li><li><strong>No UDP Support</strong> Kubectl port-forward only supports TCP and does not natively support UDP. Many applications rely on UDP, so without support for UDP forwarding, debugging them is very difficult. We often have to modify applications to use TCP instead of UDP just for debugging purposes, which is far from ideal.</li><li><strong>Single Pod Forwarding Only</strong> The kubectl port-forward command can only forward ports for a single pod at a time. When debugging complex, multi-pod applications, this means I frequently have to open multiple terminal tabs to port forward to each pod individually. This process is tedious, difficult to manage, and negatively impacts productivity during debugging sessions.</li><li><strong>Difficulty Keeping Configurations in Sync</strong> On our team, we have port forwarding configurations defined in a shared Git repository so we can standardize them across projects. However, with kubectl, the only way to use these shared configurations is to manually download them and run them locally. This makes it difficult to keep everyone’s configurations in sync and up-to-date.</li></ul><h3>Introducing KFtray: A Developer Tool for Kubernetes</h3><p>As a developer working with Kubernetes, managing multiple port forwards for debugging applications can quickly become tedious and time-consuming. To simplify this process, I created KFtray, an open-source system tray application that provides a user-friendly interface for handling Kubernetes port forwarding.</p><ul><li><strong>Simplified Port Forward Management</strong> KFtray allows developers to easily start, stop, and manage multiple port forwarding configurations simultaneously through an intuitive interface. Users can save configurations locally or sync them with a GitHub repository for team collaboration. KFtray automatically restarts pods as needed to maintain service continuity in the event of pod failure, improving reliability.</li><li><strong>Customized Configuration</strong> Developers can customize KFtray to use a specified local IP address instead of the default localhost for port forwarding. They can also enable TCP/UDP proxy forwarding through Kubernetes for additional flexibility. KFtray uses each operating system’s keyring to securely store confidential information like API keys.</li><li><strong>Staying Up-to-Date with Git Synchronization</strong> For teams collaborating on Kubernetes applications, keeping port forwarding configurations in sync can be challenging. KFtray addresses this through an optional Git synchronization feature. Developers can connect KFtray to a GitHub repository containing their port forwarding configurations. KFtray will then automatically pull the latest configurations from that repository on an adjustable polling schedule.</li><li><strong>Improved Productivity</strong> By simplifying the management of Kubernetes port forwarding, KFtray aims to make developers more productive. No longer do they have to manually restart pods or switch between multiple terminal windows to handle port forwarding. KFtray provides a single interface to control all their port forwarding needs.</li><li><strong>Keep your configurations updated with Github Sync</strong> KFtray allows developers to easily store and manage port forward configurations from local files or GitHub repositories. This means users can save a configuration once and reload it whenever needed, reducing repetitive work. Developers can also share configurations with team members by committing them to a GitHub repo.</li><li><strong>Simultaneous Port Forwards</strong> A key pain point KFtray solves is the ability to run multiple port forwards simultaneously. Without a tool like KFtray, developers have to manually run each port forward separately in their terminal. KFtray handles running all port forwards in the background, freeing up the developer’s terminal. This is especially useful when debugging microservice-based applications that have many component services.</li><li><strong>Convenient System Tray</strong> KFtray runs in the system tray, providing an easy way to manage all port forwards in one place. From the system tray menu, developers can start, stop, restart or remove port forwards. KFtray also displays the status of each port forward, indicating if it is running or stopped. This convenient UI enhances productivity by giving developers quick access to manage and monitor their port forwards.</li></ul><h3>A Case Study: Debugging Microservices With and Without KFtray</h3><p>As a developer focused on building microservices, I found the debugging process to be tedious and time-consuming. Each microservice has its own deployment, necessitating a separate port forward for debugging. Without an efficient tool to manage multiple port forwards, significant time was lost setting up and keeping configurations up to date.</p><ul><li><strong>The Situation Before</strong></li></ul><p>Prior to using KFtray, I had to manually run a kubectl port-forward command for each microservice I wanted to debug. If a pod restarted, the port forward would need to be re-established, causing further delays. When code was updated, the port forward configurations had to be manually updated to match, requiring diligent version control. Overall, managing the debugging infrastructure for microservices was inefficient and distracting.</p><ul><li><strong>A New Approach</strong></li></ul><p>KFtray simplified the debugging workflow by allowing me to define port forward configurations for each microservice in a central repository. With a single click, KFtray establishes all required port forwards, freeing me to focus on debugging my code. KFtray automatically reconnects port forwards when pods restart, and stays up-to-date with configuration changes through Git version control.</p><h3>Get Started</h3><h4>Installation</h4><p>KFtray is available for macOS and Linux users via Homebrew, and directly from the GitHub releases page for other systems. Here’s how you can get started:</p><p><strong>For macOS and Linux:</strong></p><pre>brew tap hcavarsan/kftray</pre><pre>brew install --HEAD kftray</pre><p>For other systems, visit the <a href="https://github.com/hcavarsan/kftray/releases">GitHub releases page</a> for downloadable binaries.</p><p><strong>Configuring Your First Port Forward</strong></p><p>In a few simple steps, you can configure your first port forward:</p><ol><li><strong>Launch the application</strong></li><li><strong>Open the configuration panel from the tray icon</strong></li><li><strong>Add a new configuration:</strong></li></ol><ul><li>Give it a unique alias and set if you want to set the alias as domain to your forward</li><li>Indicate if the configuration is for a port forward for a service (common use) or a proxy (port forward to an endpoint via a Kubernetes cluster).</li><li>Specify the Kubernetes context</li><li>Define the namespace housing your service</li><li>Enter the service name</li><li>Choose TCP or UDP</li><li>Set the local and remote port numbers</li><li>Configure a custom local IP address (optional)</li></ul><ol><li><strong>Activate Your Configuration</strong>: With your configuration saved, simply click on the switch button in the main menu to start the port forward in a single por forward or in Start All to start all configurations at the same time .</li></ol><p>Demonstration:</p><p><a href="https://www.youtube.com/watch?v=nqEhmcKeCc4">https://www.youtube.com/watch?v=nqEhmcKeCc4</a></p><h3>Export configurations to a JSON file</h3><ol><li>Open the main menu in the footer</li><li>Select the Export Local File option</li><li>Choose a file name and location to save the JSON file</li><li>The JSON file will contain all your current configurations</li></ol><p>You can then import this JSON file at any time to restore your configurations.</p><p>Example Json configuration File:</p><pre>[<br> {<br>  &quot;service&quot;: &quot;argocd-server&quot;,<br>  &quot;namespace&quot;: &quot;argocd&quot;,<br>  &quot;local_port&quot;: 8888,<br>  &quot;remote_port&quot;: 8080,<br>  &quot;context&quot;: &quot;test-cluster&quot;,<br>  &quot;workload_type&quot;: &quot;service&quot;,<br>  &quot;protocol&quot;: &quot;tcp&quot;,<br>  &quot;remote_address&quot;: &quot;&quot;,<br>  &quot;local_address&quot;: &quot;127.0.0.1&quot;,<br>  &quot;alias&quot;: &quot;argocd&quot;,<br>  &quot;domain_enabled&quot;: true<br> }<br>]</pre><h3>Sharing the configurations through Git</h3><p>now, with the local json saved, you can share your configurations with your team members by committing the JSON file to a Github repository. This allows for easy collaboration and synchronization of KFtray configurations across your team.</p><p>To import and sync your github configs in kftray:</p><ol><li>Open the application’s main menu</li><li>Select the button with github icon in the footer menu</li><li>Enter the URL of your Git repository and path containing the JSON file</li><li>If your GitHub repository is private, you will need to enter the private token. Credentials are securely saved in the SO keyring (Keychain on macOS). Kftray does not store or save credentials in any local file; they are only stored in the local keyring.</li><li>Select the polling time for when Kftray will synchronize configurations and retrieve them from GitHub.</li><li>KFtray will now sync with the Git repository to automatically import any new configurations or changes committed to the JSON file.</li></ol><p>This allows you to quickly deploy any port forward changes to all team members. And if someone on your team adds a new configuration, it will be automatically synced to everyone else’s KFtray.</p><p>Demonstration:</p><p><a href="https://www.youtube.com/watch?v=BAdL7IzaEh8&amp;t=11s">https://www.youtube.com/watch?v=BAdL7IzaEh8&amp;t=11s</a></p><h3>Share Your Thoughts: Help Us Enhance KFtray with Your Feedback!</h3><p>We hope our app makes your work easier. Any ideas for improvement? We’re all ears!</p><p>Star us on <a href="https://github.com/hcavarsan/kftray">Github</a> ⭐</p><p>Kftray Website: <a href="https://kftray.app/">https://kftray.app</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1980332efef7" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kubernetes-debugging-handling-multiple-kubectl-port-forward-from-your-tray-1980332efef7">Kubernetes Debugging: Handling Multiple kubectl port-forward from your System Tray</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing multiple kubectl port-forward configurations and sharing them via Git ]]></title>
            <link>https://medium.com/@hencavarsan/managing-multiple-kubectl-port-forward-configurations-and-sharing-them-via-git-1383de0f89dd?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1383de0f89dd</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Tue, 27 Feb 2024 22:40:12 GMT</pubDate>
            <atom:updated>2024-02-27T22:40:12.134Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>kubectl port-forward</strong> is an invaluable command for developers working with Kubernetes, allowing for the exposure of local services through a tunnel. However, as the number of services grows, this manual method can become cumbersome. Common issues like terminal lock-up, tunnels lost after pod termination, and lack of support for UDP services can occur.</p><h4>Introducing Kftray</h4><p>To overcome these challenges, we created Kftray, a graphic interface application developed with Rust and TypeScript using the Tauri framework. Kftray offers a more efficient way to manage port-forward tunnels in a Kubernetes environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s0TXN6GdGG3bBbiqvcbaWg.png" /></figure><h4>Key Features</h4><ul><li><strong>Configuration Management:</strong> Easily add, start, and stop multiple port-forward configurations.</li><li><strong>Autocomplete:</strong> Reduces the need to remember complex commands thanks to an autocomplete feature.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*bfTEg4_LHZZbBKTtjPEggQ.png" /></figure><ul><li><strong>Configuration Export:</strong> Export your settings to a JSON file and keep a backup for quick restorations.</li></ul><pre>[<br> {<br> &quot;alias&quot;: &quot;consul-ui&quot;,<br> &quot;context&quot;: &quot;kind-7&quot;,<br> &quot;local_port&quot;: 8500,<br> &quot;namespace&quot;: &quot;consul&quot;,<br> &quot;protocol&quot;: &quot;tcp&quot;,<br> &quot;remote_port&quot;: 8500,<br> &quot;service&quot;: &quot;consul-ui&quot;,<br> &quot;workload_type&quot;: &quot;service&quot;<br> },<br> {<br> &quot;alias&quot;: &quot;redis-gcp&quot;,<br> &quot;context&quot;: &quot;kind-6&quot;,<br> &quot;local_port&quot;: 26379,<br> &quot;namespace&quot;: &quot;default&quot;,<br> &quot;protocol&quot;: &quot;udp&quot;,<br> &quot;remote_address&quot;: &quot;redis-prod.gcp.internal&quot;,<br> &quot;remote_port&quot;: 6379,<br> &quot;workload_type&quot;: &quot;proxy&quot;<br> }<br>]</pre><h4>Solutions for Common Issues</h4><ul><li><strong>Terminals Don’t Get Locked: </strong>Kftray operates independently of kubectl and won’t lock up terminals. An internal relay server allows UDP services to be port-forwarded over TCP.</li><li><strong>Pod Failure Resilience:</strong> The application redirects traffic to new pods when the old ones fail, providing continuous connection.</li><li><strong>Access to Non-Kubernetes Internal Services:</strong> Kftray can direct TCP traffic even for internal services not hosted on the Kubernetes cluster.</li></ul><h4>Git Sync Plus</h4><p>The latest version of Kftray <a href="https://github.com/hcavarsan/kftray/releases/tag/v0.7.0">[v0.7.1]</a> introduces a new feature: synchronizing configurations with a GitHub repository. As soon as updates are made to the JSON configuration file, just one click is needed for Kftray to apply them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*tO4BG6GhRZX5PqM1JXnwPQ.gif" /></figure><h4>Getting Started with Kftray</h4><p>To try out Kftray, visit our GitHub repository and follow the instructions for downloading and installation: <a href="https://github.com/hcavarsan/kftray">[Github Kftray]</a></p><h4>Contributions Are Welcome</h4><p>We invite the community to collaborate on the Kftray project. If you find bugs or have ideas for new features, feel free to contribute. Your participation is crucial for making Kftray even better! <a href="https://github.com/hcavarsan/kftray">[Github Kftray]</a></p><p>we plan to release updates with new features like pooling for synchronization and the ability to add multiple configuration repositories. That’s all for now! I hope you find Kftray helpful! 🚀🎉</p><p>If you do, please consider giving us a star on GitHub at <a href="https://github.com/hcavarsan/kftray">[Kftray]</a>. It really helps us! 🌟</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1383de0f89dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KFtray: Manage Multiple kubectl Port Forwards with Ease from Your Menu Bar ]]></title>
            <link>https://medium.com/@hencavarsan/kftray-manage-multiple-kubectl-port-forwards-with-ease-from-your-menu-bar-67bd3335ea17?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/67bd3335ea17</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 16:50:19 GMT</pubDate>
            <atom:updated>2024-02-16T16:50:19.972Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4enATxNHamBrxXC5wOIFg.png" /></figure><p>KFtray — <a href="https://github.com/hcavarsan/kftray">https://github.com/hcavarsan/kftray</a> is a new open-source for Kubernetes users. It simplifies managing your kubectl port forwards from the menu bar. See why it could be useful for your toolkit</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_1wyhZM1nxE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_1wyhZM1nxE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_1wyhZM1nxE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/09ec1ca758fc28978467603302355947/href">https://medium.com/media/09ec1ca758fc28978467603302355947/href</a></iframe><h4><strong>Kubectl port-forward Pain Points</strong></h4><p><a href="https://github.com/hcavarsan/kftray">KFtray</a> was developed with a clear objective in mind: simplifying the complexities associated with managing multiple <em>kubectl</em> port forwards, enhancing the stability of these connections, and filling in the capabilities that <em>kubectl</em> lacks. The motivation for <a href="https://github.com/hcavarsan/kftray">KFtray</a> stemmed from several identified issues:</p><p><strong>Excessive Terminal Windows</strong>: Managing numerous <em>kubectl</em> port forwards can lead to a cluttered and unmanageable desktop environment, making efficient work challenging.</p><p><strong>Unreliable Connections</strong>: The instability caused by pod failures can disrupt port forward connections, further complicated by the absence of UDP forwarding support in <em>kubectl</em>.</p><h4><strong>Why KFtray?</strong></h4><p><a href="https://github.com/hcavarsan/kftray">KFtray</a> aims to address these challenges by:</p><p><strong>Simplifying the Workflow</strong>: It eradicates the clutter of numerous terminal windows, paving the way for a cleaner and more manageable working environment.</p><p><strong>Ensuring Reliability</strong>: the app is designed to automatically re-establish connections when disruptions occur, maintaining a stable workflow regardless of pod status.</p><p>-<strong>Expanding Capabilities</strong>: By incorporating UDP forwarding and proxy functionality, [KFtray](https://github.com/hcavarsan/kftray) offers a more comprehensive set of tools than what `kubectl` alone provides.</p><p>Through these measures, [KFtray](https://github.com/hcavarsan/kftray) seeks to enhance productivity and streamline the management of Kubernetes resources, making it a valuable tool for developers and system administrators alike.</p><h4><strong>Key Features</strong></h4><p><strong>Reliable Port Forwarding</strong>: Ensures your services stay connected, even if disruptions occur.</p><p><strong>Batch Forwarding</strong>: Initiate multiple port forwardings with a single action.</p><p><strong>Bypass kubectl</strong>: Direct interaction with Kubernetes API for a smoother experience.</p><p><strong>TCP &amp; UDP Support</strong>: Compatibility with both protocol types for versatile service connections.</p><h4><strong>Easy Installation</strong></h4><p>you can directly download it from the GitHub releases page at <a href="https://github.com/hcavarsan/kftray/releases">https://github.com/hcavarsan/kftray/releases</a> . But, for macOS and Linux users, installation via Homebrew is an option, check more details in repository <a href="https://github.com/hcavarsan/kftray?tab=readme-ov-file#kftray">README</a></p><h4><strong>Configurations Management</strong></h4><p>|<br>Kftray stores configurations in a SQLite file in the user’s home folder for easy export, import, and sharing the exported JSON file.</p><h4><strong>Get Started with KFtray</strong></h4><p><a href="https://github.com/hcavarsan/kftray">KFtray</a> offerssimplicity for Kubernetes port forwarding tasks, presented in an easily accessible format. It’s a practical tool for any Kubernetes user seeking a more manageable and effective port forwarding solution.</p><h4><strong>Share Your Thoughts: Help Us Enhance KFtray with Your Feedback</strong></h4><p>We hope our app makes your work easier and gets more folks into Kubernetes. Any ideas for improvement? We’re all ears!</p><p>Star us on GitHub — ⭐ <a href="https://github.com/hcavarsan/kftray">https://github.com/hcavarsan/kftray</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67bd3335ea17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplify Kubernetes Port Forwarding with KFtray]]></title>
            <link>https://medium.com/@hencavarsan/simplify-kubernetes-port-forwarding-with-kftray-c1114226980c?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1114226980c</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Sat, 06 Jan 2024 19:16:33 GMT</pubDate>
            <atom:updated>2024-01-06T19:16:33.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ESiaBiLvZR33SOvpTKAnZA.png" /></figure><h3>Introduction</h3><p>As Kubernetes continues to dominate the container orchestration scene, developers and DevOps engineers need tools that streamline their workflows. <a href="https://github.com/hcavarsan/kftray">KFtray</a> answers the call as an cross-platform tray application that brings ease and efficiency to managing multiple Kubernetes port forwarding configurations directly from your menu bar. Let’s explore how <a href="https://github.com/hcavarsan/kftray">KFtray</a>, a tray application built with Rust and React using the Tauri framework, simplifies Kubernetes port forwarding and adds new features compared to the traditional kubectl port-forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*moNpXIwMy6klLRl5S5etuA.gif" /><figcaption>ktray in action</figcaption></figure><h3>KFtray At A Glance</h3><p><a href="https://github.com/hcavarsan/kftray">KFtray’s</a> main mission is to simplify the process of managing port forwarding within Kubernetes environments. Designed with simplicity and productivity in mind, the app enables users to start and stop multiple port forwarding configurations through a sleek, user-friendly interface. The app stands out for its resilience, one-click operations, and kubectl independence, as it directly connects with the Kubernetes API.</p><h3>Getting Started with KFtray</h3><p>Setting up KFtray is straightforward. Here’s a quick start guide to get you up and running:</p><ol><li><strong>Configuring Port Forwards:</strong><br>The intuitive UI allows you to easily add and manage port forward settings with fields for workload type (Proxy or Service), unique alias, Kubernetes context, namespace, service, remote address (for Proxy), protocol (TCP/UDP), and local/remote ports.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*2nuG67qeuDZHIe6SSuOQoQ.png" /></figure><ol><li><strong>Activating Configurations:</strong><br>You can start a single port forward configuration with a simple click or launch multiple configurations simultaneously, making it a breeze to handle complex setups.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*J5ecXLXbbVcDVAd60O4-Ng.png" /></figure><ol><li><strong>Managing Configurations:</strong><br>KFtray provides options to export/import configurations as JSON files, ensuring that you can share or backup your configurations effortlessly. It also securely saves configurations locally in “$HOME/.kftray/configs.db”. This is an example of the JSON format expected by KFTray:</li></ol><pre><br>[<br>  {<br>    &quot;alias&quot;: &quot;consul-ui&quot;,<br>    &quot;context&quot;: &quot;kind-7&quot;,<br>    &quot;local_port&quot;: 8500,<br>    &quot;namespace&quot;: &quot;consul&quot;,<br>    &quot;protocol&quot;: &quot;tcp&quot;,<br>    &quot;remote_port&quot;: 8500,<br>    &quot;service&quot;: &quot;consul-ui&quot;,<br>    &quot;workload_type&quot;: &quot;service&quot;<br>  },<br>  {<br>    &quot;alias&quot;: &quot;redis-gcp&quot;,<br>    &quot;context&quot;: &quot;kind-6&quot;,<br>    &quot;local_port&quot;: 26379,<br>    &quot;namespace&quot;: &quot;default&quot;,<br>    &quot;protocol&quot;: &quot;udp&quot;,<br>    &quot;remote_address&quot;: &quot;redis-prod.gcp.internal&quot;,<br>    &quot;remote_port&quot;: 6379,<br>    &quot;workload_type&quot;: &quot;proxy&quot;<br>  }<br>]</pre><p><strong>Features that Set KFtray Apart:</strong></p><ul><li><strong>Resilient Port Forwarding Connection:</strong> KFtray ensures your services remain accessible by automatically reconnecting to alternate running pods, should one fail.</li><li><strong>One-Click Multiple Port Forwards:</strong> Rapidly set up multiple port forwarding instances with a single click — an indispensable feature for multitasking professionals.</li><li><strong>Independent of Kubectl:</strong> KFtray’s direct interface with the Kubernetes API removes the dependency on kubectl, providing a smoother experience and catering to those who prefer graphical interfaces over the command line.</li><li><strong>Multi-Protocol Support</strong>: Expanding beyond just TCP, KFtray’s support for multiple protocols including UDP, allows access to a variety of services, both internal and external to your Kubernetes clusters.</li></ul><h3>Final Thoughts</h3><p>KFtray aims to improve the port forwarding experience by providing a simple, efficient, and reliable solution. Whether you’re debugging services or accessing internal resources, KFtray offers the flexibility and reliability required in fast-paced development environments.</p><p>If you think KFtray is as useful as we do, consider giving us a star on GitHub at https://github.com/hcavarsan/kftray.</p><p>Should you encounter any issues or have questions regarding KFtray, please create an issue on our repository or reach out to us. We’re committed to continually improving KFtray based on your feedback.</p><p>We appreciate your claps 👏 if this tool was helpful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1114226980c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet Kftray: My Attempt at Smoothing Out Kubernetes Port Forwarding]]></title>
            <link>https://medium.com/@hencavarsan/meet-kftray-my-attempt-at-smoothing-out-kubernetes-port-forwarding-17f492cc03a0?source=rss-223dff4d3fe0------2</link>
            <guid isPermaLink="false">https://medium.com/p/17f492cc03a0</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[port-forwarding]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Henrique Cavarsan]]></dc:creator>
            <pubDate>Sat, 09 Dec 2023 23:36:36 GMT</pubDate>
            <atom:updated>2023-12-09T23:36:36.352Z</atom:updated>
            <content:encoded><![CDATA[<p>Diving into Kubernetes can sometimes feel like navigating a maze. Port forwarding is crucial for connecting services with development environments, but it’s often a repetitious and manual task. That recurring itch led me to develop Kftray — an simple tray application to help us monitor and manage these connections with less effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*yy0KQxtPeuRwtZkkEShoFQ.gif" /></figure><p><strong>Written in Rust</strong></p><p>I chose Rust for its reputation for creating fast and secure applications, and because, honestly, the safety guarantees it provides make me sleep better at night. My aim was to craft a small tool that keeping those numerous port-forwarding tasks neatly organized.</p><p><strong>A Developer’s Reflection on Kftray</strong></p><p>As someone who spends more time than I’d like to admit staring at screens filled with code, I wanted to create something that would just blend into the background — a proverbial ‘set it and forget it’ kind of tool. Development was as much about solving my own port-forwarding frustrations as it was about potentially helping others with similar issues.</p><p><strong>A Simple Addition to Your Kubernetes Routine</strong></p><p>With Kftray, the process is straightforward: the application lives in the system tray, ready to leap into action without commandeering your workspace.</p><p>It’s not about reinventing your Kubernetes practice; it’s about adding a small piece of functionality that you hardly notice until you need it.</p><p><strong>Open Source</strong></p><p>I hope it can make your port forwarding tasks just a bit easier, or maybe even inspire you to build upon it.</p><p>Give Kftray a try and see if it finds a place in your toolbox. Your feedbacks and code contributions are more than welcome. Find Kftray and its source code over at the <a href="https://github.com/hcavarsan/kftray">GitHub repository</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17f492cc03a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>