<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: naison</title>
    <description>The latest articles on DEV Community by naison (@wencaiwulue).</description>
    <link>https://dev.to/wencaiwulue</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1377614%2F82a9b93e-bcf8-447e-9545-46c23c7e5868.jpeg</url>
      <title>DEV Community: naison</title>
      <link>https://dev.to/wencaiwulue</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wencaiwulue"/>
    <language>en</language>
    <item>
      <title>KubeVPN: Revolutionizing Kubernetes Local Development</title>
      <dc:creator>naison</dc:creator>
      <pubDate>Mon, 24 Feb 2025 10:57:41 +0000</pubDate>
      <link>https://dev.to/wencaiwulue/kubevpn-revolutionizing-kubernetes-local-development-24go</link>
      <guid>https://dev.to/wencaiwulue/kubevpn-revolutionizing-kubernetes-local-development-24go</guid>
      <description>&lt;h2&gt;
  
  
  Why KubeVPN?
&lt;/h2&gt;

&lt;p&gt;In the Kubernetes era, developers face a critical conflict between &lt;strong&gt;cloud-native complexity&lt;/strong&gt; and &lt;strong&gt;local development&lt;br&gt;
agility&lt;/strong&gt;. Traditional workflows force developers to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Suffer frequent &lt;code&gt;kubectl port-forward&lt;/code&gt;/&lt;code&gt;exec&lt;/code&gt; operations&lt;/li&gt;
&lt;li&gt;Set up mini Kubernetes clusters locally (e.g., minikube)&lt;/li&gt;
&lt;li&gt;Risk disrupting shared dev environments&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;KubeVPN solves this through &lt;strong&gt;cloud-native network tunneling&lt;/strong&gt;, seamlessly extending Kubernetes cluster networks to&lt;br&gt;
local machines with three breakthroughs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Zero-Code Integration&lt;/strong&gt;: Access cluster services without code changes&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;Real-Environment Debugging&lt;/strong&gt;: Debug cloud services in local IDEs&lt;/li&gt;
&lt;li&gt;🔄 &lt;strong&gt;Bidirectional Traffic Control&lt;/strong&gt;: Route specific traffic to local or cloud&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bycsxjp1h9mjnjcgjpi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bycsxjp1h9mjnjcgjpi.png" alt="KubeVPN Architecture" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Core Capabilities
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Direct Cluster Networking
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubevpn connect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Instantly gain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Service name access (e.g., &lt;code&gt;productpage.default.svc&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;✅ Pod IP connectivity&lt;/li&gt;
&lt;li&gt;✅ Native Kubernetes DNS resolution
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜ curl productpage:9080 &lt;span class="c"&gt;# Direct cluster access&lt;/span&gt;
&amp;lt;&lt;span class="o"&gt;!&lt;/span&gt;DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;...&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Smart Traffic Interception
&lt;/h3&gt;

&lt;p&gt;Precision routing via header conditions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubevpn proxy deployment/productpage &lt;span class="nt"&gt;--headers&lt;/span&gt; &lt;span class="nv"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dev-team
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Requests with &lt;code&gt;user=dev-team&lt;/code&gt; → Local service&lt;/li&gt;
&lt;li&gt;Others → Original cluster handling&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Multi-Cluster Mastery
&lt;/h3&gt;

&lt;p&gt;Connect two clusters simultaneously:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubevpn connect &lt;span class="nt"&gt;-n&lt;/span&gt; dev &lt;span class="nt"&gt;--kubeconfig&lt;/span&gt; ~/.kube/cluster1  &lt;span class="c"&gt;# Primary&lt;/span&gt;
kubevpn connect &lt;span class="nt"&gt;-n&lt;/span&gt; prod &lt;span class="nt"&gt;--kubeconfig&lt;/span&gt; ~/.kube/cluster2 &lt;span class="nt"&gt;--lite&lt;/span&gt; &lt;span class="c"&gt;# Secondary&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Local Containerized Dev
&lt;/h3&gt;

&lt;p&gt;Clone cloud pods to local Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubevpn dev deployment/authors &lt;span class="nt"&gt;--entrypoint&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Launched containers feature:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌐 Identical network namespace&lt;/li&gt;
&lt;li&gt;📁 Exact volume mounts&lt;/li&gt;
&lt;li&gt;⚙️ Matching environment variables&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Deep Dive
&lt;/h2&gt;

&lt;p&gt;KubeVPN's three-layer architecture:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Core Tech&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Traffic Manager&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cluster-side interception&lt;/td&gt;
&lt;td&gt;MutatingWebhook + iptables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VPN Tunnel&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Secure local-cluster channel&lt;/td&gt;
&lt;td&gt;tun device + WireGuard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Control Plane&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Config/state sync&lt;/td&gt;
&lt;td&gt;gRPC streaming + CRDs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;graph TD
    Local[Local Machine] --&amp;gt;|Encrypted Tunnel| Tunnel[VPN Gateway]
    Tunnel --&amp;gt;|Service Discovery| K8sAPI[Kubernetes API]
    Tunnel --&amp;gt;|Traffic Proxy| Pod[Workload Pods]
    subgraph K8s Cluster
        K8sAPI --&amp;gt; TrafficManager[Traffic Manager]
        TrafficManager --&amp;gt; Pod
    end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Performance Benchmark
&lt;/h2&gt;

&lt;p&gt;100QPS load test results:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Latency&lt;/th&gt;
&lt;th&gt;CPU Usage&lt;/th&gt;
&lt;th&gt;Memory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Direct Access&lt;/td&gt;
&lt;td&gt;28ms&lt;/td&gt;
&lt;td&gt;12%&lt;/td&gt;
&lt;td&gt;256MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KubeVPN Proxy&lt;/td&gt;
&lt;td&gt;33ms&lt;/td&gt;
&lt;td&gt;15%&lt;/td&gt;
&lt;td&gt;300MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Telepresence&lt;/td&gt;
&lt;td&gt;41ms&lt;/td&gt;
&lt;td&gt;22%&lt;/td&gt;
&lt;td&gt;420MB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;KubeVPN outperforms alternatives in overhead control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS/Linux&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;kubevpn

&lt;span class="c"&gt;# Windows&lt;/span&gt;
scoop &lt;span class="nb"&gt;install &lt;/span&gt;kubevpn

&lt;span class="c"&gt;# Via Krew&lt;/span&gt;
kubectl krew &lt;span class="nb"&gt;install &lt;/span&gt;kubevpn/kubevpn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Sample Workflow
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Connect Cluster&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubevpn connect &lt;span class="nt"&gt;--namespace&lt;/span&gt; dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Develop &amp;amp; Debug&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start local service&lt;/span&gt;
./my-service &amp;amp;

&lt;span class="c"&gt;# Intercept debug traffic&lt;/span&gt;
kubevpn proxy deployment/frontend &lt;span class="nt"&gt;--headers&lt;/span&gt; x-debug&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Validate&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"x-debug: true"&lt;/span&gt; frontend.dev.svc/cluster-api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ecosystem
&lt;/h2&gt;

&lt;p&gt;KubeVPN's growing toolkit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔌 &lt;strong&gt;VS Code Extension&lt;/strong&gt;: Visual traffic management&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;CI/CD Pipelines&lt;/strong&gt;: Automated testing/deployment&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Monitoring Dashboard&lt;/strong&gt;: Real-time network metrics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Join developer community:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Contribute your first PR&lt;/span&gt;
git clone https://github.com/kubenetworks/kubevpn.git
make kubevpn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;Project URL: &lt;a href="https://github.com/kubenetworks/kubevpn" rel="noopener noreferrer"&gt;https://github.com/kubenetworks/kubevpn&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Documentation: &lt;a href="https://github.com/kubenetworks/kubevpn/wiki" rel="noopener noreferrer"&gt;Complete Guide&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Support: &lt;a href="https://kubevpn.slack.com" rel="noopener noreferrer"&gt;Slack&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With KubeVPN, developers finally enjoy cloud-native debugging while sipping coffee ☕️🚀&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>aws</category>
      <category>cloud</category>
    </item>
    <item>
      <title>KubeVPN offers a Cloud-Native Dev Environment that seamlessly connects to your Kubernetes cluster network.</title>
      <dc:creator>naison</dc:creator>
      <pubDate>Sat, 23 Mar 2024 15:40:52 +0000</pubDate>
      <link>https://dev.to/wencaiwulue/kubevpn-offers-a-cloud-native-dev-environment-that-seamlessly-connects-to-your-kubernetes-cluster-network-1a4a</link>
      <guid>https://dev.to/wencaiwulue/kubevpn-offers-a-cloud-native-dev-environment-that-seamlessly-connects-to-your-kubernetes-cluster-network-1a4a</guid>
      <description>&lt;h1&gt;
  
  
  KubeVPN
&lt;/h1&gt;

&lt;p&gt;&lt;a href="//README_ZH.md"&gt;中文&lt;/a&gt; | &lt;a href="//README.md"&gt;English&lt;/a&gt; | &lt;a href="https://github.com/kubenetworks/kubevpn/wiki/Architecture" rel="noopener noreferrer"&gt;Wiki&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;KubeVPN offers a Cloud-Native Dev Environment that seamlessly connects to your Kubernetes cluster network. &lt;/p&gt;

&lt;p&gt;Gain access to the Kubernetes cluster network effortlessly using service names or Pod IP/Service IP. Facilitate the interception of inbound traffic from remote Kubernetes cluster services to your local PC through a service mesh and more. &lt;/p&gt;

&lt;p&gt;For instance, you have the flexibility to run your Kubernetes pod within a local Docker container, ensuring an identical environment, volume, and network setup. &lt;br&gt;
With KubeVPN, empower yourself to develop applications entirely on your local PC!&lt;/p&gt;
&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="//./README.md#quickstart"&gt;QuickStart&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//./README.md#functions"&gt;Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//./README.md#faq"&gt;FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//./README.md#architecture"&gt;Architecture&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  QuickStart
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Install from GitHub release
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://github.com/kubenetworks/kubevpn/releases/latest" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Install from custom krew index
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;
  kubectl krew index add kubevpn https://github.com/kubenetworks/kubevpn.git &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  kubectl krew &lt;span class="nb"&gt;install &lt;/span&gt;kubevpn/kubevpn &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; kubectl kubevpn 
&lt;span class="o"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Install from build it manually
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;
  git clone https://github.com/kubenetworks/kubevpn.git &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;cd &lt;/span&gt;kubevpn &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; make kubevpn &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./bin/kubevpn
&lt;span class="o"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Install bookinfo as demo application
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; https://raw.githubusercontent.com/kubenetworks/kubevpn/master/samples/bookinfo.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For clean up after test&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete &lt;span class="nt"&gt;-f&lt;/span&gt; https://raw.githubusercontent.com/kubenetworks/kubevpn/master/samples/bookinfo.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Connect to k8s cluster network
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn connect
Password:
start to connect
get cidr from cluster info...
get cidr from cluster info ok
get cidr from cni...
&lt;span class="nb"&gt;wait &lt;/span&gt;pod cni-net-dir-kubevpn to be running &lt;span class="nb"&gt;timeout&lt;/span&gt;, reason , ignore
get cidr from svc...
get cidr from svc ok
get cidr successfully
traffic manager not exist, try to create it...
label namespace default
create serviceAccount kubevpn-traffic-manager
create roles kubevpn-traffic-manager
create roleBinding kubevpn-traffic-manager
create service kubevpn-traffic-manager
create deployment kubevpn-traffic-manager
pod kubevpn-traffic-manager-66d969fd45-9zlbp is Pending
Container     Reason            Message
control-plane ContainerCreating
vpn           ContainerCreating
webhook       ContainerCreating

pod kubevpn-traffic-manager-66d969fd45-9zlbp is Running
Container     Reason           Message
control-plane ContainerRunning
vpn           ContainerRunning
webhook       ContainerRunning

Creating mutatingWebhook_configuration &lt;span class="k"&gt;for &lt;/span&gt;kubevpn-traffic-manager
update ref count successfully
port forward ready
tunnel connected
dns service ok
+---------------------------------------------------------------------------+
|    Now you can access resources &lt;span class="k"&gt;in &lt;/span&gt;the kubernetes cluster, enjoy it :&lt;span class="o"&gt;)&lt;/span&gt;    |
+---------------------------------------------------------------------------+
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn status
ID Mode Cluster               Kubeconfig                 Namespace Status
0  full ccijorbccotmqodvr189g /Users/naison/.kube/config default   Connected
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubectl get pods &lt;span class="nt"&gt;-o&lt;/span&gt; wide
NAME                                       READY   STATUS             RESTARTS   AGE     IP                NODE              NOMINATED NODE   READINESS GATES
authors-dbb57d856-mbgqk                    3/3     Running            0          7d23h   172.29.2.132      192.168.0.5       &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
details-7d8b5f6bcf-hcl4t                   1/1     Running            0          61d     172.29.0.77       192.168.104.255   &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
kubevpn-traffic-manager-66d969fd45-9zlbp   3/3     Running            0          74s     172.29.2.136      192.168.0.5       &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
productpage-788df7ff7f-jpkcs               1/1     Running            0          61d     172.29.2.134      192.168.0.5       &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
ratings-77b6cd4499-zvl6c                   1/1     Running            0          61d     172.29.0.86       192.168.104.255   &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
reviews-85c88894d9-vgkxd                   1/1     Running            0          24d     172.29.2.249      192.168.0.5       &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ ping 172.29.2.134
PING 172.29.2.134 &lt;span class="o"&gt;(&lt;/span&gt;172.29.2.134&lt;span class="o"&gt;)&lt;/span&gt;: 56 data bytes
64 bytes from 172.29.2.134: &lt;span class="nv"&gt;icmp_seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="nv"&gt;ttl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;63 &lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;55.727 ms
64 bytes from 172.29.2.134: &lt;span class="nv"&gt;icmp_seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;ttl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;63 &lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;56.270 ms
64 bytes from 172.29.2.134: &lt;span class="nv"&gt;icmp_seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2 &lt;span class="nv"&gt;ttl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;63 &lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;55.228 ms
64 bytes from 172.29.2.134: &lt;span class="nv"&gt;icmp_seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3 &lt;span class="nv"&gt;ttl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;63 &lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;54.293 ms
^C
&lt;span class="nt"&gt;---&lt;/span&gt; 172.29.2.134 ping statistics &lt;span class="nt"&gt;---&lt;/span&gt;
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev &lt;span class="o"&gt;=&lt;/span&gt; 54.293/55.380/56.270/0.728 ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubectl get services &lt;span class="nt"&gt;-o&lt;/span&gt; wide
NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT&lt;span class="o"&gt;(&lt;/span&gt;S&lt;span class="o"&gt;)&lt;/span&gt;                              AGE     SELECTOR
authors                   ClusterIP   172.21.5.160    &amp;lt;none&amp;gt;        9080/TCP                             114d    &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;authors
details                   ClusterIP   172.21.6.183    &amp;lt;none&amp;gt;        9080/TCP                             114d    &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;details
kubernetes                ClusterIP   172.21.0.1      &amp;lt;none&amp;gt;        443/TCP                              319d    &amp;lt;none&amp;gt;
kubevpn-traffic-manager   ClusterIP   172.21.2.86     &amp;lt;none&amp;gt;        8422/UDP,10800/TCP,9002/TCP,80/TCP   2m28s   &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;kubevpn-traffic-manager
productpage               ClusterIP   172.21.10.49    &amp;lt;none&amp;gt;        9080/TCP                             114d    &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;productpage
ratings                   ClusterIP   172.21.3.247    &amp;lt;none&amp;gt;        9080/TCP                             114d    &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ratings
reviews                   ClusterIP   172.21.8.24     &amp;lt;none&amp;gt;        9080/TCP                             114d    &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;reviews
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ curl 172.21.10.49:9080
&amp;lt;&lt;span class="o"&gt;!&lt;/span&gt;DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;&lt;span class="nb"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &amp;lt;title&amp;gt;Simple Bookstore App&amp;lt;/title&amp;gt;
&amp;lt;meta &lt;span class="nv"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;meta http-equiv&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"IE=edge"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;meta &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"viewport"&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Domain resolve
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ curl productpage.default.svc.cluster.local:9080
&amp;lt;&lt;span class="o"&gt;!&lt;/span&gt;DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;&lt;span class="nb"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &amp;lt;title&amp;gt;Simple Bookstore App&amp;lt;/title&amp;gt;
&amp;lt;meta &lt;span class="nv"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;meta http-equiv&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"IE=edge"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;meta &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"viewport"&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Short domain resolve
&lt;/h3&gt;

