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

Add network to iptables command #72

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Conversation

ameir
Copy link

@ameir ameir commented Jun 6, 2024

When running in some environments, e.g. Kubernetes, the iptables command can cause the CNI to have issues. In my case, both calico-typha and calico-node began to fail health checks once the original iptables command was executed. Adding the ocserv network to the command allowed it to work as expected.

When running in some environments, e.g. Kubernetes, the iptables command can cause the CNI to have issues. In my case, both calico-typha and calico-node began to fail health checks once the original iptables command was executed. Adding the ocserv network to the command allowed it to work as expected.
@aminvakil
Copy link
Owner

Thanks for this PR, but local IP cannot be hardcoded in entrypoint.sh as one may change it cause of different needs they might have.

Could you please change it, so it reads ipv4-network from ocserv.conf and put it in a variable, and then use it?

@ameir
Copy link
Author

ameir commented Jun 9, 2024

Thanks for this PR, but local IP cannot be hardcoded in entrypoint.sh as one may change it cause of different needs they might have.

Could you please change it, so it reads ipv4-network from ocserv.conf and put it in a variable, and then use it?

This subnet is already hardcoded in two other places, so it doesn't seem very configurable as it stands. I can update it as you suggest, though; no problem.

$ fgrep -nr '192.168.99'
./Dockerfile:59:        && sed -i '/^ipv4-network = /{s/192.168.1.0/192.168.99.0/}' /etc/ocserv/ocserv.conf \
./routes.txt:2:route = 192.168.99.0/255.255.255.0

@ameir
Copy link
Author

ameir commented Jun 9, 2024

@aminvakil I've updated the PR to allow the network/netmask to be configurable (via env var). Please let me know if you have any questions/feedback.

Copy link
Owner

@aminvakil aminvakil left a comment

Choose a reason for hiding this comment

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

Please fix the hadolint bug.

This will break some users if they had changed the IPs manually from routes.txt, but that would be wrong anyway.

I will put another commit changing the README.md, and putting a release note about this later.

@ameir
Copy link
Author

ameir commented Jun 10, 2024

@aminvakil I need to make a change actually; please hold on merging if you could, please. Thank you!

@aminvakil
Copy link
Owner

Sure.

@ameir
Copy link
Author

ameir commented Jun 10, 2024

I should have put the envsubst in the entrypoint so that users can supply the network params via env var at runtime and not need to rebuild the image. I just pushed the commit to make that happen. Thank you!

Dockerfile Show resolved Hide resolved
@aminvakil aminvakil merged commit ee022cc into aminvakil:master Jun 11, 2024
3 checks passed
@aminvakil
Copy link
Owner

Thank you for doing this!

aminvakil added a commit that referenced this pull request Jul 4, 2024
This reverts commit ee022cc, reversing
changes made to 46113df.
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.

None yet

2 participants