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
8f962673
Commit
8f962673
authored
6 years ago
by
MengxinLiu
Committed by
oilbeater
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: reuse node ip and mac annotation
parent
fa206768
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dist/images/cleanup.sh
+23
-0
dist/images/cleanup.sh
docs/install.md
+11
-9
docs/install.md
pkg/controller/node.go
+4
-1
pkg/controller/node.go
with
38 additions
and
10 deletions
+38
-10
dist/images/cleanup.sh
0 → 100644
+
23
-
0
View file @
8f962673
#!/bin/bash
set
-euo
pipefail
# Remove finalizers in svc
kubectl patch svc
-n
kube-ovn ovn-nb
--type
=
'json'
-p
'[{"op": "replace", "path": "/metadata/finalizers", "value": []}]'
kubectl patch svc
-n
kube-ovn ovn-sb
--type
=
'json'
-p
'[{"op": "replace", "path": "/metadata/finalizers", "value": []}]'
# Delete Kube-OVN components
kubectl delete ns kube-ovn
# Remove annotations in namespaces and nodes
kubectl annotate no
--all
ovn.kubernetes.io/cidr-
kubectl annotate no
--all
ovn.kubernetes.io/gateway-
kubectl annotate no
--all
ovn.kubernetes.io/ip_address-
kubectl annotate no
--all
ovn.kubernetes.io/logical_switch-
kubectl annotate no
--all
ovn.kubernetes.io/mac_address-
kubectl annotate no
--all
ovn.kubernetes.io/port_name-
kubectl annotate ns
--all
ovn.kubernetes.io/cidr-
kubectl annotate ns
--all
ovn.kubernetes.io/exclude_ips-
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-
This diff is collapsed.
Click to expand it.
docs/install.md
+
11
-
9
View file @
8f962673
...
...
@@ -25,23 +25,25 @@ For high-available ovn db, see [high available](high-available.md)
### Controller Configuration
```
bash
--default-cidr
: Default CIDR
for
Namespaces with no logical switch annotation, default: 10.16.0.0/16
--node-switch-cidr
: The CIDR
for
the Node switch. Default: 100.64.0.0/16
```
```bash
--default-cidr: Default CIDR for Namespaces with no logical switch annotation, default: 10.16.0.0/16
--node-switch-cidr: The CIDR for the Node switch. Default: 100.64.0.0/16
```
## To uninstall
1.
Remove
finalizers in svc kube-ovn/ovn-sb and kube-ovn/ovn-nb.
1.
Remove
Kubernetes resources:
2.
Delete Kube-OVN components:
```bash
wget https://raw.githubusercontent.com/alauda/kube-ovn/master/dist/images/cleanup.sh
bash cleanup.sh
```
`kubectl delete ns kube-ovn`
3.
Delete OVN/OVS DB and config files on every Node:
2.
Delete OVN/OVS DB and config files on every Node:
```bash
rm -rf /var/run/openvswitch
rm -rf /etc/origin/openvswitch/
rm -rf /etc/openvswitch
```
4.
Reboot the Node to remove ipset/iptables rules and nics.
\ No newline at end of file
3.
Reboot the Node to remove ipset/iptables rules and nics.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pkg/controller/node.go
+
4
-
1
View file @
8f962673
...
...
@@ -124,7 +124,10 @@ func (c *Controller) handleAddNode(key string) error {
return
err
}
nic
,
err
:=
c
.
ovnClient
.
CreatePort
(
c
.
config
.
NodeSwitch
,
fmt
.
Sprintf
(
"node-%s"
,
key
),
""
,
""
)
nic
,
err
:=
c
.
ovnClient
.
CreatePort
(
c
.
config
.
NodeSwitch
,
fmt
.
Sprintf
(
"node-%s"
,
key
),
node
.
Annotations
[
util
.
IpAddressAnnotation
],
node
.
Annotations
[
util
.
MacAddressAnnotation
])
if
err
!=
nil
{
return
err
}
...
...
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