Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Kube OVN
Commits
5571619d
Commit
5571619d
authored
3 years ago
by
hzma
Browse files
Options
Download
Email Patches
Plain Diff
update nodeips for restore cmd in ko plugin
parent
1f24d64d
master
acl
acl-doc
add_unknown_to_lsp
chore/show-gw-error
chore/size
ci/base-update
ci/trivy
cni
debug
doc/optimization
doc/vip
env-check
fdb
fix-base
fix-dnat
fix-resubmit-limit
fix/avx512
fix/metrics-name
fix/src-priority
fix/subnet-without-protocol
fix_make_kind_reload
gc-vm-lsp
ip
join
ls-dnat-mod-dl-dst
mahz-master
nat-gw
networkpolicy
np_master
ns-subnet
ovn-controller
ovn-db-recover
ovs-nonstop
ovs-win64-ci
perf/libovsdb
poc
port-group
push-img
qos
qos-e2e
reflactor_note
release-1.10
remove_no_need_parms_svcAsName
restore
subnet
svc
sync-ovn-db
test/fix-flaky
testing
update-ovs
upgrade-ovs
v1.10.7
v1.10.6
v1.10.5
v1.10.4
v1.10.3
v1.10.2
v1.10.1
v1.10.0
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
dist/images/install.sh
+10
-3
dist/images/install.sh
dist/images/kubectl-ko
+10
-3
dist/images/kubectl-ko
dist/images/restore-ovn-nb-db.sh
+9
-2
dist/images/restore-ovn-nb-db.sh
dist/images/update/1.7-1.8.3.sh
+10
-3
dist/images/update/1.7-1.8.3.sh
dist/images/update/1.8.0-1.8.3.sh
+10
-3
dist/images/update/1.8.0-1.8.3.sh
dist/images/update/1.8.3-1.9.1.sh
+10
-3
dist/images/update/1.8.3-1.9.1.sh
with
59 additions
and
17 deletions
+59
-17
dist/images/install.sh
+
10
-
3
View file @
5571619d
...
...
@@ -3135,13 +3135,20 @@ dbtool(){
# backup ovn-nb db
declare nodeIpArray
declare podNameArray
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
declare nodeIps
if [[
$(
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1]}'
)
=~ "NODE_IPS" ]]; then
nodeIpVals=`kubectl get deployment -n kube-system ovn-central -o jsonpath='{.spec.template.spec.containers[0].env[1].value}'`
nodeIps=(
${
nodeIpVals
//,/
}
)
else
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
fi
firstIP=
${
nodeIps
[0]
}
podNames=`kubectl get pod -n
$KUBE_OVN_NS
| grep ovs-ovn | awk '{print
$1
}'`
echo "first nodeIP is
$firstIP
"
i=0
for nodeIp in
$nodeIps
for nodeIp in
$
{
nodeIps
[@]
}
do
for pod in
$podNames
do
...
...
@@ -3157,7 +3164,7 @@ dbtool(){
done
echo "backup nb db file"
docker run -it -v /etc/origin/ovn:/etc/ovn
$REGISTRY
/kube-ovn:
$KUBE_OVN_VERSION
bash -c "
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
"
kubectl exec -it -n
$KUBE_OVN_NS
${
podNameArray
[0]
}
--
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
# mv all db files
for pod in
${
podNameArray
[@]
}
...
...
This diff is collapsed.
Click to expand it.
dist/images/kubectl-ko
+
10
-
3
View file @
5571619d
...
...
@@ -453,13 +453,20 @@ dbtool(){
# backup ovn-nb db
declare
nodeIpArray
declare
podNameArray
nodeIps
=
`
kubectl get node
-lkube-ovn
/role
=
master
-o
wide |
grep
-v
"INTERNAL-IP"
|
awk
'{print $6}'
`
declare
nodeIps
if
[[
$(
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1]}'
)
=
~
"NODE_IPS"
]]
;
then
nodeIpVals
=
`
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1].value}'
`
nodeIps
=(
${
nodeIpVals
//,/
}
)
else
nodeIps
=
`
kubectl get node
-lkube-ovn
/role
=
master
-o
wide |
grep
-v
"INTERNAL-IP"
|
awk
'{print $6}'
`
fi
firstIP
=
${
nodeIps
[0]
}
podNames
=
`
kubectl get pod
-n
$KUBE_OVN_NS
|
grep
ovs-ovn |
awk
'{print $1}'
`
echo
"first nodeIP is
$firstIP
"
i
=
0
for
nodeIp
in
$nodeIps
for
nodeIp
in
$
{
nodeIps
[@]
}
do
for
pod
in
$podNames
do
...
...
@@ -475,7 +482,7 @@ dbtool(){
done
echo
"backup nb db file"
docker run
-it
-v
/etc/origin/ovn:/etc/ovn
$REGISTRY
/kube-ovn:
$KUBE_OVN_VERSION
bash
-c
"
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
"
kubectl
exec
-it
-n
$KUBE_OVN_NS
${
podNameArray
[0]
}
--
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
# mv all db files
for
pod
in
${
podNameArray
[@]
}
...
...
This diff is collapsed.
Click to expand it.
dist/images/restore-ovn-nb-db.sh
+
9
-
2
View file @
5571619d
...
...
@@ -9,13 +9,20 @@ echo "ovn-central original replicas is $replicas"
# backup ovn-nb db
declare
nodeIpArray
declare
podNameArray
nodeIps
=
`
kubectl get node
-lkube-ovn
/role
=
master
-o
wide |
grep
-v
"INTERNAL-IP"
|
awk
'{print $6}'
`
declare
nodeIps
if
[[
$(
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1]}'
)
=
~
"NODE_IPS"
]]
;
then
nodeIpVals
=
`
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1].value}'
`
nodeIps
=(
${
nodeIpVals
//,/
}
)
else
nodeIps
=
`
kubectl get node
-lkube-ovn
/role
=
master
-o
wide |
grep
-v
"INTERNAL-IP"
|
awk
'{print $6}'
`
fi
firstIP
=
${
nodeIps
[0]
}
podNames
=
`
kubectl get pod
-n
$KUBE_OVN_NS
|
grep
ovs-ovn |
awk
'{print $1}'
`
echo
"first nodeIP is
$firstIP
"
i
=
0
for
nodeIp
in
$nodeIps
for
nodeIp
in
$
{
nodeIps
[@]
}
do
for
pod
in
$podNames
do
...
...
This diff is collapsed.
Click to expand it.
dist/images/update/1.7-1.8.3.sh
+
10
-
3
View file @
5571619d
...
...
@@ -1297,13 +1297,20 @@ dbtool(){
# backup ovn-nb db
declare nodeIpArray
declare podNameArray
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
declare nodeIps
if [[
$(
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1]}'
)
=~ "NODE_IPS" ]]; then
nodeIpVals=`kubectl get deployment -n kube-system ovn-central -o jsonpath='{.spec.template.spec.containers[0].env[1].value}'`
nodeIps=(
${
nodeIpVals
//,/
}
)
else
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
fi
firstIP=
${
nodeIps
[0]
}
podNames=`kubectl get pod -n
$KUBE_OVN_NS
| grep ovs-ovn | awk '{print
$1
}'`
echo "first nodeIP is
$firstIP
"
i=0
for nodeIp in
$nodeIps
for nodeIp in
$
{
nodeIps
[@]
}
do
for pod in
$podNames
do
...
...
@@ -1319,7 +1326,7 @@ dbtool(){
done
echo "backup nb db file"
docker run -it -v /etc/origin/ovn:/etc/ovn
$REGISTRY
/kube-ovn:
$KUBE_OVN_VERSION
bash -c "
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
"
kubectl exec -it -n
$KUBE_OVN_NS
${
podNameArray
[0]
}
--
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
# mv all db files
for pod in
${
podNameArray
[@]
}
...
...
This diff is collapsed.
Click to expand it.
dist/images/update/1.8.0-1.8.3.sh
+
10
-
3
View file @
5571619d
...
...
@@ -527,13 +527,20 @@ dbtool(){
# backup ovn-nb db
declare nodeIpArray
declare podNameArray
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
declare nodeIps
if [[
$(
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1]}'
)
=~ "NODE_IPS" ]]; then
nodeIpVals=`kubectl get deployment -n kube-system ovn-central -o jsonpath='{.spec.template.spec.containers[0].env[1].value}'`
nodeIps=(
${
nodeIpVals
//,/
}
)
else
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
fi
firstIP=
${
nodeIps
[0]
}
podNames=`kubectl get pod -n
$KUBE_OVN_NS
| grep ovs-ovn | awk '{print
$1
}'`
echo "first nodeIP is
$firstIP
"
i=0
for nodeIp in
$nodeIps
for nodeIp in
$
{
nodeIps
[@]
}
do
for pod in
$podNames
do
...
...
@@ -549,7 +556,7 @@ dbtool(){
done
echo "backup nb db file"
docker run -it -v /etc/origin/ovn:/etc/ovn
$REGISTRY
/kube-ovn:
$KUBE_OVN_VERSION
bash -c "
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
"
kubectl exec -it -n
$KUBE_OVN_NS
${
podNameArray
[0]
}
--
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
# mv all db files
for pod in
${
podNameArray
[@]
}
...
...
This diff is collapsed.
Click to expand it.
dist/images/update/1.8.3-1.9.1.sh
+
10
-
3
View file @
5571619d
...
...
@@ -1322,13 +1322,20 @@ dbtool(){
# backup ovn-nb db
declare nodeIpArray
declare podNameArray
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
declare nodeIps
if [[
$(
kubectl get deployment
-n
kube-system ovn-central
-o
jsonpath
=
'{.spec.template.spec.containers[0].env[1]}'
)
=~ "NODE_IPS" ]]; then
nodeIpVals=`kubectl get deployment -n kube-system ovn-central -o jsonpath='{.spec.template.spec.containers[0].env[1].value}'`
nodeIps=(
${
nodeIpVals
//,/
}
)
else
nodeIps=`kubectl get node -lkube-ovn/role=master -o wide | grep -v "INTERNAL-IP" | awk '{print
$6
}'`
fi
firstIP=
${
nodeIps
[0]
}
podNames=`kubectl get pod -n
$KUBE_OVN_NS
| grep ovs-ovn | awk '{print
$1
}'`
echo "first nodeIP is
$firstIP
"
i=0
for nodeIp in
$nodeIps
for nodeIp in
$
{
nodeIps
[@]
}
do
for pod in
$podNames
do
...
...
@@ -1344,7 +1351,7 @@ dbtool(){
done
echo "backup nb db file"
docker run -it -v /etc/origin/ovn:/etc/ovn
$REGISTRY
/kube-ovn:
$KUBE_OVN_VERSION
bash -c "
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
"
kubectl exec -it -n
$KUBE_OVN_NS
${
podNameArray
[0]
}
--
ovsdb-tool cluster-to-standalone /etc/ovn/ovnnb_db_standalone.db /etc/ovn/ovnnb_db.db
# mv all db files
for pod in
${
podNameArray
[@]
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help