Skip to content

Commit feaae30

Browse files
authored
Merge branch 'kubeovn:master' into bugfix
2 parents b93defd + 7b63325 commit feaae30

File tree

11 files changed

+280
-136
lines changed

11 files changed

+280
-136
lines changed

charts/kube-ovn/templates/controller-deploy.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ spec:
139139
- --enable-anp={{- .Values.func.ENABLE_ANP }}
140140
- --ovsdb-con-timeout={{- .Values.func.OVSDB_CON_TIMEOUT }}
141141
- --ovsdb-inactivity-timeout={{- .Values.func.OVSDB_INACTIVITY_TIMEOUT }}
142+
- --enable-live-migration-optimize={{- .Values.func.ENABLE_LIVE_MIGRATION_OPTIMIZE }}
142143
securityContext:
143144
runAsUser: {{ include "kubeovn.runAsUser" . }}
144145
privileged: false

charts/kube-ovn/templates/ovn-CR.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ rules:
206206
verbs:
207207
- approve
208208
- sign
209+
- apiGroups:
210+
- kubevirt.io
211+
resources:
212+
- virtualmachineinstancemigrations
213+
verbs:
214+
- "list"
215+
- "watch"
216+
- "get"
209217
---
210218
apiVersion: rbac.authorization.k8s.io/v1
211219
kind: ClusterRole

charts/kube-ovn/values.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func:
7777
SET_VXLAN_TX_OFF: false
7878
OVSDB_CON_TIMEOUT: 3
7979
OVSDB_INACTIVITY_TIMEOUT: 10
80+
ENABLE_LIVE_MIGRATION_OPTIMIZE: true
8081

8182
ipv4:
8283
POD_CIDR: "10.16.0.0/16"

dist/images/install.sh

+16
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ ENABLE_ANP=${ENABLE_ANP:-false}
4444
SET_VXLAN_TX_OFF=${SET_VXLAN_TX_OFF:-false}
4545
OVSDB_CON_TIMEOUT=${OVSDB_CON_TIMEOUT:-3}
4646
OVSDB_INACTIVITY_TIMEOUT=${OVSDB_INACTIVITY_TIMEOUT:-10}
47+
ENABLE_LIVE_MIGRATION_OPTIMIZE=${ENABLE_LIVE_MIGRATION_OPTIMIZE:-true}
4748

4849
# debug
4950
DEBUG_WRAPPER=${DEBUG_WRAPPER:-}
@@ -3269,6 +3270,20 @@ rules:
32693270
verbs:
32703271
- approve
32713272
- sign
3273+
- apiGroups:
3274+
- kubevirt.io
3275+
resources:
3276+
- virtualmachineinstancemigrations
3277+
verbs:
3278+
- "list"
3279+
- "watch"
3280+
- "get"
3281+
- apiGroups:
3282+
- apiextensions.k8s.io
3283+
resources:
3284+
- customresourcedefinitions
3285+
verbs:
3286+
- get
32723287
---
32733288
apiVersion: rbac.authorization.k8s.io/v1
32743289
kind: ClusterRoleBinding
@@ -4391,6 +4406,7 @@ spec:
43914406
- --enable-anp=$ENABLE_ANP
43924407
- --ovsdb-con-timeout=$OVSDB_CON_TIMEOUT
43934408
- --ovsdb-inactivity-timeout=$OVSDB_INACTIVITY_TIMEOUT
4409+
- --enable-live-migration-optimize=$ENABLE_LIVE_MIGRATION_OPTIMIZE
43944410
securityContext:
43954411
runAsUser: ${RUN_AS_USER}
43964412
privileged: false

go.mod

