Skip to content

Commit

Permalink
feat: ipam support additional pools
Browse files Browse the repository at this point in the history
  • Loading branch information
fra98 committed Dec 2, 2024
1 parent b38a260 commit 589044b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cmd/ipam/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ func main() {
"The interval at which the IPAM will synchronize the IPAM storage.")
cmd.Flags().BoolVar(&options.ServerOpts.GraphvizEnabled, "enable-graphviz", false, "Enable the graphviz output for the IPAM.")
cmd.Flags().StringSliceVar(&options.ServerOpts.Pools, "pools",
[]string{"10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12"}, "The pools used by the IPAM.",
[]string{"10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12"},
"The pools used by the IPAM to acquire Networks and IPs from. Default: private addesses range.",
)

// Leader election flags.
Expand Down
4 changes: 4 additions & 0 deletions deployments/liqo/templates/liqo-ipam-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ spec:
- --leader-election
- --leader-election-namespace=$(POD_NAMESPACE)
{{- end }}
{{- if .Values.ipam.pools }}
{{- $d := dict "commandName" "--pools" "list" .Values.ipam.pools }}
{{- include "liqo.concatenateList" $d | nindent 12 }}
{{- end }}
{{- if .Values.common.extraArgs }}
{{- toYaml .Values.common.extraArgs | nindent 12 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions deployments/liqo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,10 @@ ipam:
# you need tell liqo the subnets used in your cluster. E.g if your cluster nodes belong to the 192.168.2.0/24 subnet, then
# you should add that subnet to the reservedSubnets. PodCIDR and serviceCIDR used in the local cluster are automatically added to the reserved list.
reservedSubnets: []
# -- Set of additional network pools to perform the automatic address mapping in Liqo.
# -- Set of network pools to perform the automatic address mapping in Liqo.
# Network pools are used to map a cluster network into another one in order to prevent conflicts.
# Default set of network pools is: [10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12]
additionalPools: []
# If left empty, it is defaulted to the private addresses range: [10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12]
pools: []

crdReplicator:
pod:
Expand Down
2 changes: 2 additions & 0 deletions pkg/ipam/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func (lipam *LiqoIPAM) initialize(ctx context.Context) error {
defer lipam.mutex.Unlock()
klog.Info("Initializing IPAM")

klog.Infof("IPAM pools: %v", lipam.opts.Pools)

if err := lipam.initializeNetworks(ctx); err != nil {
return err
}
Expand Down

0 comments on commit 589044b

Please sign in to comment.