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

Document how to configure source-based routing for MetalLB #278

Open
kvaps opened this issue Aug 12, 2024 · 0 comments
Open

Document how to configure source-based routing for MetalLB #278

kvaps opened this issue Aug 12, 2024 · 0 comments

Comments

@kvaps
Copy link
Member

kvaps commented Aug 12, 2024

While Talos Linux itself does not support setting source-based routing, we have to provide the information how to configure it using DaemonSet.

We have to add reference on article https://blog.aenix.io/configuring-routing-for-metallb-in-l2-mode-7ea26e19219e, and configuration like this:

---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: routes
  namespace: cozy-metallb
spec:
  selector:
    matchLabels:
      app: routes
  template:
    metadata:
      labels:
        app: routes
    spec:
      hostNetwork: true
      containers:
      - name: routes
        image: alpine
        command:
        - /bin/sh
        - -c
        args:
        - |
          set -xe
          ip_rule_replace() {
            ip rule del $@ || true
            ip rule add $@
          }

          # Setup custom routing table
          ip route replace 1.2.3.0/24 dev bond0.100 table 100
          ip route replace default via 1.2.3.4 table 100

          # Setup policy based routing
          ip_rule_replace from 1.2.3.0/24 lookup 100
          ip_rule_replace from 1.2.3.0/24 to 10.244.0.0/16 lookup main

          exec sleep infinity
        securityContext:
          privileged: true
      terminationGracePeriodSeconds: 0
      tolerations:
      - operator: Exists

upstream issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant