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

fix(kuma-dp): pass sockets in metadata from dp to cp #7218

Merged
merged 4 commits into from
Jul 18, 2023

Conversation

lahabana
Copy link
Contributor

Currently socket paths where generated from both the cp and dp. These relied on os.TempDir() which may return different results as they run on 2 different machines.

With this change we make the paths configurable from the kuma-dp process.
The information is then sent in the metadata and can be used during config generation.

From a backward compatibility POV there are 2 things to take care of:

  • We may update the CP and have an old DP still running (the metadata won't have the entries for sockets).
  • We may have an old DP bootstrap on a newer CP (this bootstrap request won't have the DP set).

Fix #5228

Checklist prior to review

  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? --
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

Currently socket paths where generated from both the cp and dp.
These relied on `os.TempDir()` which may return different results as
they run on 2 different machines.

With this change we make the paths configurable from the kuma-dp
process.
The information is then sent in the metadata and can be used during
config generation.

From a backward compatibility POV there are 2 things to take care of:

- We may update the CP and have an old DP still running (the metadata
  won't have the entries for sockets).
- We may have an old DP bootstrap on a newer CP (this bootstrap request
  won't have the DP set).

Fix kumahq#5228

Signed-off-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana requested a review from a team as a code owner July 10, 2023 15:00
@lahabana lahabana requested review from jakubdyszkiewicz and lobkovilya and removed request for a team July 10, 2023 15:00
pkg/core/xds/sockets.go Outdated Show resolved Hide resolved
pkg/core/xds/metadata.go Outdated Show resolved Hide resolved
pkg/core/xds/metadata_test.go Outdated Show resolved Hide resolved
pkg/xds/bootstrap/generator.go Outdated Show resolved Hide resolved
lahabana and others added 2 commits July 10, 2023 17:13
Signed-off-by: Charly Molter <charly@molter.io>
Signed-off-by: Charly Molter <charly.molter@konghq.com>
pkg/xds/bootstrap/generator.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think long term we should introduce "dp data" directory to store sockets tokens etc. It's a bit meh to store sockets in tmp from the permission perspective.

Signed-off-by: Charly Molter <charly.molter@konghq.com>
@lahabana
Copy link
Contributor Author

100% opened an issue to do this in the future

@lahabana lahabana merged commit 203aba3 into kumahq:master Jul 18, 2023
@lahabana lahabana deleted the tmpDirFix branch March 29, 2024 12:49
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 1, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 2, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 4, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 4, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 5, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 6, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 10, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 10, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 10, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Icarus9913 added a commit to Icarus9913/kuma that referenced this pull request Jun 10, 2024
…ility

Refer to kumahq#7218, we kept something to meet the backward compability with
the access log socket and metrics socket in the past. Now we need to remove them.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

access-log-streamer has different TMPDIR than Envoy
3 participants