siderolabs / talos-cloud-controller-manager

Generic cloud controller manager for hybrid deployments using Talos OS
MIT License
48 stars 7 forks source link

feat: node ipam controller #176

Closed sergelogvinov closed 1 month ago

sergelogvinov commented 2 months ago

Pull Request

What? (description)

This is alpha version of implementation. Closes #154

Tested on:

Why? (reasoning)

Talos machine config. We need to disable node-ipam-controller

cluster:
  controllerManager:
    extraArgs:
        controllers: "*,tokencleaner,-node-ipam-controller"
  network:
    podSubnets: ["10.32.0.0/12","fd00:10:32::/64"]
    serviceSubnets: ["10.200.0.0/22","fd40:10:200::/108"]

Talos CCM helm values:

enabledControllers:
  - cloud-node
  - node-ipam-controller

extraArgs:
  - --allocate-node-cidrs
  - --cidr-allocator-type=CloudAllocator
  - --node-cidr-mask-size-ipv4=24
  - --node-cidr-mask-size-ipv6=80

Cilium helm values

ipam:
  mode: "kubernetes"
k8s:
  requireIPv4PodCIDR: true
  requireIPv6PodCIDR: true

enableIPv6Masquerade: false
enableIPv4Masquerade: true

Two bare metal servers with ipv6/64 separated subnets. (2a01:x:x:3064::/64, 2a01:x:x:30ac::/64) All nodes run as VMs inside bare metal servers.

PodCIDRs have ipv4 and ipv6 networks, IPv6 is global subnet

Inside the pod

# ip addr show dev eth0
17: eth0@if18: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1400 qdisc noqueue state UP qlen 1000
    link/ether 3e:3e:38:e9:03:58 brd ff:ff:ff:ff:ff:ff
    inet 10.32.3.79/32 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2a01:x:x:3064:1::f464/128 scope global flags 02 
       valid_lft forever preferred_lft forever
    inet6 fe80::3c3e:38ff:fee9:358/64 scope link 
       valid_lft forever preferred_lft forever

Acceptance

Please use the following checklist:

See make help for a description of the available targets.

frezbo commented 2 months ago

I would like Andrey also to take a look

sergelogvinov commented 1 month ago

Hi @smira, can you take a look, thanks.

sergelogvinov commented 1 month ago

this looks great to me, certainly big, and probably we'd need some kind of integration test sooner or later

Yep, indeed. But most of this code from kubernetes repo. The status of implementations is alpha. I will add the test only to my part of the changes.

sergelogvinov commented 1 month ago

/m