-
Notifications
You must be signed in to change notification settings - Fork 261
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 ipa-server-configure-first script to work with ipv4 and ipv6 addrs #617
Conversation
Thank you for the pull request. I sadly was not able to run the CI directly here on this PR (entitlements for RHEL content would be needed), so I now started it as https://github.com/adelton/freeipa-container/actions/runs/10267872034. |
We seem to have rootless podman 4 setups failing with this change. So this will need to be investigated. |
@adelton Thanks! I don't have the opportunity to test on Podman and didn't see anything useful in the logs. Could you help me to test in podman? |
I will look at it but it will take me some time before I will get to it. |
@adelton Could you rerun podman rootless tests with environment DEBUG_TRACE=1 and give me ipareplica-install.log, ipa-server-run.log and ipa-server-configure-first.log please? I'll trying to explore logs and fix my scripts |
I'm currently trying to figure out how to make it easier for folks to run the tests in their forks / PRs, even if they don't have Red Hat subscription entitlements to run the RHEL builds. |
However, the specific problem with the failure in https://github.com/adelton/freeipa-container/actions/runs/10267872034 with this PR change is that the new code forces all found interfaces to be set in DNS as IP addresses for the FreeIPA installation. That breaks setups where The logic which sets one IP address as the IP address is there since 2014 (c371bd4). It might not be the best logic since it relies on the order of network interfaces, but so far it seemed to work fine, primarily because you typically have just one global IPv4 address in the container. So before even thinking about IPv6, if you are suggesting a change along the lines, we might really need to flesh out all the aspects of the sub-problem of having multiple interfaces and multiple global addresses in the container and how they should work and interact. Which gets me to another question: what is the use-case that you try to address exactly? Wouldn't using explicit |
Ok. I'll try to explain the case I encountered. The second aspect is that if you enable ipv6 in Docker, then 2 addresses will still arrive in the container. But let's assume that we will use only the ipv6 address. We will still need to change the launch script in the container so that it can check which of the addresses freeipa is launched on. So why not support dual stack? And the 3rd aspect. What if we can have 2 ipv4 addresses for the service? The host can have many interfaces and we want freeipa running in the container to be able to respond to any of them, or to some specific ones. All tests except rootles podman passed. So without a detailed log it is not at all clear whether the problem is really in multiple addresses. But if so, then the environment for rootles podman may not be configured correctly. |
Could you tell me why podman with sudo run command with dns |
So what prevents you using that approach exactly?
So why not just specify them both with
You can use
Again, just specify them explicitly using
Well, the veth setup works to allow testing intra-container communication under rootless container. So it seems to be correct and working for that purpose. |
From the successful run:
From the failed run:
We don't pass the right hostname to this instance. I think it is this part:
E.g. we only add explicit hostname option when running as root. @adelton I don't see why you are not passing the
However, in podman, the pod's hostname is only propagated to the instance if UTS namespace of the host is private. Granted, the namespace must be private by default, but may be this is what fails here? |
Technical answer is because a rootless container does not have
so https://github.com/freeipa/freeipa-container/blob/master/tests/run-master-and-replica.sh#L241 does not find any value. The reason why it does not matter and does not break things is because we've already set the |
Which is however caused by the fact that both the master and replica container have that same IP address 10.0.2.100:
And as mentioned above, the proposed patch forces all IP addresses it finds to DNS, in spite of the fact that we very carefully only set the 172.29.0.1 with
It does. You cannot use If I try to do --- a/tests/run-master-and-replica.sh
+++ b/tests/run-master-and-replica.sh
@@ -100,7 +100,7 @@ function run_ipa_container() {
fi
if [ "$(id -u)" != 0 -a "$docker" == podman -a "$replica" != none ] ; then
if [ "$N" == "freeipa-master" ] ; then
- OPTS="$OPTS --pod=$BASE-master"
+ OPTS="$OPTS --pod=$BASE-master -h $HOSTNAME"
else
OPTS="$OPTS --pod=$BASE-replica"
fi I get
Could you please elaborate? I don't think that setting the hostname has anything to do with this problem. It's caused by the patch setting the DNS records to IP addresses we really don't want set, and replica then sees them. |
This is exactly what I do. But if I specify the parameter --ip-address multiple times, the script in the container should update both addresses, right? |
If you specify the |
Why? What happens when freeipa container ip address changes after successeful replica installation ? Why we need ipa-server-configure-first script when start container? |
You ask why the When the container IP changes, hopefully the static IP address of the host is still valid. That's the main point of using the The primary reason for the As I mentioned above, I'm trying to come up with an easier way for folks to be able to run their GitHub Actions on PRs. You can of course do it today by editing the |
We seem to have lost traction here. |
Now script work with different ip addresses include ipv6