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 flannel-external-ip when there is a k3s node-external-ip #6180

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

manuelbuil
Copy link
Contributor

@manuelbuil manuelbuil commented Sep 26, 2022

Signed-off-by: Manuel Buil [email protected]

Proposed Changes

Make sure that if node-external-ip is defined in the k3s config, the annotation flannel.alpha.coreos.com/public-ip-overwrite is added for each node, so that flannel can configured itself correctly

Types of Changes

Bugfix

Verification

1 - Create two VMs which do not belong to the same subnet (e.g. in different public clouds). These VMs must have a public IP
2 - Deploy k3s with the following config in one VM:

write-kubeconfig-mode: 644
token: "secret"
node-external-ip: $SERVER_PUBLIC_IP
flannel-backend: wireguard-native

3 - Deploy k3s agent with the following config in another VM:

token: "secret"
server: "https://$SERVER_PUBLIC_IP:6443"
node-external-ip: $AGENT_PUBLIC_IP

4 - Run kubectl get nodes -o yaml. You should see the annotation: flannel.alpha.coreos.com/public-ip: and flannel.alpha.coreos.com/public-ip-overwrite: in both nodes. Both annotations must point at the publicIP of the node (what we passed as node-external-ip)

5 - Deploy a pod in each node/VM and ping between them. It should work

Testing

Not covered

Linked Issues

#6177

User-Facing Change

Fix flannel for deployments of nodes which do not belong to the same network and connect using their public IP

Further Comments

@manuelbuil manuelbuil requested a review from a team as a code owner September 26, 2022 14:22
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