&lt;p&gt;To access the service in the cluster, service name or you can use the short domain name, such&lt;br&gt;
as &lt;code&gt;productpage&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ curl productpage:9080
&amp;lt;&lt;span class="o"&gt;!&lt;/span&gt;DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;&lt;span class="nb"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &amp;lt;title&amp;gt;Simple Bookstore App&amp;lt;/title&amp;gt;
&amp;lt;meta &lt;span class="nv"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;meta http-equiv&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"IE=edge"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Disclaimer:&lt;/em&gt;&lt;/strong&gt; This only works on the namespace where kubevpn-traffic-manager is deployed. Otherwise, use &lt;a href="//./README.md#domain-resolve"&gt;Domain resolve&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect to multiple kubernetes cluster network
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn status
ID Mode Cluster               Kubeconfig                 Namespace Status
0  full ccijorbccotmqodvr189g /Users/naison/.kube/config default   Connected
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn connect &lt;span class="nt"&gt;-n&lt;/span&gt; default &lt;span class="nt"&gt;--kubeconfig&lt;/span&gt; ~/.kube/dev_config &lt;span class="nt"&gt;--lite&lt;/span&gt;
start to connect
got cidr from cache
get cidr successfully
update ref count successfully
traffic manager already exist, reuse it
port forward ready
tunnel connected
adding route...
dns service ok
+---------------------------------------------------------------------------+
|    Now you can access resources &lt;span class="k"&gt;in &lt;/span&gt;the kubernetes cluster, enjoy it :&lt;span class="o"&gt;)&lt;/span&gt;    |
+---------------------------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn status
ID Mode Cluster               Kubeconfig                     Namespace Status
0  full ccijorbccotmqodvr189g /Users/naison/.kube/config     default   Connected
1  lite ccidd77aam2dtnc3qnddg /Users/naison/.kube/dev_config default   Connected
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Reverse proxy
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn proxy deployment/productpage
already connect to cluster
start to create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage
workload default/deployment/productpage is controlled by a controller
rollout status &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"productpage"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"productpage"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
deployment &lt;span class="s2"&gt;"productpage"&lt;/span&gt; successfully rolled out
rollout status &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage successfully
create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage successfully
+---------------------------------------------------------------------------+
|    Now you can access resources &lt;span class="k"&gt;in &lt;/span&gt;the kubernetes cluster, enjoy it :&lt;span class="o"&gt;)&lt;/span&gt;    |
+---------------------------------------------------------------------------+
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For local testing, save the following code as &lt;code&gt;hello.go&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"io"&lt;/span&gt;
    &lt;span class="s"&gt;"net/http"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;writer&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WriteString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Hello world!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&amp;gt;&amp;gt;Received request: %s %s from %s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RequestURI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RemoteAddr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":9080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and compile it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go build hello.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then run it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./hello &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;selector&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;productpage
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;pod&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;kubectl get pods &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;selector&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; default &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.items[0].metadata.name}'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;pod_ip&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;kubectl get pod &lt;span class="nv"&gt;$pod&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; default &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.status.podIP}'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
curl &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"a: 1"&lt;/span&gt; http://&lt;span class="nv"&gt;$pod_ip&lt;/span&gt;:9080/health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;response would like below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ curl -v -H "a: 1" http://$pod_ip:9080/health
*   Trying 192.168.72.77:9080...
* Connected to 192.168.72.77 (192.168.72.77) port 9080 (#0)
&amp;gt; GET /health HTTP/1.1
&amp;gt; Host: 192.168.72.77:9080
&amp;gt; User-Agent: curl/7.87.0
&amp;gt; Accept: */*
&amp;gt; a: 1
&amp;gt; 
&amp;gt;&amp;gt;Received request: GET /health from xxx.xxx.xxx.xxx:52974
* Mark bundle as not supporting multiuse
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Date: Sat, 04 Nov 2023 10:19:50 GMT
&amp;lt; Content-Length: 12
&amp;lt; Content-Type: text/plain; charset=utf-8
&amp;lt; 
* Connection #0 to host 192.168.72.77 left intact
Hello world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;also you can access via service name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ curl productpage:9080
Hello world!%
➜  ~ curl productpage.default.svc.cluster.local:9080
Hello world!%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Reverse proxy with mesh
&lt;/h3&gt;

&lt;p&gt;Support HTTP, GRPC and WebSocket etc. with specific header &lt;code&gt;"a: 1"&lt;/code&gt; will route to your local machine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn proxy deployment/productpage &lt;span class="nt"&gt;--headers&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
already connect to cluster
start to create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage
patch workload default/deployment/productpage with sidecar
rollout status &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"productpage"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"productpage"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
deployment &lt;span class="s2"&gt;"productpage"&lt;/span&gt; successfully rolled out
rollout status &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage successfully
create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;deployment/productpage successfully
+---------------------------------------------------------------------------+
|    Now you can access resources &lt;span class="k"&gt;in &lt;/span&gt;the kubernetes cluster, enjoy it :&lt;span class="o"&gt;)&lt;/span&gt;    |
+---------------------------------------------------------------------------+
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;first access without header "a: 1", it will access existing pod on kubernetes cluster.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ curl productpage:9080
&amp;lt;&lt;span class="o"&gt;!&lt;/span&gt;DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;&lt;span class="nb"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &amp;lt;title&amp;gt;Simple Bookstore App&amp;lt;/title&amp;gt;
&amp;lt;meta &lt;span class="nv"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;meta http-equiv&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"IE=edge"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;meta &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"viewport"&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's access local service with header &lt;code&gt;"a: 1"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ curl productpage:9080 &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"a: 1"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;Received request: GET / from xxx.xxx.xxx.xxx:51296
Hello world!  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to cancel proxy, just run command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn leave deployments/productpage
leave workload deployments/productpage
workload default/deployments/productpage is controlled by a controller
leave workload deployments/productpage successfully
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dev mode in local Docker 🐳
&lt;/h3&gt;

&lt;p&gt;Run the Kubernetes pod in the local Docker container, and cooperate with the service mesh to intercept the traffic with&lt;br&gt;
the specified header to the local, or all the traffic to the local.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn dev deployment/authors &lt;span class="nt"&gt;--headers&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;--entrypoint&lt;/span&gt; sh
connectting to cluster
start to connect
got cidr from cache
get cidr successfully
update ref count successfully
traffic manager already exist, reuse it
port forward ready
tunnel connected
dns service ok
start to create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors
patch workload default/Deployment.apps/authors with sidecar
rollout status &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"authors"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"authors"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
deployment &lt;span class="s2"&gt;"authors"&lt;/span&gt; successfully rolled out
rollout status &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors successfully
create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors successfully
&lt;span class="nb"&gt;tar&lt;/span&gt;: removing leading &lt;span class="s1"&gt;'/'&lt;/span&gt; from member names
/var/folders/30/cmv9c_5j3mq_kthx63sb1t5c0000gn/T/4563987760170736212:/var/run/secrets/kubernetes.io/serviceaccount
&lt;span class="nb"&gt;tar&lt;/span&gt;: Removing leading &lt;span class="sb"&gt;`&lt;/span&gt;/&lt;span class="s1"&gt;' from member names
tar: Removing leading `/'&lt;/span&gt; from hard &lt;span class="nb"&gt;link &lt;/span&gt;targets
/var/folders/30/cmv9c_5j3mq_kthx63sb1t5c0000gn/T/4044542168121221027:/var/run/secrets/kubernetes.io/serviceaccount
create docker network 56c25058d4b7498d02c2c2386ccd1b2b127cb02e8a1918d6d24bffd18570200e
Created container: nginx_default_kubevpn_a9a22
Wait container nginx_default_kubevpn_a9a22 to be running...
Container nginx_default_kubevpn_a9a22 is running on port 80/tcp:80 8888/tcp:8888 9080/tcp:9080 now
WARNING: The requested image&lt;span class="s1"&gt;'s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Created main container: authors_default_kubevpn_a9a22
/opt/microservices # ls
app
/opt/microservices # ps -ef
PID   USER     TIME  COMMAND
    1 root      0:00 nginx: master process nginx -g daemon off;
   29 101       0:00 nginx: worker process
   30 101       0:00 nginx: worker process
   31 101       0:00 nginx: worker process
   32 101       0:00 nginx: worker process
   33 101       0:00 nginx: worker process
   34 root      0:00 {sh} /usr/bin/qemu-x86_64 /bin/sh sh
   44 root      0:00 ps -ef
/opt/microservices # apk add curl
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/4) Installing brotli-libs (1.0.9-r5)
(2/4) Installing nghttp2-libs (1.43.0-r0)
(3/4) Installing libcurl (8.0.1-r0)
(4/4) Installing curl (8.0.1-r0)
Executing busybox-1.33.1-r3.trigger
OK: 8 MiB in 19 packages
/opt/microservices # ./app &amp;amp;
/opt/microservices # 2023/09/30 13:41:58 Start listening http port 9080 ...

/opt/microservices # curl localhost:9080/health
{"status":"Authors is healthy"} /opt/microservices # echo "continue testing pod access..."
continue testing pod access...
/opt/microservices # exit
prepare to exit, cleaning up
update ref count successfully
tun device closed
leave resource: deployments.apps/authors
workload default/deployments.apps/authors is controlled by a controller
leave resource: deployments.apps/authors successfully
clean up successfully
prepare to exit, cleaning up
update ref count successfully
clean up successfully
➜  ~
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that it will start up two containers with docker, mapping to pod two container, and share port with same&lt;br&gt;
network, you can use &lt;code&gt;localhost:port&lt;/code&gt;&lt;br&gt;
to access another container. And more, all environment、volume and network are the same as remote kubernetes pod, it is&lt;br&gt;
truly consistent with the kubernetes runtime. Makes develop on local PC come true.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                                                NAMES
afdecf41c08d   naison/authors:latest           &lt;span class="s2"&gt;"sh"&lt;/span&gt;                     37 seconds ago   Up 36 seconds                                                                        authors_default_kubevpn_a9a22
fc04e42799a5   nginx:latest                    &lt;span class="s2"&gt;"/docker-entrypoint.…"&lt;/span&gt;   37 seconds ago   Up 37 seconds   0.0.0.0:80-&amp;gt;80/tcp, 0.0.0.0:8888-&amp;gt;8888/tcp, 0.0.0.0:9080-&amp;gt;9080/tcp   nginx_default_kubevpn_a9a22
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is how to access pod in local docker container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;authors_pod&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;kubectl get pods &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;authors &lt;span class="nt"&gt;-n&lt;/span&gt; default &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.items[0].metadata.name}'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;authors_pod_ip&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;kubectl get pod &lt;span class="nv"&gt;$authors_pod&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; default &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.status.podIP}'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
curl &lt;span class="nt"&gt;-kv&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"a: 1"&lt;/span&gt; http://&lt;span class="nv"&gt;$authors_pod_ip&lt;/span&gt;:80/health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify logs of nginx container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker logs &lt;span class="si"&gt;$(&lt;/span&gt;docker ps &lt;span class="nt"&gt;--format&lt;/span&gt; &lt;span class="s1"&gt;'{{.Names}}'&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;nginx_default_kubevpn&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you just want to start up a docker image, you can use a simple way like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubevpn dev deployment/authors &lt;span class="nt"&gt;--no-proxy&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--rm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example：&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn dev deployment/authors &lt;span class="nt"&gt;--no-proxy&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--rm&lt;/span&gt;
connectting to cluster
start to connect
got cidr from cache
get cidr successfully
update ref count successfully
traffic manager already exist, reuse it
port forward ready
tunnel connected
dns service ok
&lt;span class="nb"&gt;tar&lt;/span&gt;: removing leading &lt;span class="s1"&gt;'/'&lt;/span&gt; from member names
/var/folders/30/cmv9c_5j3mq_kthx63sb1t5c0000gn/T/5631078868924498209:/var/run/secrets/kubernetes.io/serviceaccount
&lt;span class="nb"&gt;tar&lt;/span&gt;: Removing leading &lt;span class="sb"&gt;`&lt;/span&gt;/&lt;span class="s1"&gt;' from member names
tar: Removing leading `/'&lt;/span&gt; from hard &lt;span class="nb"&gt;link &lt;/span&gt;targets
/var/folders/30/cmv9c_5j3mq_kthx63sb1t5c0000gn/T/1548572512863475037:/var/run/secrets/kubernetes.io/serviceaccount
create docker network 56c25058d4b7498d02c2c2386ccd1b2b127cb02e8a1918d6d24bffd18570200e
Created container: nginx_default_kubevpn_ff34b
Wait container nginx_default_kubevpn_ff34b to be running...
Container nginx_default_kubevpn_ff34b is running on port 80/tcp:80 8888/tcp:8888 9080/tcp:9080 now
WARNING: The requested image&lt;span class="s1"&gt;'s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Created main container: authors_default_kubevpn_ff34b
2023/09/30 14:02:31 Start listening http port 9080 ...

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the main process will hang up to show you log.&lt;/p&gt;

&lt;p&gt;If you want to specify the image to start the container locally, you can use the parameter &lt;code&gt;--docker-image&lt;/code&gt;. When the&lt;br&gt;
image does not exist locally, it will be pulled from the corresponding mirror warehouse. If you want to specify startup&lt;br&gt;
parameters, you can use &lt;code&gt;--entrypoint&lt;/code&gt; parameter, replace it with the command you want to execute, such&lt;br&gt;
as &lt;code&gt;--entrypoint /bin/bash&lt;/code&gt;, for more parameters, see &lt;code&gt;kubevpn dev --help&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  DinD ( Docker in Docker ) use kubevpn in Docker
&lt;/h3&gt;

&lt;p&gt;If you want to start the development mode locally using Docker in Docker (DinD), because the program will read and&lt;br&gt;
write the &lt;code&gt;/tmp&lt;/code&gt; directory, you need to manually add the parameter &lt;code&gt;-v /tmp:/tmp&lt;/code&gt; (outer docker) and another thing is you&lt;br&gt;
need to special parameter &lt;code&gt;--network&lt;/code&gt; (inner docker) for sharing network and pid&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--privileged&lt;/span&gt; &lt;span class="nt"&gt;--sysctl&lt;/span&gt; net.ipv6.conf.all.disable_ipv6&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="nt"&gt;-v&lt;/span&gt; /var/run/docker.sock:/var/run/docker.sock &lt;span class="nt"&gt;-v&lt;/span&gt; /tmp:/tmp &lt;span class="nt"&gt;-v&lt;/span&gt; ~/.kube/config:/root/.kube/config &lt;span class="nt"&gt;--platform&lt;/span&gt; linux/amd64 naison/kubevpn:v2.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--privileged&lt;/span&gt; &lt;span class="nt"&gt;--sysctl&lt;/span&gt; net.ipv6.conf.all.disable_ipv6&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="nt"&gt;-v&lt;/span&gt; /var/run/docker.sock:/var/run/docker.sock &lt;span class="nt"&gt;-v&lt;/span&gt; /tmp:/tmp &lt;span class="nt"&gt;-v&lt;/span&gt; ~/.kube/vke:/root/.kube/config &lt;span class="nt"&gt;--platform&lt;/span&gt; linux/amd64 naison/kubevpn:v2.0.0
Unable to find image &lt;span class="s1"&gt;'naison/kubevpn:v2.0.0'&lt;/span&gt; locally
v2.0.0: Pulling from naison/kubevpn
445a6a12be2b: Already exists
bd6c670dd834: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;64a7297475a2: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;33fa2e3224db: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;e008f553422a: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;5132e0110ddc: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;5b2243de1f1a: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;662a712db21d: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;4f4fb700ef54: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;33f0298d1d4f: Pull &lt;span class="nb"&gt;complete
&lt;/span&gt;Digest: sha256:115b975a97edd0b41ce7a0bc1d8428e6b8569c91a72fe31ea0bada63c685742e
Status: Downloaded newer image &lt;span class="k"&gt;for &lt;/span&gt;naison/kubevpn:v2.0.0
root@d0b3dab8912a:/app# kubevpn dev deployment/authors &lt;span class="nt"&gt;--headers&lt;/span&gt; &lt;span class="nv"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;naison &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--entrypoint&lt;/span&gt; sh

&lt;span class="nt"&gt;----------------------------------------------------------------------------------&lt;/span&gt;
    Warn: Use &lt;span class="nb"&gt;sudo &lt;/span&gt;to execute &lt;span class="nb"&gt;command &lt;/span&gt;kubevpn can not use user &lt;span class="nb"&gt;env &lt;/span&gt;KUBECONFIG.
    Because of &lt;span class="nb"&gt;sudo &lt;/span&gt;user &lt;span class="nb"&gt;env &lt;/span&gt;and user &lt;span class="nb"&gt;env &lt;/span&gt;are different.
    Current &lt;span class="nb"&gt;env &lt;/span&gt;KUBECONFIG value:
&lt;span class="nt"&gt;----------------------------------------------------------------------------------&lt;/span&gt;

&lt;span class="nb"&gt;hostname &lt;/span&gt;is d0b3dab8912a
connectting to cluster
start to connect
got cidr from cache
get cidr successfully
update ref count successfully
traffic manager already exist, reuse it
port forward ready
tunnel connected
dns service ok
start to create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors
patch workload default/Deployment.apps/authors with sidecar
rollout status &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"authors"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
Waiting &lt;span class="k"&gt;for &lt;/span&gt;deployment &lt;span class="s2"&gt;"authors"&lt;/span&gt; rollout to finish: 1 old replicas are pending termination...
deployment &lt;span class="s2"&gt;"authors"&lt;/span&gt; successfully rolled out
rollout status &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors successfully
create remote inbound pod &lt;span class="k"&gt;for &lt;/span&gt;Deployment.apps/authors successfully
&lt;span class="nb"&gt;tar&lt;/span&gt;: removing leading &lt;span class="s1"&gt;'/'&lt;/span&gt; from member names
/tmp/6460902982794789917:/var/run/secrets/kubernetes.io/serviceaccount
&lt;span class="nb"&gt;tar&lt;/span&gt;: Removing leading &lt;span class="sb"&gt;`&lt;/span&gt;/&lt;span class="s1"&gt;' from member names
tar: Removing leading `/'&lt;/span&gt; from hard &lt;span class="nb"&gt;link &lt;/span&gt;targets
/tmp/5028895788722532426:/var/run/secrets/kubernetes.io/serviceaccount
network mode is container:d0b3dab8912a
Created container: nginx_default_kubevpn_6df63
Wait container nginx_default_kubevpn_6df63 to be running...
Container nginx_default_kubevpn_6df63 is running now
WARNING: The requested image&lt;span class="s1"&gt;'s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Created main container: authors_default_kubevpn_6df5f
/opt/microservices # ps -ef
PID   USER     TIME  COMMAND
    1 root      0:00 {bash} /usr/bin/qemu-x86_64 /bin/bash /bin/bash
   14 root      0:02 {kubevpn} /usr/bin/qemu-x86_64 /usr/local/bin/kubevpn kubevpn dev deployment/authors --headers
   25 root      0:01 {kubevpn} /usr/bin/qemu-x86_64 /usr/local/bin/kubevpn /usr/local/bin/kubevpn daemon
   37 root      0:04 {kubevpn} /usr/bin/qemu-x86_64 /usr/local/bin/kubevpn /usr/local/bin/kubevpn daemon --sudo
   53 root      0:00 nginx: master process nginx -g daemon off;
(4/4) Installing curl (8.0.1-r0)
Executing busybox-1.33.1-r3.trigger
OK: 8 MiB in 19 packagesnx: worker process
/opt/microservices #

/opt/microservices # cat &amp;gt; hello.go &amp;lt;&amp;lt;EOF
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
        _, _ = io.WriteString(writer, "Hello world!")
        fmt.Println("&amp;gt;&amp;gt; Container Received request: %s %s from %s\n", request.Method, request.RequestURI, request.RemoteAddr)
    })
    fmt.Println("Start listening http port 9080 ...")
    _ = http.ListenAndServe(":9080", nil)
}
EOF
/opt/microservices # go build hello.go
/opt/microservices # 
//opt/microservices # ls -alh
total 12M    
drwxr-xr-x    1 root     root          26 Nov  4 10:29 .
drwxr-xr-x    1 root     root          26 Oct 18  2021 ..
-rwxr-xr-x    1 root     root        6.3M Oct 18  2021 app
-rwxr-xr-x    1 root     root        5.8M Nov  4 10:29 hello
-rw-r--r--    1 root     root         387 Nov  4 10:28 hello.go
/opt/microservices # 
/opt/microservices # apk add curl
OK: 8 MiB in 19 packages
/opt/microservices # ./hello &amp;amp;
/opt/microservices # Start listening http port 9080 ...
[2]+  Done                       ./hello
/opt/microservices # curl localhost:9080
&amp;gt;&amp;gt; Container Received request: GET / from 127.0.0.1:41230
Hello world!/opt/microservices # 

/opt/microservices # curl authors:9080/health -H "a: 1"
&amp;gt;&amp;gt;Received request: GET /health from 223.254.0.109:57930
                                                        Hello world!/opt/microservices # 
/opt/microservices # curl localhost:9080/health
{"status":"Authors is healthy"}/opt/microservices # exit
prepare to exit, cleaning up
update ref count successfully
tun device closed
leave resource: deployments.apps/authors
workload default/deployments.apps/authors is controlled by a controller
leave resource: deployments.apps/authors successfully
clean up successfully
prepare to exit, cleaning up
update ref count successfully
clean up successfully
root@d0b3dab8912a:/app# exit
exit
➜  ~
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;during test, check what container is running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➜  ~ docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED         STATUS         PORTS     NAMES
1cd576b51b66   naison/authors:latest           "sh"                     4 minutes ago   Up 4 minutes             authors_default_kubevpn_6df5f
56a6793df82d   nginx:latest                    "/docker-entrypoint.…"   4 minutes ago   Up 4 minutes             nginx_default_kubevpn_6df63
d0b3dab8912a   naison/kubevpn:v2.0.0     "/bin/bash"              5 minutes ago   Up 5 minutes             upbeat_noyce
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For clean up after test
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete &lt;span class="nt"&gt;-f&lt;/span&gt; https://raw.githubusercontent.com/kubenetworks/kubevpn/master/samples/bookinfo.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Multiple Protocol
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;TCP&lt;/li&gt;
&lt;li&gt;UDP&lt;/li&gt;
&lt;li&gt;ICMP&lt;/li&gt;
&lt;li&gt;GRPC&lt;/li&gt;
&lt;li&gt;WebSocket&lt;/li&gt;
&lt;li&gt;HTTP&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cross-platform
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;macOS&lt;/li&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;on Windows platform, you need to&lt;br&gt;
install &lt;a href="https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2" rel="noopener noreferrer"&gt;PowerShell&lt;/a&gt;&lt;br&gt;
in advance&lt;/p&gt;
&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1, What should I do if the dependent image cannot be pulled, or the inner environment cannot access docker.io?
&lt;/h3&gt;

&lt;p&gt;Answer: here are two solutions to solve this problem&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solution 1: In the network that can access docker.io, transfer the image in the command &lt;code&gt;kubevpn version&lt;/code&gt; to your own
private image registry, and then add option &lt;code&gt;--image&lt;/code&gt; to special image when starting the command.
Example:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn version
KubeVPN: CLI
    Version: v2.0.0
    DaemonVersion: v2.0.0
    Image: docker.io/naison/kubevpn:v2.0.0
    Branch: feature/daemon
    Git commit: 7c3a87e14e05c238d8fb23548f95fa1dd6e96936
    Built &lt;span class="nb"&gt;time&lt;/span&gt;: 2023-09-30 22:01:51
    Built OS/Arch: darwin/arm64
    Built Go version: go1.20.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Image is &lt;code&gt;docker.io/naison/kubevpn:v2.0.0&lt;/code&gt;, transfer this image to private docker registry&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull docker.io/naison/kubevpn:v2.0.0
docker tag docker.io/naison/kubevpn:v2.0.0 [docker registry]/[namespace]/[repo]:[tag]
docker push [docker registry]/[namespace]/[repo]:[tag]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you can use this image, as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➜  ~ kubevpn connect --image [docker registry]/[namespace]/[repo]:[tag]
got cidr from cache
traffic manager not exist, try to create it...
pod [kubevpn-traffic-manager] status is Running
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Solution 2: Use options &lt;code&gt;--transfer-image&lt;/code&gt;, enable this flags will transfer image from default image to &lt;code&gt;--image&lt;/code&gt;
special address automatically。
Example
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ kubevpn connect &lt;span class="nt"&gt;--transfer-image&lt;/span&gt; &lt;span class="nt"&gt;--image&lt;/span&gt; nocalhost-team-docker.pkg.coding.net/nocalhost/public/kubevpn:v2.0.0
v2.0.0: Pulling from naison/kubevpn
Digest: sha256:450446850891eb71925c54a2fab5edb903d71103b485d6a4a16212d25091b5f4
Status: Image is up to &lt;span class="nb"&gt;date &lt;/span&gt;&lt;span class="k"&gt;for &lt;/span&gt;naison/kubevpn:v2.0.0
The push refers to repository &lt;span class="o"&gt;[&lt;/span&gt;nocalhost-team-docker.pkg.coding.net/nocalhost/public/kubevpn]
ecc065754c15: Preparing
f2b6c07cb397: Pushed
448eaa16d666: Pushed
f5507edfc283: Pushed
3b6ea9aa4889: Pushed
ecc065754c15: Pushed
feda785382bb: Pushed
v2.0.0: digest: sha256:85d29ebb53af7d95b9137f8e743d49cbc16eff1cdb9983128ab6e46e0c25892c size: 2000
start to connect
got cidr from cache
get cidr successfully
update ref count successfully
traffic manager already exist, reuse it
port forward ready
tunnel connected
dns service ok
+---------------------------------------------------------------------------+
|    Now you can access resources &lt;span class="k"&gt;in &lt;/span&gt;the kubernetes cluster, enjoy it :&lt;span class="o"&gt;)&lt;/span&gt;    |
+---------------------------------------------------------------------------+
➜  ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2, When use &lt;code&gt;kubevpn dev&lt;/code&gt;, but got error code 137, how to resolve?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dns service ok
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
/var/folders/30/cmv9c_5j3mq_kthx63sb1t5c0000gn/T/7375606548554947868:/var/run/secrets/kubernetes.io/serviceaccount
Created container: server_vke-system_kubevpn_0db84
Wait container server_vke-system_kubevpn_0db84 to be running...
Container server_vke-system_kubevpn_0db84 is running on port 8888/tcp: 6789/tcp:6789 now
$ Status: , Code: 137
prepare to exit, cleaning up
port-forward occurs error, err: lost connection to pod, retrying
update ref count successfully
ref-count is zero, prepare to clean up resource
clean up successfully
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is because of your docker-desktop required resource is less than pod running request resource, it OOM killed, so&lt;br&gt;
you can add more resource in your docker-desktop setting &lt;code&gt;Preferences --&amp;gt; Resources --&amp;gt; Memory&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3, Using WSL( Windows Sub Linux ) Docker, when use mode &lt;code&gt;kubevpn dev&lt;/code&gt;, can not connect to cluster network, how to solve this problem?
&lt;/h3&gt;

&lt;p&gt;Answer:&lt;/p&gt;

&lt;p&gt;this is because WSL'Docker using Windows's Network, so if even start a container in WSL, this container will not use WSL&lt;br&gt;
network, but use Windows network&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1): install docker in WSL, not use Windows Docker-desktop&lt;/li&gt;
&lt;li&gt;2): use command &lt;code&gt;kubevpn connect&lt;/code&gt; on Windows, and then startup &lt;code&gt;kubevpn dev&lt;/code&gt; in WSL&lt;/li&gt;
&lt;li&gt;3): startup a container using command &lt;code&gt;kubevpn connect&lt;/code&gt; on Windows, and then
startup &lt;code&gt;kubevpn dev --network container:$CONTAINER_ID&lt;/code&gt; in WSL&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4，After use command &lt;code&gt;kubevpn dev&lt;/code&gt; enter develop mode，but can't assess kubernetes api-server，occur error &lt;code&gt;172.17.0.1:443 connect refusued&lt;/code&gt;，how to solve this problem?
&lt;/h3&gt;

&lt;p&gt;Answer:&lt;/p&gt;

&lt;p&gt;Maybe k8s network subnet is conflict with docker subnet&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use option &lt;code&gt;--connect-mode container&lt;/code&gt; to startup command &lt;code&gt;kubevpn dev&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;~/.docker/daemon.json&lt;/code&gt;, add not conflict subnet, eg: &lt;code&gt;"bip": "172.15.0.1/24"&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ &lt;span class="nb"&gt;cat&lt;/span&gt; ~/.docker/daemon.json
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"builder"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"gc"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"defaultKeepStorage"&lt;/span&gt;: &lt;span class="s2"&gt;"20GB"&lt;/span&gt;,
      &lt;span class="s2"&gt;"enabled"&lt;/span&gt;: &lt;span class="nb"&gt;true&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;,
  &lt;span class="s2"&gt;"experimental"&lt;/span&gt;: &lt;span class="nb"&gt;false&lt;/span&gt;,
  &lt;span class="s2"&gt;"features"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"buildkit"&lt;/span&gt;: &lt;span class="nb"&gt;true&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;,
  &lt;span class="s2"&gt;"insecure-registries"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
  &lt;span class="o"&gt;]&lt;/span&gt;,
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;add subnet not conflict, eg: 172.15.0.1/24&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;➜  ~ &lt;span class="nb"&gt;cat&lt;/span&gt; ~/.docker/daemon.json
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"builder"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"gc"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"defaultKeepStorage"&lt;/span&gt;: &lt;span class="s2"&gt;"20GB"&lt;/span&gt;,
      &lt;span class="s2"&gt;"enabled"&lt;/span&gt;: &lt;span class="nb"&gt;true&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;,
  &lt;span class="s2"&gt;"experimental"&lt;/span&gt;: &lt;span class="nb"&gt;false&lt;/span&gt;,
  &lt;span class="s2"&gt;"features"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"buildkit"&lt;/span&gt;: &lt;span class="nb"&gt;true&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;,
  &lt;span class="s2"&gt;"insecure-registries"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
  &lt;span class="o"&gt;]&lt;/span&gt;,
  &lt;span class="s2"&gt;"bip"&lt;/span&gt;: &lt;span class="s2"&gt;"172.15.0.1/24"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;restart docker and retry&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;Architecture can be found &lt;a href="///docs/en/Architecture.md"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>cloud</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
