-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(vmi-router): Use IP from our VirtualMachine (#69)
* refactor(vmi-router): Use IP from our VirtualMachine - Use status.ipaddress instead of extracting ip from huge status in Kubevirt VM. - Add environment variable CILIUM_ROUTE_TABLE_ID for route table id. - Refactor: proper use of controller-runtime. - Deps: drop kubevirt.io/client, update netlink, cilium, controller-runtime, k8 dependencies. - Fix: add aliases for netlink methods to develop with comfort in non-linux OSes. - Add golang 21 base image. Signed-off-by: Ivan Mikheykin <[email protected]>
- Loading branch information
Showing
14 changed files
with
993 additions
and
1,596 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
image: {{ $.ImageName }} | ||
from: docker.io/golang:1.21.8-bookworm@sha256:ac14cc827536ef1a124cd2f7a03178c3335c1db8ad3807e7fdd57f74096abfa0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## vmi-router | ||
|
||
> **NOTE:** Not an accurate name, should be 'cilium-route-updater'. | ||
This controller watches for VirtualMachines in virtualization.deckhouse.io group and updates routes in table 1490 to route traffic between VMs via Cilium agents. | ||
|
||
It should be run as a DaemonSet with the `hostNetwork: true` to be able to modify route tables on cluster Nodes. | ||
|
||
### Configuration | ||
|
||
#### Log verbosity | ||
|
||
Set VERBOSITY environment variable or -v flag. | ||
|
||
#### Route table ID | ||
|
||
Hardcoded as integer `1490`. | ||
|
||
#### CIDRs | ||
|
||
Use --cidr flags to specify CIDRs to limit managed IPs. Controller will update routes for VMs which IPs belong to specified CIDRs. | ||
|
||
Example: | ||
|
||
``` | ||
vmi-router --cidr 10.2.0.0/24 --cidr 10.2.1.0/24 --cidr 10.2.2.0/24 | ||
``` | ||
|
||
Controller will update route for VM with IP 10.2.1.32, but will ignore VM with IP 10.2.4.5. | ||
|
||
#### Dry run mode | ||
|
||
Use --dry-run flag to enable non destructive mode. The controller will not actually delete or replace rules and routes, only log these actions. | ||
|
||
#### Metrics and healthz addresses | ||
|
||
Controller can't predict used ports when starting in host network mode. So, be default, metrics and healthz are started on random free ports. Use flags to specify these addresses: | ||
|
||
`--metrics-bind-address` - set port for /metrics endpoint, e.g. `--metrics-bind-address=:9250` | ||
`--health-probe-bind-address` - set port for /healthz endpoint, e.g. `--health-probe-bind-address=:9321` | ||
|
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
Oops, something went wrong.