smartxworks / cluster-api-provider-elf-static-ip

0 stars 2 forks source link

SKS-1825: Support IP allocation using IPPool configured on network devices #34

Closed haijianyang closed 6 months ago

haijianyang commented 7 months ago

Issue

支持为网卡配置 IPPool

Change

CAPE IPAM 技术文档

Test

ElfMachine 配置 IPPool,分配到了 IP。

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: ElfMachine
metadata:
  name: haijian-test1-controlplane-wgcpp
  namespace: default
  ownerReferences:
  - apiVersion: cluster.x-k8s.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: Machine
    name: haijian-test1-controlplane-5kggm
    uid: 41ddac80-9cee-4fd7-a572-34d915d711e5
spec:
  network:
    devices:
    - addressesFromPools:
      - apiGroup: ipam.metal3.io
        kind: IPPool
        name: ip-pool-test
      ipAddrs:
      - 1.1.1.20
      netmask: 255.255.0.0
      networkType: IPV4
      routes:
      - gateway: 1.1.0.1
      vlan: dd1f408f-7715-48c1-a817-13c3568f1d93_4cd00407-63ca-440b-80b7-ceacfccb8d08

IPPool 分配了 IP。

apiVersion: ipam.metal3.io/v1alpha1
kind: IPPool
metadata:
  finalizers:
  - ippool.ipam.metal3.io
  name: ip-pool-test
  namespace: default
spec:
  namePrefix: ip-pool-test
  pools:
  - dnsServers:
    - 114.114.114.114
    end: 1.1.1.30
    gateway: 1.1.0.1
    prefix: 16
    start: 1.1.1.20
status:
  indexes:
    default-haijian-test1-controlplane-wgcpp-0: 1.1.1.20
    default-haijian-test1-workergroup1-jhvrj-0: 1.1.1.21
  lastUpdated: "2023-12-15T07:18:59Z"
codecov[bot] commented 6 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (4e05cbc) 66.88% compared to head (abacc2c) 67.53%.

Files Patch % Lines
controllers/elfmachine_controller.go 90.32% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release-0.5 #34 +/- ## =============================================== + Coverage 66.88% 67.53% +0.64% =============================================== Files 2 2 Lines 302 308 +6 =============================================== + Hits 202 208 +6 + Misses 85 84 -1 - Partials 15 16 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.