+11-7
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ require (
4747
google.golang.org/protobuf v1.35.2
4848
gopkg.in/k8snetworkplumbingwg/multus-cni.v4 v4.1.3
4949
k8s.io/api v0.31.3
50+
k8s.io/apiextensions-apiserver v0.31.3
5051
k8s.io/apimachinery v0.31.3
51-
k8s.io/client-go v1.5.2
52+
k8s.io/client-go v12.0.0+incompatible
5253
k8s.io/component-base v0.31.3
5354
k8s.io/klog/v2 v2.130.1
5455
k8s.io/kubectl v0.31.3
@@ -57,7 +58,8 @@ require (
5758
k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078
5859
kernel.org/pub/linux/libs/security/libcap/cap v1.2.72
5960
kubevirt.io/api v1.4.0
60-
kubevirt.io/client-go v1.3.1
61+
kubevirt.io/client-go v1.4.0
62+
kubevirt.io/kubevirt v1.4.0
6163
sigs.k8s.io/controller-runtime v0.19.2
6264
sigs.k8s.io/network-policy-api v0.1.5
6365
)
@@ -124,6 +126,7 @@ require (
124126
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
125127
github.com/godbus/dbus/v5 v5.1.0 // indirect
126128
github.com/gogo/protobuf v1.3.2 // indirect
129+
github.com/golang/glog v1.2.2 // indirect
127130
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
128131
github.com/golang/mock v1.6.0 // indirect
129132
github.com/golang/protobuf v1.5.4 // indirect
@@ -199,7 +202,7 @@ require (
199202
github.com/opencontainers/runc v1.2.2 // indirect
200203
github.com/opencontainers/runtime-spec v1.2.0 // indirect
201204
github.com/opencontainers/selinux v1.11.1 // indirect
202-
github.com/openshift/api v0.0.0-20231207204216-5efc6fca4b2d // indirect
205+
github.com/openshift/api v0.0.0 // indirect
203206
github.com/openshift/client-go v3.9.0+incompatible // indirect
204207
github.com/openshift/custom-resource-status v1.1.2 // indirect
205208
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
@@ -255,7 +258,7 @@ require (
255258
go.uber.org/zap v1.27.0 // indirect
256259
gocv.io/x/gocv v0.39.0 // indirect
257260
golang.org/x/crypto v0.29.0 // indirect
258-
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
261+
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
259262
golang.org/x/net v0.31.0 // indirect
260263
golang.org/x/oauth2 v0.24.0 // indirect
261264
golang.org/x/sync v0.9.0 // indirect
@@ -273,7 +276,6 @@ require (
273276
gopkg.in/yaml.v2 v2.4.0 // indirect
274277
gopkg.in/yaml.v3 v3.0.1 // indirect
275278
howett.net/plist v1.0.1 // indirect
276-
k8s.io/apiextensions-apiserver v0.31.3 // indirect
277279
k8s.io/apiserver v0.31.3 // indirect
278280
k8s.io/cli-runtime v0.31.3 // indirect
279281
k8s.io/cloud-provider v0.31.3 // indirect
@@ -285,6 +287,7 @@ require (
285287
k8s.io/csi-translation-lib v0.31.3 // indirect
286288
k8s.io/dynamic-resource-allocation v0.0.0 // indirect
287289
k8s.io/kms v0.31.3 // indirect
290+
k8s.io/kube-aggregator v0.26.4 // indirect
288291
k8s.io/kube-openapi v0.31.3 // indirect
289292
k8s.io/kube-scheduler v0.0.0 // indirect
290293
k8s.io/kubelet v0.31.3 // indirect
@@ -302,7 +305,8 @@ require (
302305

303306
replace (
304307
github.com/mdlayher/arp => github.com/kubeovn/arp v0.0.0-20240218024213-d9612a263f68
305-
github.com/openshift/client-go => github.com/openshift/client-go v0.0.1
308+
github.com/openshift/api => github.com/openshift/api v0.0.0-20191219222812-2987a591a72c
309+
github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47
306310
github.com/ovn-org/libovsdb => github.com/kubeovn/libovsdb v0.0.0-20240814054845-978196448fb2
307311
k8s.io/api => k8s.io/api v0.31.3
308312
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.31.3
@@ -333,5 +337,5 @@ replace (
333337
k8s.io/mount-utils => k8s.io/mount-utils v0.31.3
334338
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.31.3
335339
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.31.3
336-
kubevirt.io/client-go => github.com/kubeovn/kubevirt-client-go v0.0.0-20240823060554-65405ba5499d
340+
kubevirt.io/client-go => github.com/kubeovn/kubevirt-client-go v0.0.0-20241128091559-882afb5db2f6
337341
)

go.sum

+12-8
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keL
225225
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
226226
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
227227
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
228+
github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY=
229+
github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
228230
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
229231
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
230232
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -380,8 +382,8 @@ github.com/kubeovn/go-iptables v0.0.0-20230322103850-8619a8ab3dca h1:fTMjoho2et9
380382
github.com/kubeovn/go-iptables v0.0.0-20230322103850-8619a8ab3dca/go.mod h1:jY1XeGzkx8ASNJ+SqQSxTESNXARkjvt+I6IJOTnzIjw=
381383
github.com/kubeovn/gonetworkmanager/v2 v2.0.0-20230905082151-e28c4d73a589 h1:y9exo1hjCsq7jsGUzt11kxhTiEGrGSQ0ZqibAiZk2PQ=
382384
github.com/kubeovn/gonetworkmanager/v2 v2.0.0-20230905082151-e28c4d73a589/go.mod h1:49upX+/hUyppWIqu58cumojyIwXdkA8k6reA/mQlKuI=
383-
github.com/kubeovn/kubevirt-client-go v0.0.0-20240823060554-65405ba5499d h1:xytZ7pwEajOoKnu+7P4f/ljD+XsNeVjyG8e839ht1o8=
384-
github.com/kubeovn/kubevirt-client-go v0.0.0-20240823060554-65405ba5499d/go.mod h1:KLjiIn15GHVtlp8DZTngKY5APnPGfvQS7V7kgOTrB5o=
385+
github.com/kubeovn/kubevirt-client-go v0.0.0-20241128091559-882afb5db2f6 h1:IRNIUu06jdpvv+XunRszHH53YaVWgv1zcLyCGj1K4qk=
386+
github.com/kubeovn/kubevirt-client-go v0.0.0-20241128091559-882afb5db2f6/go.mod h1:bMA7q9MnyN7DExWPH8uJhpqwcv+XqiaURV+xeap9TIg=
385387
github.com/kubeovn/libovsdb v0.0.0-20240814054845-978196448fb2 h1:jH4yKIJLu2ZBy6fLMrlVa27ccgjzc53rsGDzNvddh0E=
386388
github.com/kubeovn/libovsdb v0.0.0-20240814054845-978196448fb2/go.mod h1:od3agzU0e50RPBxap7mMvBWZ+u37kqX0W849BYufdHI=
387389
github.com/kubeovn/ovsdb v0.0.0-20240410091831-5dd26006c475 h1:KZba2Kj9TXCUdUSqOR3eiy4VvkkIyhDVImYmYs6GQWU=
@@ -541,10 +543,10 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE
541543
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
542544
github.com/opencontainers/selinux v1.11.1 h1:nHFvthhM0qY8/m+vfhJylliSshm8G1jJ2jDMcgULaH8=
543545
github.com/opencontainers/selinux v1.11.1/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
544-
github.com/openshift/api v0.0.0-20231207204216-5efc6fca4b2d h1:DJxRHF5883tyG1Lf/5kQB4Ut2ycutC7tpGIaXMLKzYk=
545-
github.com/openshift/api v0.0.0-20231207204216-5efc6fca4b2d/go.mod h1:qNtV0315F+f8ld52TLtPvrfivZpdimOzTi3kn9IVbtU=
546-
github.com/openshift/client-go v0.0.1 h1:zJ9NsS9rwBtYkYzLCUECkdmrM6jPit3W7Q0+Pxf5gd4=
547-
github.com/openshift/client-go v0.0.1/go.mod h1:I8qTI1lgErsWc6CVukSjP1PYqpafE7fue0ZPy7A2jiw=
546+
github.com/openshift/api v0.0.0-20191219222812-2987a591a72c h1:WRWMmqacvmZDbUat6WYqpuCy2yEfIeDsxFD/Htgp2T0=
547+
github.com/openshift/api v0.0.0-20191219222812-2987a591a72c/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY=
548+
github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47 h1:+TEY29DK0XhqB7HFC9OfV8qf3wffSyi7MWv3AP28DGQ=
549+
github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47/go.mod h1:u7NRAjtYVAKokiI9LouzTv4mhds8P4S1TwdVAfbjKSk=
548550
github.com/openshift/custom-resource-status v1.1.2 h1:C3DL44LEbvlbItfd8mT5jWrqPfHnSOQoQf/sypqA6A4=
549551
github.com/openshift/custom-resource-status v1.1.2/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA=
550552
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
@@ -766,8 +768,8 @@ golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
766768
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
767769
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
768770
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
769-
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
770-
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
771+
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
772+
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
771773
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
772774
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
773775
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
@@ -1158,6 +1160,8 @@ kubevirt.io/containerized-data-importer-api v1.58.1 h1:Zbf0pCvxb4fBvtMR6uI2OIJZ4
11581160
kubevirt.io/containerized-data-importer-api v1.58.1/go.mod h1:Y/8ETgHS1GjO89bl682DPtQOYEU/1ctPFBz6Sjxm4DM=
11591161
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 h1:QMrd0nKP0BGbnxTqakhDZAUhGKxPiPiN5gSDqKUmGGc=
11601162
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90/go.mod h1:018lASpFYBsYN6XwmA2TIrPCx6e0gviTd/ZNtSitKgc=
1163+
kubevirt.io/kubevirt v1.4.0 h1:uVSa4YFzkqsv4p+UF+Zyg6976Fis2DQ/It+p26ekvLA=
1164+
kubevirt.io/kubevirt v1.4.0/go.mod h1:UmaDMGGrk1BOiLLrGnWkg0KOJaBvy7RB8iFd7FoHXQ4=
11611165
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 h1:uOuSLOMBWkJH0TWa9X6l+mj5nZdm6Ay6Bli8HL8rNfk=
11621166
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
11631167
sigs.k8s.io/controller-runtime v0.19.2 h1:3sPrF58XQEPzbE8T81TN6selQIMGbtYwuaJ6eDssDF8=

pkg/controller/config.go

+41-30
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
attachnetclientset "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned"
1212
"github.com/spf13/pflag"
13+
extClientSet "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
1314
"k8s.io/client-go/kubernetes"
1415
"k8s.io/client-go/rest"
1516
"k8s.io/client-go/tools/clientcmd"
@@ -39,8 +40,8 @@ type Configuration struct {
3940
AnpClient anpclientset.Interface
4041
AttachNetClient attachnetclientset.Interface
4142
KubevirtClient kubecli.KubevirtClient
43+
ExtClient extClientSet.Interface
4244

43-
// with no timeout
4445
KubeFactoryClient kubernetes.Interface
4546
KubeOvnFactoryClient clientset.Interface
4647

@@ -85,16 +86,17 @@ type Configuration struct {
8586
LsDnatModDlDst bool
8687
LsCtSkipDstLportIPs bool
8788

88-
EnableLb bool
89-
EnableNP bool
90-
EnableEipSnat bool
91-
EnableExternalVpc bool
92-
EnableEcmp bool
93-
EnableKeepVMIP bool
94-
EnableLbSvc bool
95-
EnableMetrics bool
96-
EnableANP bool
97-
EnableOVNIPSec bool
89+
EnableLb bool
90+
EnableNP bool
91+
EnableEipSnat bool
92+
EnableExternalVpc bool
93+
EnableEcmp bool
94+
EnableKeepVMIP bool
95+
EnableLbSvc bool
96+
EnableMetrics bool
97+
EnableANP bool
98+
EnableOVNIPSec bool
99+
EnableLiveMigrationOptimize bool
98100

99101
ExternalGatewaySwitch string
100102
ExternalGatewayConfigNS string
@@ -154,25 +156,26 @@ func ParseFlags() (*Configuration, error) {
154156
argSecureServing = pflag.Bool("secure-serving", false, "Enable secure serving")
155157
argNodePgProbeTime = pflag.Int("nodepg-probe-time", 1, "The probe interval for node port-group, the unit is minute")
156158

157-
argNetworkType = pflag.String("network-type", util.NetworkTypeGeneve, "The ovn network type")
158-
argDefaultProviderName = pflag.String("default-provider-name", "provider", "The vlan or vxlan type default provider interface name")
159-
argDefaultInterfaceName = pflag.String("default-interface-name", "", "The default host interface name in the vlan/vxlan type")
160-
argDefaultExchangeLinkName = pflag.Bool("default-exchange-link-name", false, "exchange link names of OVS bridge and the provider nic in the default provider-network")
161-
argDefaultVlanName = pflag.String("default-vlan-name", "ovn-vlan", "The default vlan name")
162-
argDefaultVlanID = pflag.Int("default-vlan-id", 1, "The default vlan id")
163-
argLsDnatModDlDst = pflag.Bool("ls-dnat-mod-dl-dst", true, "Set ethernet destination address for DNAT on logical switch")
164-
argLsCtSkipDstLportIPs = pflag.Bool("ls-ct-skip-dst-lport-ips", true, "Skip conntrack for direct traffic between lports")
165-
argPodNicType = pflag.String("pod-nic-type", "veth-pair", "The default pod network nic implementation type")
166-
argEnableLb = pflag.Bool("enable-lb", true, "Enable load balancer")
167-
argEnableNP = pflag.Bool("enable-np", true, "Enable network policy support")
168-
argEnableEipSnat = pflag.Bool("enable-eip-snat", true, "Enable EIP and SNAT")
169-
argEnableExternalVpc = pflag.Bool("enable-external-vpc", true, "Enable external vpc support")
170-
argEnableEcmp = pflag.Bool("enable-ecmp", false, "Enable ecmp route for centralized subnet")
171-
argKeepVMIP = pflag.Bool("keep-vm-ip", true, "Whether to keep ip for kubevirt pod when pod is rebuild")
172-
argEnableLbSvc = pflag.Bool("enable-lb-svc", false, "Whether to support loadbalancer service")
173-
argEnableMetrics = pflag.Bool("enable-metrics", true, "Whether to support metrics query")
174-
argEnableANP = pflag.Bool("enable-anp", false, "Enable support for admin network policy and baseline admin network policy")
175-
argEnableOVNIPSec = pflag.Bool("enable-ovn-ipsec", false, "Whether to enable ovn ipsec")
159+
argNetworkType = pflag.String("network-type", util.NetworkTypeGeneve, "The ovn network type")
160+
argDefaultProviderName = pflag.String("default-provider-name", "provider", "The vlan or vxlan type default provider interface name")
161+
argDefaultInterfaceName = pflag.String("default-interface-name", "", "The default host interface name in the vlan/vxlan type")
162+
argDefaultExchangeLinkName = pflag.Bool("default-exchange-link-name", false, "exchange link names of OVS bridge and the provider nic in the default provider-network")
163+
argDefaultVlanName = pflag.String("default-vlan-name", "ovn-vlan", "The default vlan name")
164+
argDefaultVlanID = pflag.Int("default-vlan-id", 1, "The default vlan id")
165+
argLsDnatModDlDst = pflag.Bool("ls-dnat-mod-dl-dst", true, "Set ethernet destination address for DNAT on logical switch")
166+
argLsCtSkipDstLportIPs = pflag.Bool("ls-ct-skip-dst-lport-ips", true, "Skip conntrack for direct traffic between lports")
167+
argPodNicType = pflag.String("pod-nic-type", "veth-pair", "The default pod network nic implementation type")
168+
argEnableLb = pflag.Bool("enable-lb", true, "Enable load balancer")
169+
argEnableNP = pflag.Bool("enable-np", true, "Enable network policy support")
170+
argEnableEipSnat = pflag.Bool("enable-eip-snat", true, "Enable EIP and SNAT")
171+
argEnableExternalVpc = pflag.Bool("enable-external-vpc", true, "Enable external vpc support")
172+
argEnableEcmp = pflag.Bool("enable-ecmp", false, "Enable ecmp route for centralized subnet")
173+
argKeepVMIP = pflag.Bool("keep-vm-ip", true, "Whether to keep ip for kubevirt pod when pod is rebuild")
174+
argEnableLbSvc = pflag.Bool("enable-lb-svc", false, "Whether to support loadbalancer service")
175+
argEnableMetrics = pflag.Bool("enable-metrics", true, "Whether to support metrics query")
176+
argEnableANP = pflag.Bool("enable-anp", false, "Enable support for admin network policy and baseline admin network policy")
177+
argEnableOVNIPSec = pflag.Bool("enable-ovn-ipsec", false, "Whether to enable ovn ipsec")
178+
argEnableLiveMigrationOptimize = pflag.Bool("enable-live-migration-optimize", true, "Whether to enable kubevirt live migration optimize")
176179

177180
argExternalGatewayConfigNS = pflag.String("external-gateway-config-ns", "kube-system", "The namespace of configmap external-gateway-config, default: kube-system")
178181
argExternalGatewaySwitch = pflag.String("external-gateway-switch", "external", "The name of the external gateway switch which is a ovs bridge to provide external network, default: external")
@@ -265,6 +268,7 @@ func ParseFlags() (*Configuration, error) {
265268
EnableLbSvc: *argEnableLbSvc,
266269
EnableMetrics: *argEnableMetrics,
267270
EnableOVNIPSec: *argEnableOVNIPSec,
271+
EnableLiveMigrationOptimize: *argEnableLiveMigrationOptimize,
268272
BfdMinTx: *argBfdMinTx,
269273
BfdMinRx: *argBfdMinRx,
270274
BfdDetectMult: *argBfdDetectMult,
@@ -378,6 +382,13 @@ func (config *Configuration) initKubeClient() error {
378382
}
379383
config.KubeOvnClient = kubeOvnClient
380384

385+
ExtClient, err := extClientSet.NewForConfig(cfg)
386+
if err != nil {
387+
klog.Errorf("init extentsion client failed %v", err)
388+
return err
389+
}
390+
config.ExtClient = ExtClient
391+
381392
cfg.ContentType = "application/vnd.kubernetes.protobuf"
382393
cfg.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
383394
kubeClient, err := kubernetes.NewForConfig(cfg)

0 commit comments

Comments
 (0)