From f6db0e044ab282a7624b8284a360deb3a4d93f7a Mon Sep 17 00:00:00 2001 From: Francesco Torta <62566275+fra98@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:50:34 +0100 Subject: [PATCH] feat: ipam support additional pools --- cmd/ipam/main.go | 2 +- deployments/liqo/templates/liqo-ipam-deployment.yaml | 4 ++++ pkg/ipam/initialize.go | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/ipam/main.go b/cmd/ipam/main.go index 874470f428..2fa95cf00a 100644 --- a/cmd/ipam/main.go +++ b/cmd/ipam/main.go @@ -74,7 +74,7 @@ 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.", ) // Leader election flags. diff --git a/deployments/liqo/templates/liqo-ipam-deployment.yaml b/deployments/liqo/templates/liqo-ipam-deployment.yaml index bcb33b08ed..9ce8066f42 100644 --- a/deployments/liqo/templates/liqo-ipam-deployment.yaml +++ b/deployments/liqo/templates/liqo-ipam-deployment.yaml @@ -56,6 +56,10 @@ spec: - --leader-election - --leader-election-namespace=$(POD_NAMESPACE) {{- end }} + {{- if .Values.ipam.additionalPools }} + {{- $d := dict "commandName" "--additional-pools" "list" .Values.ipam.additionalPools }} + {{- include "liqo.concatenateList" $d | nindent 12 }} + {{- end }} {{- if .Values.common.extraArgs }} {{- toYaml .Values.common.extraArgs | nindent 12 }} {{- end }} diff --git a/pkg/ipam/initialize.go b/pkg/ipam/initialize.go index 6dc72f5a1b..35d669ee36 100644 --- a/pkg/ipam/initialize.go +++ b/pkg/ipam/initialize.go @@ -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 }