DZone
Cloud Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Cloud Zone > Connect to a Remote Kubernetes Cluster With Telepresence

Connect to a Remote Kubernetes Cluster With Telepresence

Take a look at setting up and configuring Telepresence, a tool designed to get you access to remote Kubernetes clusters from local processes.

Abhay Saxena user avatar by
Abhay Saxena
·
Oct. 16, 17 · Cloud Zone · Tutorial
Like (3)
Save
Tweet
4.82K Views

Join the DZone community and get the full member experience.

Join For Free

In this tutorial, you'll see how Telepresence allows you to get transparent access to a remote cluster from a local process. This allows you to use your local tools on your laptop to communicate with processes inside the cluster.

You should start by running a service in the cluster:

$ kubectl run myservice --image=datawire/hello-world --port=8000 --expose
$ kubectl get service myservice
NAME        CLUSTER-IP   EXTERNAL-IP   PORT(S)    AGE
myservice   10.0.0.12    <none>        8000/TCP   1m


It may take a minute or two for the pod running the server to be up and running, depending on how fast your cluster is.

You can now run a local process using Telepresence that can access that service, even though the process is local but the service is running in the Kubernetes cluster:

$ telepresence --run curl http://myservice:8000/
Hello, world!


(This will not work if the hello world pod hasn't started yet... if so, try again.)

What's going on:

  1. Telepresence creates a new Deployment, which runs a proxy.
  2. Telepresence runs curl locally in a way that proxies networking through that Deployment.
  3. The DNS lookup and HTTP request done by curl get routed through the proxy and transparently access the cluster... even though curl is running locally.
  4. When curl exits the new Deployment will be cleaned up.

To learn more about what Telepresence proxies, you can read the relevant reference documentation.

Additional Resources

If you're interested in trying Telepresence on your own you can install locally with Homebrew, apt, or dnf.

Or check out these other tutorials:

  • Debugging services on Kubernetes.
  • Using Telepresence with Google Container Engine.
  • Getting started with OpenShift and Telepresence.
  • Telepresence and Minikube.

Have questions? Ask in the Telepresence Gitter chatroom or file an issue on GitHub.

Kubernetes cluster

Published at DZone with permission of Abhay Saxena. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Do Great Engineering Managers Need To Know About Compensation and Equity?
  • How to Handle Early Startup Technical Debt (Or Just Avoid it Entirely)
  • Testing Schema Registry: Spring Boot and Apache Kafka With JSON Schema
  • Message Queuing and the Database: Solving the Dual Write Problem

Comments

Cloud Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo