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
8f49f9e7
Commit
8f49f9e7
authored
5 years ago
by
MengxinLiu
Committed by
oilbeater
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: cleanup in offline environment
parent
c6e7039c
fix/offline-remove
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dist/images/cleanup.sh
+22
-16
dist/images/cleanup.sh
with
22 additions
and
16 deletions
+22
-16
dist/images/cleanup.sh
+
22
-
16
View file @
8f49f9e7
...
...
@@ -2,26 +2,19 @@
set
-eu
for
subnet
in
$(
kubectl get subnet
-o
name
)
;
do
kubectl patch
"
$subnet
"
--type
=
'json'
-p
'[{"op": "re
mov
e", "path": "/metadata/finalizers"}]'
kubectl patch
"
$subnet
"
--type
=
'json'
-p
'[{"op": "re
plac
e", "path": "/metadata/finalizers"
, "value": []
}]'
done
# Delete Kube-OVN components
kubectl delete
-f
https://raw.githubusercontent.com/alauda/kube-ovn/master/yamls/kube-ovn.yaml
--ignore-not-found
=
true
kubectl delete
-f
https://raw.githubusercontent.com/alauda/kube-ovn/master/yamls/ovn.yaml
--ignore-not-found
=
true
kubectl delete
-f
https://raw.githubusercontent.com/alauda/kube-ovn/master/yamls/crd.yaml
--ignore-not-found
=
true
kubectl delete cm ovn-config
-n
kube-system
--ignore-not-found
=
true
kubectl delete sa ovn
-n
kube-system
--ignore-not-found
=
true
kubectl delete clusterrole system:ovn
--ignore-not-found
=
true
kubectl delete clusterrolebinding ovn
--ignore-not-found
=
true
kubectl delete svc ovn-nb ovn-sb kube-ovn-pinger kube-ovn-controller kube-ovn-cni
-n
kube-system
--ignore-not-found
=
true
kubectl delete deployment ovn-central kube-ovn-controller
-n
kube-system
--ignore-not-found
=
true
kubectl delete ds ovs-ovn kube-ovn-cni kube-ovn-pinger
-n
kube-system
--ignore-not-found
=
true
kubectl delete crd ips.kubeovn.io subnets.kubeovn.io
--ignore-not-found
=
true
# Remove annotations in all pods of all namespaces
for
ns
in
$(
kubectl get ns
-o
name |cut
-c
11-
)
;
do
echo
"annotating pods in ns:
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/cidr-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/gateway-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/ip_address-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/logical_switch-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/mac_address-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/port_name-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/allocated-
-n
"
$ns
"
done
# Remove annotations in namespaces and nodes
kubectl annotate no
--all
ovn.kubernetes.io/cidr-
kubectl annotate no
--all
ovn.kubernetes.io/gateway-
...
...
@@ -35,3 +28,16 @@ kubectl annotate ns --all ovn.kubernetes.io/gateway-
kubectl annotate ns
--all
ovn.kubernetes.io/logical_switch-
kubectl annotate ns
--all
ovn.kubernetes.io/private-
kubectl annotate ns
--all
ovn.kubernetes.io/allow-
kubectl annotate ns
--all
ovn.kubernetes.io/allocated-
# Remove annotations in all pods of all namespaces
for
ns
in
$(
kubectl get ns
-o
name |cut
-c
11-
)
;
do
echo
"annotating pods in ns:
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/cidr-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/gateway-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/ip_address-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/logical_switch-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/mac_address-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/port_name-
-n
"
$ns
"
kubectl annotate pod
--all
ovn.kubernetes.io/allocated-
-n
"
$ns
"
done
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