Skip to content

Commit a94c8a7

Browse files
committed
Add documentation for 2.20.
Signed-off-by: Thomas Hallgren <thomas@tada.se>
1 parent 50b3f8f commit a94c8a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6138
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Telepresence Documentation
2+
3+
This folder contains the Telepresence documentation in a format suitable for a versioned folder in the
4+
telepresenceio/telepresence.io repository. The folder will show up in that repository when a new minor revision
5+
tag is created here.
6+
7+
Assuming that a 2.20.0 release is pending, and that a release/v2.20.0 branch has been created, then:
8+
```console
9+
$ export TELEPRESENCE_VERSION=v2.20.0
10+
$ make prepare-release
11+
$ git push origin {,rpc/}v2.20.0 release/v2.20.0
12+
```
13+
14+
will result in a `docs/v2.20` folder with this folder's contents in the telepresenceio/telepresence.io repository.
15+
16+
Subsequent bugfix tags for the same minor tag, i.e.:
17+
```console
18+
$ export TELEPRESENCE_VERSION=v2.20.1
19+
$ make prepare-release
20+
$ git push origin {,rpc/}v2.20.1 release/v2.20.1
21+
```
22+
will not result in a new folder when it is pushed, but it will update the content of the `docs/v2.20` folder to
23+
reflect this folder's content for that tag.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
description: Main menu when using plain markdown. Excluded when generating the website
3+
---
4+
# <img src="images/logo.png" height="64px"/> Telepresence Documentation
5+
raw markdown version, more bells and whistles at [telepresence.io](https://telepresence.io)
6+
7+
- [Quick start](quick-start.md)
8+
- Install Telepresence
9+
- [Install Client](install/client.md)
10+
- [Upgrade Client](install/upgrade.md)
11+
- [Install Traffic Manager](install/manager.md)
12+
- [Cloud Provider Prerequisites](install/cloud.md)
13+
- Core concepts
14+
- [The developer experience and the inner dev loop](concepts/devloop.md)
15+
- [Making the remote local: Faster feedback, collaboration and debugging](concepts/faster.md)
16+
- [Using Telepresence with Docker](concepts/docker.md)
17+
- [Intercepts](concepts/intercepts.md)
18+
- How do I...
19+
- [Intercept a service in your own environment](howtos/intercepts.md)
20+
- [Proxy outbound traffic to my cluster](howtos/outbound.md)
21+
- [Work with large clusters](howtos/large-clusters.md)
22+
- [Host a cluster in a local VM](howtos/cluster-in-vm.md)
23+
- Technical reference
24+
- [Architecture](reference/architecture.md)
25+
- [Client reference](reference/client.md)
26+
- [Laptop-side configuration](reference/config.md)
27+
- [Cluster-side configuration](reference/cluster-config.md)
28+
- [Using Docker for intercepts](reference/docker-run.md)
29+
- [Running Telepresence in a Docker container](reference/inside-container.md)
30+
- [Environment variables](reference/environment.md)
31+
- Intercepts
32+
- [Configure intercept using CLI](reference/intercepts/cli.md)
33+
- [Traffic Agent Sidecar](reference/intercepts/sidecar.md)
34+
- [Volume mounts](reference/volume.md)
35+
- [DNS resolution](reference/dns.md)
36+
- [RBAC](reference/rbac.md)
37+
- [Telepresence and VPNs](reference/vpn.md)
38+
- [Networking through Virtual Network Interface](reference/tun-device.md)
39+
- [Connection Routing](reference/routing.md)
40+
- [Monitoring](reference/monitoring.md)
41+
- [FAQs](faqs.md)
42+
- [Troubleshooting](troubleshooting.md)
43+
- [Community](community.md)
44+
- [Release Notes](release-notes.md)
45+
- [Licenses](licenses.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Community
3+
hide_table_of_contents: true
4+
---
5+
6+
# Community
7+
8+
## Contributor's guide
9+
Please review our [contributor's guide](https://github.com/telepresenceio/telepresence/blob/release/v2/CONTRIBUTING.md)
10+
on GitHub to learn how you can help make Telepresence better.
11+
12+
## Meetings
13+
Check out our community [meeting schedule](https://github.com/telepresenceio/telepresence/blob/release/v2/MEETING_SCHEDULE.md) for opportunities to interact with Telepresence developers.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: The developer experience and the inner dev loop
3+
hide_table_of_contents: true
4+
---
5+
6+
# The developer experience and the inner dev loop
7+
8+
## How is the developer experience changing?
9+
10+
The developer experience is the workflow a developer uses to develop, test, deploy, and release software.
11+
12+
Typically this experience has consisted of both an inner dev loop and an outer dev loop. The inner dev loop is where the individual developer codes and tests, and once the developer pushes their code to version control, the outer dev loop is triggered.
13+
14+
The outer dev loop is _everything else_ that happens leading up to release. This includes code merge, automated code review, test execution, deployment, controlled (canary) release, and observation of results. The modern outer dev loop might include, for example, an automated CI/CD pipeline as part of a GitOps workflow and a progressive delivery strategy relying on automated canaries, i.e. to make the outer loop as fast, efficient and automated as possible.
15+
16+
Cloud-native technologies have fundamentally altered the developer experience in two ways: one, developers now have to take extra steps in the inner dev loop; two, developers need to be concerned with the outer dev loop as part of their workflow, even if most of their time is spent in the inner dev loop.
17+
18+
Engineers now must design and build distributed service-based applications _and_ also assume responsibility for the full development life cycle. The new developer experience means that developers can no longer rely on monolithic application developer best practices, such as checking out the entire codebase and coding locally with a rapid “live-reload” inner development loop. Now developers have to manage external dependencies, build containers, and implement orchestration configuration (e.g. Kubernetes YAML). This may appear trivial at first glance, but this adds development time to the equation.
19+
20+
## What is the inner dev loop?
21+
22+
The inner dev loop is the single developer workflow. A single developer should be able to set up and use an inner dev loop to code and test changes quickly.
23+
24+
Even within the Kubernetes space, developers will find much of the inner dev loop familiar. That is, code can still be written locally at a level that a developer controls and committed to version control.
25+
26+
In a traditional inner dev loop, if a typical developer codes for 360 minutes (6 hours) a day, with a traditional local iterative development loop of 5 minutes — 3 coding, 1 building, i.e. compiling/deploying/reloading, 1 testing inspecting, and 10-20 seconds for committing code — they can expect to make ~70 iterations of their code per day. Any one of these iterations could be a release candidate. The only “developer tax” being paid here is for the commit process, which is negligible.
27+
28+
![traditional inner dev loop](../images/trad-inner-dev-loop.png#devloop)
29+
30+
## In search of lost time: How does containerization change the inner dev loop?
31+
32+
The inner dev loop is where writing and testing code happens, and time is critical for maximum developer productivity and getting features in front of end users. The faster the feedback loop, the faster developers can refactor and test again.
33+
34+
Changes to the inner dev loop process, i.e., containerization, threaten to slow this development workflow down. Coding stays the same in the new inner dev loop, but code has to be containerized. The _containerized_ inner dev loop requires a number of new steps:
35+
36+
* packaging code in containers
37+
* writing a manifest to specify how Kubernetes should run the application (e.g., YAML-based configuration information, such as how much memory should be given to a container)
38+
* pushing the container to the registry
39+
* deploying containers in Kubernetes
40+
41+
Each new step within the container inner dev loop adds to overall development time, and developers are repeating this process frequently. If the build time is incremented to 5 minutes — not atypical with a standard container build, registry upload, and deploy — then the number of possible development iterations per day drops to ~40. At the extreme that’s a 40% decrease in potential new features being released. This new container build step is a hidden tax, which is quite expensive.
42+
43+
44+
![container inner dev loop](../images/container-inner-dev-loop.png#devloop)
45+
46+
## Tackling the slow inner dev loop
47+
48+
A slow inner dev loop can negatively impact frontend and backend teams, delaying work on individual and team levels and slowing releases into production overall.
49+
50+
For example:
51+
52+
* Frontend developers have to wait for previews of backend changes on a shared dev/staging environment (for example, until CI/CD deploys a new version) and/or rely on mocks/stubs/virtual services when coding their application locally. These changes are only verifiable by going through the CI/CD process to build and deploy within a target environment.
53+
* Backend developers have to wait for CI/CD to build and deploy their app to a target environment to verify that their code works correctly with cluster or cloud-based dependencies as well as to share their work to get feedback.
54+
55+
New technologies and tools can facilitate cloud-native, containerized development. And in the case of a sluggish inner dev loop, developers can accelerate productivity with tools that help speed the loop up again.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: "Using Telepresence with Docker"
3+
hide_table_of_contents: true
4+
---
5+
# Telepresence with Docker Golden Path
6+
7+
## Why?
8+
9+
It can be tedious to adopt Telepresence across your organization, since in its handiest form, it requires admin access, and needs to get along with any exotic
10+
networking setup that your company may have.
11+
12+
If Docker is already approved in your organization, this Golden path should be considered.
13+
14+
## How?
15+
16+
When using Telepresence in Docker mode, users can eliminate the need for admin access on their machines, address several networking challenges, and forego the need for third-party applications to enable volume mounts.
17+
18+
You can simply add the docker flag to any Telepresence command, and it will start your daemon in a container.
19+
Thus removing the need for root access, making it easier to adopt as an organization
20+
21+
Let's illustrate with a quick demo, assuming a default Kubernetes context named default, and a simple HTTP service:
22+
23+
```cli
24+
$ telepresence connect --docker
25+
Connected to context default (https://default.cluster.bakerstreet.io)
26+
27+
$ docker ps
28+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
29+
7a0e01cab325 datawire/telepresence:2.12.1 "telepresence connec…" 18 seconds ago Up 16 seconds 127.0.0.1:58802->58802/tcp tp-default
30+
```
31+
32+
This method limits the scope of the potential networking issues since everything stays inside Docker. The Telepresence daemon can be found under the name `tp-<your-context>` when listing your containers.
33+
34+
Start an intercept and a corresponding intercept-handler:
35+
36+
```cli
37+
$ telepresence intercept echo-easy --port 8080:80 --docker-run -- jmalloc/echo-server
38+
Using Deployment echo-easy
39+
Intercept name : echo-easy
40+
State : ACTIVE
41+
Workload kind : Deployment
42+
Destination : 127.0.0.1:8080
43+
Service Port Identifier: proxied
44+
Intercepting : all TCP requests
45+
Echo server listening on port 8080.
46+
```
47+
48+
Using `--docker-run` starts the local container that acts as the intercept handler so that it uses the same network as the container that runs the telepresence daemon. It will also
49+
have the remote volumes mounted in the same way as the remote container that it intercepts.
50+
51+
If you want to curl your remote service, you'll need to do that from a container that shares the daemon container's network. You can find the network using `telepresence status`:
52+
```cli
53+
$ telepresence status | grep 'Container network'
54+
Container network : container:tp-default-default-cn
55+
```
56+
57+
Now curl with a `docker run` that uses that network:
58+
```cli
59+
$ docker run --network container:tp-default-default-cn --rm curlimages/curl echo-easy
60+
% Total % Received % Xferd Average Speed Time Time Time Current
61+
Dload Upload Total Spent Left Speed
62+
100 99 100 99 0 0 21104 0 --:--:-- --:--:-- -Request served by 4b225bc8d6f1
63+
64+
GET / HTTP/1.1
65+
66+
Host: echo-easy
67+
Accept: */*
68+
User-Agent: curl/8.6.0
69+
-:--:-- 24750
70+
```
71+
72+
Similarly, if you want to start your intercept handler manually using `docker run`, you must ensure that it shares the daemon container's network:
73+
74+
```cli
75+
$ docker run \
76+
--network=container:tp-default \
77+
-e PORT=8080 jmalloc/echo-server
78+
Echo server listening on port 8080.
79+
```
80+
81+
### Tip. Use named connections
82+
You can use the `--name` flag to name the connection and get a shorter network name:
83+
84+
```
85+
$ telepresence quit
86+
$ telepresence connect --docker --name a
87+
```
88+
Now, the network name will be `tp-a` instead of `tp-default-default-cn`.
89+
90+
Naming is also very useful when you want to connect to several namespaces simultaneously, e.g.
91+
92+
```
93+
$ telepresence connect --docker --name alpha --namespace alpha
94+
$ telepresence connect --docker --name beta --namespace beta
95+
```
96+
97+
Now, with two connections active, you must pass the flag `--use <name pattern>` to other commands, e.g.
98+
```
99+
$ telepresence intercept echo-easy --use alpha --port 8080:80 --docker-run -- jmalloc/echo-server
100+
```
101+
102+
## Key learnings
103+
104+
* Using the Docker mode of telepresence **does not require root access**, and makes it **easier** to adopt it across your organization.
105+
* It **limits the potential networking issues** you can encounter.
106+
* It **limits the potential mount issues** you can encounter.
107+
* It **enables simultaneous intercepts in multiple namespaces**.
108+
* It leverages **Docker** for your interceptor.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: "Making the remote local: Faster feedback, collaboration and debugging"
3+
hide_table_of_contents: true
4+
---
5+
6+
---
7+
# Making the remote local: Faster feedback, collaboration and debugging
8+
9+
With the goal of achieving fast, efficient development, developers need a set of approaches to bridge the gap between remote Kubernetes clusters and local development, and reduce time to feedback and debugging.
10+
11+
## How should I set up a Kubernetes development environment?
12+
13+
Setting up a development environment for Kubernetes can be much more complex than the setup for traditional web applications. Creating and maintaining a Kubernetes development environment relies on a number of external dependencies, such as databases or authentication.
14+
15+
While there are several ways to set up a Kubernetes development environment, most introduce complexities and impediments to speed. The dev environment should be set up to easily code and test in conditions where a service can access the resources it depends on.
16+
17+
A good way to meet the goals of faster feedback, possibilities for collaboration, and scale in a realistic production environment is the "single service local, all other remote" environment. Developing in a fully remote environment offers some benefits, but for developers, it offers the slowest possible feedback loop. With local development in a remote environment, the developer retains considerable control while using tools like [Telepresence](../quick-start.md) to facilitate fast feedback, debugging and collaboration.
18+
19+
## What is Telepresence?
20+
21+
Telepresence is an open source tool that lets developers [code and test microservices locally against a remote Kubernetes cluster](../quick-start.md). Telepresence facilitates more efficient development workflows while relieving the need to worry about other service dependencies.
22+
23+
## How can I get fast, efficient local development?
24+
25+
The dev loop can be jump-started with the right development environment and Kubernetes development tools to support speed, efficiency and collaboration. Telepresence is designed to let Kubernetes developers code as though their laptop is in their Kubernetes cluster, enabling the service to run locally and be proxied into the remote cluster. Telepresence runs code locally and forwards requests to and from the remote Kubernetes cluster, bypassing the much slower process of waiting for a container to build, pushing it to registry, and deploying to production.
26+
27+
A rapid and continuous feedback loop is essential for productivity and speed; Telepresence enables the fast, efficient feedback loop to ensure that developers can access the rapid local development loop they rely on without disrupting their own or other developers' workflows. Telepresence safely intercepts traffic from the production cluster and enables near-instant testing of code and local debugging in production.
28+
29+
Telepresence works by deploying a two-way network proxy in a pod running in a Kubernetes cluster. This pod proxies data from the Kubernetes environment (e.g., TCP/UDP connections, environment variables, volumes) to the local process. This proxy can intercept traffic meant for the service and reroute it to a local copy, which is ready for further (local) development.
30+
31+
The intercept proxy works thanks to context propagation, which is most frequently associated with distributed tracing but also plays a key role in controllable intercepts.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: "Intercepts"
3+
description: "Short demonstration of global intercepts"
4+
hide_table_of_contents: true
5+
---
6+
7+
import Admonition from '@theme/Admonition';
8+
import Paper from '@mui/material/Paper';
9+
import Tab from '@mui/material/Tab';
10+
import TabContext from '@mui/lab/TabContext';
11+
import TabList from '@mui/lab/TabList';
12+
import TabPanel from '@mui/lab/TabPanel';
13+
import TabsContainer from '@site/src/components/TabsContainer';
14+
import Animation from '@site/src/components/InterceptAnimation';
15+
16+
<TabsContainer>
17+
<TabPanel className="TabBody" value="regular">
18+
19+
# No intercept
20+
21+
<Paper className="interceptTab">
22+
<Animation className="mode-regular" />
23+
24+
This is the normal operation of your cluster without Telepresence.
25+
26+
</Paper>
27+
</TabPanel>
28+
<TabPanel className="TabBody" value="global">
29+
30+
<Paper className="interceptTab">
31+
32+
# Intercept
33+
34+
<Animation className="mode-global" />
35+
36+
**Intercepts** replace the Kubernetes "Orders" service with the
37+
Orders service running on your laptop. The users see no change, but
38+
with all the traffic coming to your laptop, you can observe and debug
39+
with all your dev tools.
40+
41+
### Creating and using intercepts
42+
43+
1. Creating the intercept: Intercept your service from your CLI:
44+
45+
```shell
46+
telepresence intercept SERVICENAME
47+
```
48+
49+
<Admonition className="alert" type="info">
50+
51+
Make sure your current kubectl context points to the target
52+
cluster. If your service is running in a different namespace than
53+
your current active context, use or change the `--namespace` flag.
54+
55+
</Admonition>
56+
57+
2. Using the intercept: Send requests to your service:
58+
59+
All requests will be sent to the version of your service that is
60+
running in the local development environment.
61+
62+
</Paper>
63+
</TabPanel>
64+
</TabsContainer>

0 commit comments

Comments
 (0)