Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New telepresence replace command. #3764

Open
wants to merge 63 commits into
base: release/v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a045268
Update actions/upload-artifact to v4.
thallgren Feb 2, 2025
06125d8
Fix panic when allowing conflicting subnets on macOS.
thallgren Feb 2, 2025
e02463a
release workflow fix
thallgren Feb 2, 2025
23cf7bc
Using the --proxy-via flag would sometimes cause connection timeouts.
thallgren Feb 2, 2025
5a08251
Ensure that the correct pod-log is captured after a helm rollback.
thallgren Jan 10, 2025
b14bccc
Ensure that make generate regenerates the docs files.
thallgren Feb 2, 2025
1f733e7
Prepare v2.21.3-test.4
thallgren Feb 2, 2025
0566da4
Ensure that annotation enabled traffic-agents are uninstalled.
thallgren Feb 3, 2025
3d63e55
Merge pull request #3785 from telepresenceio/thallgren/v2.21.3
thallgren Feb 3, 2025
7986105
Merge pull request #3786 from telepresenceio/thallgren/proxy-via-mult…
thallgren Feb 4, 2025
7a4a4d8
Prefer route with gateway when adding static route.
thallgren Feb 4, 2025
734316b
Never chose route with different IP family.
thallgren Feb 4, 2025
1f662f5
Prepare v2.21.3-test.5
thallgren Feb 4, 2025
82f04f2
Merge pull request #3790 from telepresenceio/thallgren/macos-allow-co…
thallgren Feb 5, 2025
939a51d
Prepare v2.21.3-rc.0
thallgren Feb 5, 2025
2e00a41
Prepare v2.21.3
thallgren Feb 6, 2025
b2ed295
Merge branch 'release/v2.21' into release/v2
thallgren Feb 6, 2025
3092af2
Base connectedSuite on TrafficManager instead of NamespacePair.
thallgren Jan 8, 2025
a1554c0
Using the --namespace option with telepresence causes a deadlock.
thallgren Jan 8, 2025
87856f5
Fix problem with exclude-suffix being hidden by DNS search path.
thallgren Jan 9, 2025
b4c716d
New telepresence replace command.
thallgren Jan 8, 2025
a17fd20
Integration tests for the replace command.
thallgren Jan 13, 2025
e960831
List output includes workload kind.
thallgren Feb 8, 2025
9009905
Drop use of the telepresence-agents configmap.
thallgren Feb 1, 2025
cf71a41
Use Serve function of grpc.Server in favor of dhttp.ServerConfig.
thallgren Jan 28, 2025
f65c9e9
General overhaul of client daemon quit logic.
thallgren Jan 28, 2025
c81fed0
Remove some excessive debug logging.
thallgren Jan 28, 2025
11384f5
Clean up traffic-manager code dealing with session termination.
thallgren Jan 28, 2025
6a0ce93
Fix some issues with pod-scaling integration test.
thallgren Jan 28, 2025
ef9fd5d
Let kubeconfig_extension_test.go use proper client config.
thallgren Jan 28, 2025
037d9e4
Ensure that generic.goyaml can use fully qualified image name.
thallgren Jan 28, 2025
99dd55e
We must use podIP to identify agents. StatefulSet will reuse pod names.
thallgren Jan 28, 2025
0d4870f
Reuse const for "traffic-manager".
thallgren Jan 28, 2025
3f648e5
DNS optimizations on the traffic-manager side.
thallgren Jan 29, 2025
40859c1
Fix mount sync problem when intercept ended.
thallgren Jan 30, 2025
e08dc78
Introduce k8sapi.Kind and use it consistently instead of string.
thallgren Feb 1, 2025
6670491
Use podUid to identify pods.
thallgren Feb 1, 2025
6992013
Merge the traffic-manager interceptStates and intercepts maps.
thallgren Feb 1, 2025
e5e8fd5
Minor fixes to integration tests.
thallgren Feb 1, 2025
36256b7
Introduce explicit SessionID type.
thallgren Jan 31, 2025
505406e
Use a GRPC interceptor for logging.
thallgren Jan 31, 2025
ad0fa0d
Better error handling in FindOwnerWorkload.
thallgren Feb 1, 2025
9007abe
Update module dependencies.
thallgren Feb 1, 2025
b82a5b7
Add build flag to link the go-fuseftp implementation.
thallgren Feb 3, 2025
6ba1193
Get rid of the namespace lock mechanism. No longer needed.
thallgren Feb 6, 2025
5330962
Rename "delete" pod methods to "evict" to clarify.
thallgren Feb 6, 2025
e9285e0
Safeguard concurrent access to agentpf.client with RWMutex.
thallgren Feb 6, 2025
cd33e21
Add better debug logging around the agent pod watcher mechanism.
thallgren Feb 6, 2025
32109c9
Don't let the agent pod watcher wait for port-forward to be established
thallgren Feb 6, 2025
4bd28ea
Introduce a proper tunnel.Tag to make some sense out of trace logging.
thallgren Feb 7, 2025
935b0c8
Ensure that tunnel write-delays cause connection back-pressure.
thallgren Feb 7, 2025
1516e00
Use the default TCP window and 1024 maxInFlight.
thallgren Feb 7, 2025
234803f
Print stack-traces on debug-level if session cancellation hangs.
thallgren Feb 7, 2025
11e056b
Slightly more efficient echo-server.
thallgren Feb 7, 2025
76d10e0
Really massage concurrency in Test_LargeRequest.
thallgren Feb 7, 2025
f34dde3
Ensure removal of PV and PVC in integration tests.
thallgren Feb 8, 2025
4393162
Close root daemon connection to traffic-manager early on disconnect.
thallgren Feb 8, 2025
096f34a
Let conn<->stream dispatcher close reader and writer of conn separately
thallgren Feb 8, 2025
311de3e
Documentation changes for the new replace command.
thallgren Feb 8, 2025
1c93498
Let make docs-files target generate docs/variables.yaml from changelog.
thallgren Feb 8, 2025
f57e3c1
Ensure that agent watchers don't receive inactivated agents.
thallgren Feb 8, 2025
59fb3f7
Remove all panic recovery.
thallgren Feb 8, 2025
c5dad04
Fixup and enable Test_LargeFiles for CI.
thallgren Feb 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
echo "prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Create draft release
if: steps.semver_check.outputs.draft == true
if: ${{ steps.semver_check.outputs.draft == 'true' }}
uses: ncipollo/release-action@v1
with:
artifacts: "binaries-*/*"
Expand All @@ -123,7 +123,7 @@ jobs:
## Draft Release
For more information, visit our [installation docs](https://www.telepresence.io/docs/latest/quick-start/).
- name: Create release
if: steps.semver_check.outputs.draft != true
if: ${{ steps.semver_check.outputs.draft == 'false' }}
uses: ncipollo/release-action@v1
with:
artifacts: "binaries-*/*"
Expand All @@ -148,9 +148,9 @@ jobs:

![Assets](https://static.scarf.sh/a.png?x-pxid=d842651a-2e4d-465a-98e1-4808722c01ab)
- uses: actions/checkout@v4
if: steps.semver_check.outputs.make_latest == true
if: ${{ steps.semver_check.outputs.make_latest == 'true' }}
- name: Update Homebrew
if: steps.semver_check.outputs.make_latest == true
if: ${{ steps.semver_check.outputs.make_latest == 'true' }}
run: |
v=${{ github.ref_name }}
packaging/homebrew-package.sh "${v#v}" tel2oss "${{ vars.GH_BOT_USER }}" "${{ vars.GH_BOT_EMAIL }}" "${{ secrets.HOMEBREW_TAP_TOKEN }}"
Expand All @@ -159,7 +159,7 @@ jobs:
needs:
- push-images
- publish-release
if: needs.publish-release.semver_check.outputs.draft != true
if: ${{ needs.publish-release.semver_check.outputs.draft == 'false' }}
strategy:
fail-fast: false
matrix:
Expand Down
92 changes: 83 additions & 9 deletions CHANGELOG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,42 @@ items:
- version: 2.22.0
date: (TBD)
notes:
- type: feature
title: New telepresence replace command.
body: |-
The new `telepresence replace` command simplifies and clarifies container replacement.

Previously, the `--replace` flag within the `telepresence intercept` command was used to replace containers.
However, this approach introduced inconsistencies and limitations:

* **Confusion:** Using a flag to modify the core function of a command designed for traffic interception led
to ambiguity.
* **Inaccurate Behavior:** Replacement was not possible when no incoming traffic was intercepted, as the
command's design focused on traffic routing.

To address these issues, the `--replace` flag within `telepresence intercept` has been deprecated. The new
`telepresence replace` command provides a dedicated and consistent method for replacing containers, enhancing
clarity and reliability.

Key differences between `replace` and `intercept`:

1. **Scope:** The `replace` command targets and affects an entire container, impacting all its traffic, while
an `intercept` targets specific services and/or service/container ports.
2. **Port Declarations:** Remote ports specified using the `--port` flag are container ports.
3. **No Default Port:** A `replace` can occur without intercepting any ports.
4. **Container State:** During a `replace`, the original container is no longer active within the cluster.

The deprecated `--replace` flag still works, but is hidden from the `telepresence intercept` command help, and
will print a deprecation warning when used.
- type: feature
title: No dormant container present during replace.
body: |-
Telepresence will no longer inject a dormant container during a `telepresence replace` operation. Instead, the
Traffic Agent now directly serves as the replacement container, eliminating the need to forward traffic to the
original application container. This simplification offers several advantages when using the `--replace` flag:

- **Removal of the init-container:** The need for a separate init-container is no longer necessary.
- **Elimination of port renames:** Port renames within the intercepted pod are no longer required.
- type: feature
title: One single invocation of the Telepresence intercept command can now intercept multiple ports.
body: >-
Expand All @@ -50,15 +86,22 @@ items:
```
docs: install/manager#static-versus-dynamic-namespace-selection
- type: feature
title: Removal of the dormant container during intercept with --replace.
body: |-
During a `telepresence intercept --replace operation`, the previously injected dormant container has been
removed. The Traffic Agent now directly serves as the replacement container, eliminating the need to forward
traffic to the original application container. This simplification offers several advantages when using the
`--replace` flag:

- **Removal of the init-container:** The need for a separate init-container is no longer necessary.
- **Elimination of port renames:** Port renames within the intercepted pod are no longer required.
title: List output includes workload kind.
body: >-
The output of the `telepresence list` command will now include the workload kind (deployment, replicaset,
statefulset, or rollout) in all entries.
- type: change
title: Trigger the mutating webhook with Kubernetes eviction objects instead of patching workloads.
body: >-
Instead of patching workloads, or scaling the workloads down to zero and up again, Telepresence will now
create policy/v1 Eviction objects to trigger the mutating webhook. This causes a slight change in the
traffic-manager RBAC. The `patch` permissions are no longer needed. Instead, the traffic-manager must be
able to create "pod/eviction" objects.
- type: change
title: The telepresence-agents configmap is no longer used.
body: >-
The traffic-agent configuration was moved into a pod-annotation. This avoids sync problems between the
telepresence-agents (which is no no longer present) and the pods.
- type: change
title: Drop deprecated current-cluster-id command.
body: >-
Expand All @@ -75,6 +118,37 @@ items:
body: >-
macOS based systems will often PTR queries using nameslike `b._dns-sd._udp`, lb._dns-sd._udp, or
`db-dns-sd._udp`. Those queries are no longer dispatched to the cluster.
- type: bugfix
title: Using the --namespace option with telepresence causes a deadlock.
body: >-
Using `telepresence list --namespace <ns> with a namespace different from the one that telepresence was
connected to, would cause a deadlock, and then produce an empty list.
- type: bugfix
title: Fix problem with exclude-suffix being hidden by DNS search path.
body: >-
In some situations, a name ending with an exclude-suffix like "xyz.com" would be expanded by a search path
into "xyz.com.<connected namespace>" and therefore not be excluded. Instead, the name was sent to the cluster
to be resolved, causing an unnecessary load on its DNS server.
- version: 2.21.3
date: 2025-02-06
notes:
- type: bugfix
title: Using the --proxy-via flag would sometimes cause connection timeouts.
body: >-
Typically, a `telepresence connect --proxy-via <subnet>=<workflow>` would fail with a "deadline exceeded"
message when several workloads were present in the namespace, the one targeted by the proxy-via didn't yet
have an agent installed, and other workloads had an agent. This was due to a race condition in the logic
for the agent-based port-forwards in the root daemon. The conditions causing this race are now eliminated.
- type: bugfix
title: Fix panic in root daemon when using the "allow conflicting subnets" feature on macOS.
body: >-
A regression was introduced in version 2.21.0, causing a panic due to an unimplemented method in the
TUN-device on macOS based clients.
- type: bugfix
title: Ensure that annotation enabled traffic-agents are uninstall when uninstalling the traffic-manager.
body: >-
A traffic-agent injected because the workload had the inject annotation enabled would sometimes not get
uninstalled when the traffic-manager was uninstalled.
- version: 2.21.2
date: 2025-01-26
notes:
Expand Down
18 changes: 11 additions & 7 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ following Free and Open Source software:
github.com/containerd/log v0.1.0 Apache License 2.0
github.com/containerd/platforms v0.2.1 Apache License 2.0
github.com/coreos/go-iptables v0.8.0 Apache License 2.0
github.com/cyphar/filepath-securejoin v0.4.0 3-clause BSD license
github.com/cyphar/filepath-securejoin v0.4.1 3-clause BSD license
github.com/datawire/argo-rollouts-go-client v0.0.0-20241216133646-cb1073556c99 Apache License 2.0
github.com/datawire/dlib v1.3.1 Apache License 2.0
github.com/datawire/dtest v0.0.0-20210928162311-722b199c4c2f Apache License 2.0
Expand All @@ -41,7 +41,7 @@ following Free and Open Source software:
github.com/docker/go-metrics v0.0.1 Apache License 2.0
github.com/docker/go-units v0.5.0 Apache License 2.0
github.com/emicklei/go-restful/v3 v3.12.1 MIT license
github.com/evanphx/json-patch v5.9.0+incompatible 3-clause BSD license
github.com/evanphx/json-patch v5.9.11+incompatible 3-clause BSD license
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f MIT license
github.com/fatih/camelcase v1.0.0 MIT license
github.com/fatih/color v1.18.0 MIT license
Expand All @@ -52,7 +52,7 @@ following Free and Open Source software:
github.com/fxamacker/cbor/v2 v2.7.0 MIT license
github.com/go-errors/errors v1.5.1 MIT license
github.com/go-gorp/gorp/v3 v3.1.0 MIT license
github.com/go-json-experiment/json v0.0.0-20250124004741-3d76ae074650 3-clause BSD license
github.com/go-json-experiment/json v0.0.0-20250129011340-4e0381018ad6 3-clause BSD license
github.com/go-logr/logr v1.4.2 Apache License 2.0
github.com/go-logr/stdr v1.2.2 Apache License 2.0
github.com/go-openapi/jsonpointer v0.21.0 Apache License 2.0
Expand All @@ -73,11 +73,13 @@ following Free and Open Source software:
github.com/gorilla/websocket v1.5.3 2-clause BSD license
github.com/gosuri/uitable v0.0.4 MIT license
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 MIT license
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 Apache License 2.0
github.com/hashicorp/errwrap v1.1.0 Mozilla Public License 2.0
github.com/hashicorp/go-multierror v1.1.1 Mozilla Public License 2.0
github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb MIT license
github.com/huandu/xstrings v1.5.0 MIT license
github.com/inconshreveable/mousetrap v1.1.0 Apache License 2.0
github.com/jlaffaye/ftp v0.2.0 ISC license
github.com/jmoiron/sqlx v1.4.0 MIT license
github.com/josharian/intern v1.0.1-0.20211109044230-42b52b674af5 MIT license
github.com/json-iterator/go v1.1.12 MIT license
Expand Down Expand Up @@ -125,12 +127,14 @@ following Free and Open Source software:
github.com/spf13/afero v1.12.0 Apache License 2.0
github.com/spf13/cast v1.7.1 MIT license
github.com/spf13/cobra v1.8.1 Apache License 2.0
github.com/spf13/pflag v1.0.5 3-clause BSD license
github.com/spf13/pflag v1.0.6 3-clause BSD license
github.com/stretchr/testify v1.10.0 MIT license
github.com/telepresenceio/go-fuseftp/rpc v0.5.0 Apache License 2.0
github.com/telepresenceio/go-fuseftp v0.6.1 Apache License 2.0
github.com/telepresenceio/go-fuseftp/rpc v0.6.1 Apache License 2.0
github.com/telepresenceio/telepresence/rpc/v2 (modified) Apache License 2.0
github.com/vishvananda/netlink v1.3.0 Apache License 2.0
github.com/vishvananda/netns v0.0.5 Apache License 2.0
github.com/winfsp/cgofuse v1.6.0 MIT license
github.com/x448/float16 v0.8.4 MIT license
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb Apache License 2.0
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 Apache License 2.0
Expand All @@ -154,13 +158,13 @@ following Free and Open Source software:
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 MIT license
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 MIT license
golang.zx2c4.com/wireguard/windows v0.5.3 MIT license
google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 Apache License 2.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 Apache License 2.0
google.golang.org/grpc v1.70.0 Apache License 2.0
google.golang.org/protobuf v1.36.4 3-clause BSD license
gopkg.in/evanphx/json-patch.v4 v4.12.0 3-clause BSD license
gopkg.in/inf.v0 v0.9.1 3-clause BSD license
gopkg.in/yaml.v3 v3.0.1 Apache License 2.0, MIT license
gvisor.dev/gvisor v0.0.0-20250115195935-26653e7d8816 Apache License 2.0, MIT license
gvisor.dev/gvisor v0.0.0-20250131185017-b744a1bd640b Apache License 2.0, MIT license
helm.sh/helm/v3 v3.17.0 Apache License 2.0
k8s.io/api v0.32.1 Apache License 2.0
k8s.io/apiextensions-apiserver v0.32.1 Apache License 2.0
Expand Down
Loading
Loading