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

0 stars 2 forks source link

Use IPPool DNS servers for ElfMachine #4

Closed haijianyang closed 1 year ago

haijianyang commented 1 year ago

使用 IPPool 配置的 DNS

优先级:ElfMachineTemplate > IPPool

apiVersion: ipam.metal3.io/v1alpha1
kind: IPPool
metadata:
  name: ip-pool-default
  namespace: cape-system
  labels:
    ippool.cluster.x-k8s.io/is-default: "true"
spec:
  pools:
    - start: 10.255.160.10
      end: 10.255.160.20
      prefix: 16
      gateway: 10.255.0.1
      dnsServers: [114.114.115.115]
  prefix: 16
  gateway: 10.255.0.1
  namePrefix: "ip-pool-default"
  dnsServers: [114.114.114.114, 114.114.116.116]

---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: ElfMachineTemplate
metadata:
  name: elfk8s8-control-plane
  namespace: default
spec:
  template:
    spec:
      cloneMode: FastClone
      ha: true
      numCPUS: 4
      memoryMiB: 6144
      diskGiB: 20
      network:
        nameservers:
        - 8.8.8.8
        devices:
        - networkType: IPV4
          vlan: dd1f408f-7715-48c1-a817-13c3568f1d93_4cd00407-63ca-440b-80b7-ceacfccb8d08
      template: de6efbf8-fdae-4cad-9305-231c67d521a8
codecov-commenter commented 1 year ago

Codecov Report

Merging #4 (c790286) into main (aac8ba6) will decrease coverage by 10.03%. The diff coverage is 91.66%.

@@             Coverage Diff             @@
##             main       #4       +/-   ##
===========================================
- Coverage   73.11%   63.08%   -10.04%     
===========================================
  Files           1        2        +1     
  Lines         212      279       +67     
===========================================
+ Hits          155      176       +21     
- Misses         39       86       +47     
+ Partials       18       17        -1     
Impacted Files Coverage Δ
controllers/elfmachine_controller.go 75.46% <81.81%> (+2.34%) :arrow_up:
pkg/ipam/util/util.go 20.63% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.