-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support updating VM networks and changing cluster network migration of vlanconfigs #67
Conversation
fa9fa02
to
aed448d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few questions, please double check, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another question, thanks.
aacd6ba
to
feaef8b
Compare
29fd5cf
to
169baea
Compare
169baea
to
c5ecc44
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and have verified the updated VM network and VlanConfig migration.
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
creationTimestamp: "2023-02-10T07:13:09Z"
finalizers:
- wrangler.cattle.io/harvester-network-nad-controller
- wrangler.cattle.io/harvester-network-manager-nad-controller
generation: 2
labels:
network.harvesterhci.io/clusternetwork: enp7s0
network.harvesterhci.io/last-type: L2VlanNetwork
network.harvesterhci.io/last-vlan-id: "1"
network.harvesterhci.io/ready: "true"
network.harvesterhci.io/type: UntaggedNetwork
name: vlan1
namespace: default
resourceVersion: "1506062"
uid: e24a0755-c5d9-47f2-bb6c-5ad16fc82fc5
spec:
config: '{"cniVersion":"0.3.1","name":"vlan1","type":"bridge","bridge":"enp7s0-br","promiscMode":true,"ipam":{}}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check the last question, thanks.
0742d74
to
589cde1
Compare
589cde1
to
0282401
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
} | ||
|
||
// update nad if needed | ||
if nadCopy != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hint:
The general practice is to return the updated object when it is successful, let other OnChange be invoked with the updated object instead of old one.
Related issue: harvester/harvester#3372
Solution:
network.harvesterhci.io/last-clusternetwork
andnetwork.harvesterhci.io/last-vlan-id
. Then controllers are able to know the outdated VLAN id and cluster network to do the cleanup process including deleting the related bridge configuration and route job.network.harvesterhci.io/ready
. Once the cluster network is unready(no vlanconfig in effect) , the nad under the cluster network will be unready and can't be used by running VMs.