<p>Influxdb 1.8 is deployed on kubernets using helm charts. influx db is deployed as Stateful Set that exposes a service with one running pods. Am able to ssh into running pods using <code>kubectl exec</code> command and its running fine. I can also see databases using influx cli after logging into pods</p>
<p>But i need to access this influx db on my local system to execute queries directly from my system using curl command. Deployed influxdb has no external IP/DNS. It ha internal endpoint that usually starts with 10.<em>.</em>.*</p>
<p>Can anybody guide me on how can i access influxdb on my local system using curl command?</p>

Sony Khan
<p>You can use the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="nofollow noreferrer"><code>kubectl port-forward</code> command</a>. You can use it to either map a Pod or a Service TCP port to a port on your local machine:</p>
<pre><code>&gt; kubectl port-forward service/your-influxdb-service 8086:8086
                                                      ^    ^
                                                      |    |
                                             local port    remote/service port
</code></pre>
<p>While that command is running, <code>kubectl</code> will forward all connections to your local port <code>8086</code> to the same port of your InfluxDB service. All traffic will be funneled through kubectl and your API server, so this is not exactly suited for high-throughput scenarios, but should be sufficient for occasional debugging and testing.</p>
