1"use strict";(self.webpackChunkpixelpoint_website=self.webpackChunkpixelpoint_website||[]).push([[8652],{3896:function(e,t,n){n.r(t),n.d(t,{Head:function(){return v},default:function(){return w}});var a=n(8453),r=n(6540),o=n(4754);const i={annotations:o.hk,Code:o.Cy},l={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:void 0,showCopyButton:!0,themeName:"dark-plus"};function c(e){const t=Object.assign({p:"p",h2:"h2",a:"a",span:"span",ul:"ul",li:"li",img:"img",h3:"h3"},(0,a.RP)(),e.components);return i||u("CH",!1),i.Code||u("CH.Code",!0),r.createElement(r.Fragment,null,r.createElement("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="dark-plus"] { --ch-t-colorScheme: var(--ch-0);--ch-t-foreground: var(--shiki-token-embed);--ch-t-background: var(--shiki-background-editor);--ch-t-editor-background: var(--shiki-background-editor);--ch-t-editor-foreground: var(--shiki-token-embed);--ch-t-tab-activeBackground: var(--shiki-background-editor);--ch-t-tab-inactiveBackground: var(--shiki-background-editor);--ch-t-tab-border: var(--shiki-menu-background);--ch-t-tab-activeBorder: var(--shiki-background-editor);--ch-t-editorGroupHeader-tabsBackground: var(--shiki-background-header);--ch-t-input-foreground: var(--shiki-token-embed);--ch-t-sideBar-foreground: var(--shiki-token-embed); }'}}),"\n",r.createElement(t.p,null,"Probably you know that Kubernetes has built-in port forwarding functionality in their CLI. Port forwarding mostly used for the purpose of getting access to internal cluster resources and debugging."),"\n",r.createElement(t.h2,{id:"how-does-it-work"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#how-does-it-work"},r.createElement(t.span,{className:"icon icon-link"})),"How does it work?"),"\n",r.createElement(t.p,null,"Generally speaking, using port forwarding you could get on your âlocalhostâ any services launched in your cluster. For example, if you have Redis installed in the cluster on 6379, by using a command like this:"),"\n",r.createElement(i.Code,{codeConfig:l,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"port-forward redis-master-765d459796-258hz 7000:",props:{style:{color:"var(--shiki-token-string)"}}},{content:"6379",props:{style:{color:"var(--shiki-token-constant)"}}}]}],lang:"bash"},annotations:[]}]}),"\n",r.createElement(t.p,null,"you could forward Redis from the cluster to localhost:7000, access it locally and do whatever you want to do with it."),"\n",r.createElement(t.p,null,"Behind the scene, kubectl uses Kubernetes API that tunnel all traffic to destination resource over a single HTTP connection."),"\n",r.createElement(t.h2,{id:"problems-come"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#problems-come"},r.createElement(t.span,{className:"icon icon-link"})),"Problems comeâ¦"),"\n",r.createElement(t.p,null,"Itâs nice to have a built-in functionality in kubectl, but it could be ok if you use it once per month, but if you use it more often you could mention the following problems:"),"\n",r.createElement(t.ul,null,"\n",r.createElement(t.li,null,"It does not support auto-reconnect. Itâs very annoying to re-run command again and again when your connection is not stable or the destination resource kills a connection"),"\n",r.createElement(t.li,null,"You have to remember namespaces/pods/deployments exact names to forward something"),"\n",r.createElement(t.li,null,"Working with Multiple clusters also could be tricky"),"\n"),"\n",r.createElement(t.h2,{id:"kube-forwarder-is-the-solution"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#kube-forwarder-is-the-solution"},r.createElement(t.span,{className:"icon icon-link"})),"Kube Forwarder is the solution"),"\n",r.createElement(t.p,null,"Kube Forwarder is an open-source ",r.createElement(t.a,{href:"https://kube-forwarder.pixelpoint.io/"},"Kubernetes port-forwarding app")," built on Electron and available for macOS, Windows, and Linux."),"\n",r.createElement(t.img,{src:"/490c4
115328fd0e52486bcf430a6674d7/picture1.gif",alt:"Kube Forwarder"}),"\n",r.createElement(t.p,null,"Kube Forwarder has several features that makes it awesome:"),"\n",r.createElement(t.h3,{id:"auto-reconnect"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#auto-reconnect"},r.createElement(t.span,{className:"icon icon-link"})),"Auto-reconnect"),"\n",r.createElement(t.p,null,"No more issues with failed connection, Kube Forwarder keeps the connection alive while you forward resources."),"\n",r.createElement(t.h3,{id:"auto-complete"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#auto-complete"},r.createElement(t.span,{className:"icon icon-link"})),"Auto-complete"),"\n",r.createElement(t.p,null,"Take a look at how simple it is to add a new resource to your bookmarks by filling the form with autocompleted namespaces/pods/deployments/services names."),"\n",r.createElement(t.h3,{id:"multiple-clusters-support"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#multiple-clusters-support"},r.createElement(t.span,{className:"icon icon-link"})),"Multiple clusters support"),"\n",r.createElement(t.p,null,"Add a few clusters and bookmark all relevant resources for you."),"\n",r.createElement(t.h3,{id:"zero-native-dependencies"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#zero-native-dependencies"},r.createElement(t.span,{className:"icon icon-link"})),"Zero native dependencies"),"\n",r.createElement(t.p,null,"You donât need to have kubectl installed, so even people who not familiar with CLI could use it."),"\n",r.createElement(t.h3,{id:"importexport"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#importexport"},r.createElement(t.span,{className:"icon icon-link"})),"Import/Export"),"\n",r.createElement(t.p,null,"As a DevOps you could bookmark all necessary resources and then export it in JSON. Give it to your devs and they will be able to import it in their Kube Forwarder app and use it without bothering you."),"\n",r.createElement(t.p,null,"Kube Forwarder has very simple UX, adding new clusters and forwarding resources take seconds. The app tested with GKE, EKS, AKS and Digital Ocean."),"\n",r.createElement(t.h2,{id:"what-do-you-think"},r.createElement(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-do-you-think"},r.createElement(t.span,{className:"icon icon-link"})),"What do you think?"),"\n",r.createElement(t.p,null,r.createElement(t.a,{href:"https://github.com/pixel-point/kube-forwarder"},"Star us on Github if you like the app â")),"\n",r.createElement(t.p,null,"Create an issue if you find some problems or have a question."))}var s=function(e){void 0===e&&(e={});const{wrapper:t}=Object.assign({},(0,a.RP)(),e.components);return t?r.createElement(t,e,r.createElement(c,e)):c(e)};function u(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}var d=n(2532),m=n(1021),h=n(545),p=n(9072),b=n(3669),k=n(9063),f=n(352),E=n(84);const g=e=>{let{data:{mdx:{author:t,frontmatter:n,fields:{slug:a}},allMdx:{nodes:o}},location:i,pageContext:{videoCovers:l},children:c}=e;return r.createElement(k.A,{headerTheme:"black",headerShowThemeButton:!0},r.createElement("article",{className:"safe-paddings pt-32 sm:pt-24"},r.createElement("div",{className:"container"},r.createElement("div",{className:"relative mx-auto max-w-[696px] xl:mx-0 xl:flex xl:max-w-none xl:justify-center xl:space-x-20 lg:space-x-8 md:block md:space-x-0"},r.createElement("div",{className:"xl:max-w-[696px] lg:max-w-[626px] md:max-w-none"},r.createElement(h.A,Object.assign({},n,{slug:a})),r.createElement(m.A,{content:c,videoCovers:l})),r.createElement(p.A,{author:t,readMorePosts:o,socialShareUrl:i.href})))),r.createElement(b.A,{withTopMargin:!0}))};function w(e){return r.createElement(g,e,r.createElement(s,e))}const v=e=>{let{data:{mdx:{frontmatter:{title:t,summary:n,ogImage:a}}}}=e;const o=(0,d.d)(a);return r.createElement(f.A,E.A.blogPost({title:t,description:n,ogImage:o}))}}}]); 2//# sourceMappingURL=component---src-templates-blog-post-jsx-content-file-path-content-posts-2019-08-14-kubernetes-port-forwarding-simple-like-never-before-index-md-1ffd6ac6f3ff780dcb13.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.