-
-
Notifications
You must be signed in to change notification settings - Fork 471
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] Use default gateway, when bridge network doesn't have it (#666, @kuritka) #666
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: kuritka <kuritka@gmail.com>
iwilltry42
approved these changes
Jul 2, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rancherio-gh-m
pushed a commit
that referenced
this pull request
Jul 2, 2021
same with k3d v5.7.x err with INFO[0000] Deleting cluster 'clust1'
INFO[0001] Deleting cluster network 'k3d-clust1'
INFO[0001] Deleting 1 attached volumes...
INFO[0001] Removing cluster details from default kubeconfig...
INFO[0001] Removing standalone kubeconfig file (if there is one)...
INFO[0001] Successfully deleted cluster clust1!
INFO[0000] Using config file ./k3d-config.yaml (k3d.io/v1alpha5#simple)
INFO[0000] Prep: Network
INFO[0000] Re-using existing network 'k3d-network' (6dd07994a6f9a0b6dcb1e5c1508a15610b485878488bcaa06616fcafb6443ee5)
INFO[0000] Created image volume k3d-clust1-images
INFO[0000] Creating node 'default.registry.local'
INFO[0000] Successfully created registry 'default.registry.local'
INFO[0000] Starting new tools node...
INFO[0000] Starting node 'k3d-clust1-tools'
INFO[0001] Creating node 'k3d-clust1-server-0'
INFO[0001] Creating node 'k3d-clust1-agent-0'
INFO[0001] Creating node 'k3d-clust1-agent-1'
INFO[0001] Using the k3d-tools node to gather environment information
ERRO[0001] failed to gather environment information used for cluster creation: failed to get host IP: runtime failed to get host IP: failed to get gateway IP of docker network 'k3d-network': no gateway defined for n
ERRO[0001] Failed to create cluster >>> Rolling Back
INFO[0001] Deleting cluster 'clust1'
INFO[0001] Deleting 1 attached volumes...
FATA[0001] Cluster creation FAILED, all changes have been rolled back! works with INFO[0000] No nodes found for cluster 'clust1', nothing to delete.
INFO[0000] No clusters found
INFO[0000] Using config file ./k3d-config.yaml (k3d.io/v1alpha5#simple)
INFO[0000] Prep: Network
INFO[0000] Re-using existing network 'k3d-gw-network' (b2806a70703acb7ab1ebdd4abc8c3110c3515841439c3b112ffbdfae4adcf6af)
INFO[0000] Created image volume k3d-clust1-images
INFO[0000] Creating node 'default.registry.local'
INFO[0000] Successfully created registry 'default.registry.local'
INFO[0000] Starting new tools node...
INFO[0000] Starting node 'k3d-clust1-tools'
INFO[0001] Creating node 'k3d-clust1-server-0'
INFO[0001] Creating node 'k3d-clust1-agent-0'
INFO[0001] Creating node 'k3d-clust1-agent-1'
INFO[0001] Using the k3d-tools node to gather environment information
INFO[0001] HostIP: using network gateway 10.29.0.1 address
INFO[0001] Starting cluster 'clust1'
INFO[0001] Starting servers...
INFO[0001] Starting node 'k3d-clust1-server-0'
INFO[0005] Starting agents...
INFO[0006] Starting node 'k3d-clust1-agent-0'
INFO[0006] Starting node 'k3d-clust1-agent-1'
INFO[0009] Starting helpers...
INFO[0009] Starting node 'default.registry.local'
INFO[0009] Injecting records for hostAliases (incl. host.k3d.internal) and for 4 network members into CoreDNS configmap...
INFO[0012] Cluster 'clust1' created successfully!
INFO[0013] You can now use it like this: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
If there is no default gateway in the bridge network, k3d crashes because it tries to parse the empty gateway string. This PR will use the default gateway if the gateway does not exist. A cluster can be created than.
Why
For some time docker does not create an automatic gateway in case I create a new network. When I create a bridge network without a gateway and try to connect it to k3d, the cluster installation of the latest versions of k3d crashes.
For example, this won't work for me:
Right now we have to do something like this manually:
^^^ passing
Implications
our k3d action worked fine on k3d v4.4.1, until 28.6.2021, when the GitHub runner upgraded to Ubuntu Version: 20210628.1. This forced us to upgrade k3d-action a bit earlier than we had planned. Unfortunately, we found out that the newer implementation can't handle the missing gateway. This change does not affect the CLI or Docker settings. It only handles internally the case when the gateway is missing in docker network settings.
@all-contributors add @kuritka for code, maintenance
Signed-off-by: kuritka kuritka@gmail.com