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(*) only mount logs directory and use a different prefix #474

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

fffonion
Copy link
Contributor

@fffonion fffonion commented Nov 24, 2023

Pongo mounts /kong-plugin to current folder and use /kong-plugin/servroot as default prefix
so that developer can easily access logs. On macOS, such directory is implemented as VM file shared
and doesn't support binding a unix domain socket; on windows, if current directory from the 9p fs shared
from Windows volumes, binding unix domain socket is also not supported.

This fix makes only $KONG_PREFIX/logs a mount from host on such platform, thus makes Kong able to start.
This is considered a short term fix until Kong implemented to move UDS sockets to a subdirectory. By then,
the whole $KONG_PREFIX can be mounted again, while the sockets subdirectory will become a symlink.

KAG-5588
KAG-3284

@Tieske
Copy link
Member

Tieske commented Nov 24, 2023

where are the unix sockets currently located? At the top of the prefix?

Copy link
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

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

Am I correct we loose access to everything but the logs? eg. no way to inspect the generated nginx config files from the host?

assets/docker-compose.yml Outdated Show resolved Hide resolved
@fffonion
Copy link
Contributor Author

where are the unix sockets currently located? At the top of the prefix?

yes

Am I correct we loose access to everything but the logs? eg. no way to inspect the generated nginx config files from the host?

yes, others are not being re-mounted or symlinked in this PR. As from the comments that logs are the reason we use prefix from mount at first place, so that is being implemented here as first iterration.

@fffonion fffonion marked this pull request as ready for review December 5, 2023 05:59
@fffonion fffonion force-pushed the only-mount-logs branch 3 times, most recently from 08cd14d to 29b91ef Compare December 5, 2023 08:17
Copy link
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

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

somehow I still see the files appear on the mount.

pongo.sh Outdated Show resolved Hide resolved
@Tieske
Copy link
Member

Tieske commented Dec 5, 2023

somehow I still see the files appear on the mount.

That's because I used the old containers. pongo nuke to remove all of them solved it.

@fffonion fffonion force-pushed the only-mount-logs branch 2 times, most recently from 1e522d4 to 2b7e889 Compare December 6, 2023 07:07
@fffonion fffonion requested a review from Tieske December 13, 2023 07:36
services:
kong:
volumes:
- ${PONGO_WD}/servroot:/kong-prefix
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@fffonion mind having a look? I think we can remove the one from the main docker compose file no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually no conflict here, the mount from main file is for getting in the plugin code for test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pwd -> /kong-plugin
pwd/servroot -> /kong-prefix
we can't do
pwd/servroot -> /kong-plugin/servroot
anymore because that will be a bind mount on host and not supported on macos

@Tieske
Copy link
Member

Tieske commented Dec 14, 2023

@fffonion can you squash the commits first, and then merge (squashing via ui is disabled)

@Tieske
Copy link
Member

Tieske commented Dec 14, 2023

nvm I'll do it

@fffonion
Copy link
Contributor Author

Thank you @Tieske

@Tieske Tieske merged commit 8660faf into master Dec 14, 2023
5 checks passed
@Tieske Tieske deleted the only-mount-logs branch December 14, 2023 08:47
fffonion added a commit that referenced this pull request Dec 15, 2023
Tieske pushed a commit that referenced this pull request Dec 15, 2023
KalshuCodes pushed a commit to razorpay/kong-pongo that referenced this pull request Sep 25, 2024
KalshuCodes pushed a commit to razorpay/kong-pongo that referenced this pull request Sep 25, 2024
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.

3 participants