Skip to content

Instantly share code, notes, and snippets.

@irishgordo
Last active August 7, 2025 18:37
Show Gist options
  • Save irishgordo/ccd214817c040453e732d70df5ee034f to your computer and use it in GitHub Desktop.
Save irishgordo/ccd214817c040453e732d70df5ee034f to your computer and use it in GitHub Desktop.
mtu config audits

Cluster Network, User Defined

$\color{green}{\textsf{PASS}}$ Creating Cluster Network (non-mgmt) with uplink-mtu annotation and value of 1500 fails as expected $~~$
  1. When attempting to create Cluster Network "testing", error of: admission webhook "validator.harvester-system.harvester-network-webhook" denied the request: Internal error occurred: can't create cluster network testing because annotation network.harvesterhci.io/uplink-mtu can't be added as expected
Screenshot from 2025-07-31 11-25-35
$\color{green}{\textsf{PASS}}$ Creating Cluster Network (non-mgmt) with uplink-mtu annotation and value of 1400 fails as expected when creating as yaml $~~$
  1. When attempting to create Cluster Network new-testing with uplink-mtu: 1400 via editing as YAML on form fails as expected
Screenshot from 2025-07-31 11-33-19 Screenshot from 2025-07-31 11-32-46
$\color{red}{\textsf{FAIL}}$ Adding uplink-mtu annotation to Cluster Network when there are no valid vlanconfigs $~~$
  1. When editing a Cluster Network with 0 cluster network configurations the annotation can be added with a value like 1400
  2. When the a new network configuration is added we unfortunately do not see the network.harvesterhci.io/uplink-mtu there and present on the network configuration after it is added, it is not auto-populated as an annotation when building the resource in the UI nor is it present after the resource has been created when auditing the linkAttributes property
  3. Additionally, it causes issues as when nc1 is built, it's building the MTU for nc1 as 0
  4. Extra additionally, when the user goes back to view the uplink-mtu on the testing cluster network it has silently modified that value, shifting it surprisingly from 1400 -> 1500
Screenshot from 2025-07-31 12-03-37 Screenshot from 2025-07-31 12-03-08 Screenshot from 2025-07-31 12-02-37 Screenshot from 2025-07-31 12-01-56 Screenshot from 2025-07-31 12-00-10
$\color{green}{\textsf{PASS}}$ Attempting to change Cluster Network uplink-mtu to 1450 from 1400 when nc1 is using MTU of 1400 fails $~~$
  1. When cluster network has uplink-mtu set to 1400
  2. When cluster network configuration nc1 is built and 1400 is input as cluster network confgiuration manually
  3. When user trys to change the uplink-mtu on the cluster network to 1450 from 1400, it fails as expected because nc1 is 1400
Screenshot from 2025-07-31 12-17-50 Screenshot from 2025-07-31 12-17-22 Screenshot from 2025-07-31 12-16-55
$\color{green}{\textsf{PASS}}$ Creating a Cluster Network with MTU of 1400, Network Configuration nc1 (target node a) w/ MTU of 1400, then trying to create Network Configuration nc2 (target node b) of MTU 1450 will fail $~~$
  1. When Cluster network testing is built
  2. testing, has mtu set to 1400
  3. inside testing cluster network: nc1 is built targeting node a, w/ mtu 1400
  4. inside testing cluster network: nc2 is built targeting node b, w/ mtu 1450, failure is observed as expected: admission webhook "validator.harvester-system.harvester-network-webhook" denied the request: Internal error occurred: can't create vlanConfig nc2 because the vlanconfig nc2 MTU 1450 is different with another vlanconfig nc1 MTU 1400, all vlanconfigs on one clusternetwork need to have same MTU
Screenshot from 2025-07-31 13-23-04
$\color{green}{\textsf{PASS}}$ Deleting a cluster network will fail with active network configurations $~~$
  1. When a cluster network has one or more network configurations w/ configured MTUS
  2. Attempting to delete the parent cluster network should fail
Screenshot from 2025-07-31 15-13-22
$\color{green}{\textsf{PASS}}$ Migrating a set MTU Network Configuration from one cluster network to the other will fail when VM is running $~~$
  1. When vm is running using the network configuration, in a vm network
  2. VM has one or more nics tied to vm network
  3. MTU Network Configuration Migration will fail when trying to move to other Cluster Network
Screenshot from 2025-07-31 15-50-15
$\color{green}{\textsf{PASS}}$ Attempting to delete network configuration w/ set MTU that has a VM network and a VM using that VM Network will fail $~~$
  1. When vm is running using the network configuration, in a vm network
  2. VM has one or more nics tied to vm network
  3. MTU Network Configuration will fail to delete as expected, you must stop the VM first before the vlanConfig can be deleted
Screenshot from 2025-07-31 15-53-25
$\color{green}{\textsf{PASS}}$ A VM Network (NAD) that was built using a specific Cluster Network w/ set MTU plus a Network Config on that Cluster Network w/ set MTU -> when that Network Config for the Cluster Network is removed, the Cluster Network should still fail to delete because the NAD (VM Network) is still existing $~~$
  1. When a VM Network is built from a Cluster Network + Network Config (both with set MTU values)
  2. The VM Network is used in a VM
  3. The VM is powered off
  4. The Cluster Network's Network Configuration is removed
  5. The VM Network will be degraded
  6. Then attempting to delete the Cluster Network with set MTU, will fail, because the VM Network (NAD) still exists
Screenshot from 2025-07-31 15-56-40

MGMT Network based, not user defined

$\color{green}{\textsf{PASS}}$ User can not build a VM Network (NAD) with a set MTU on MGMT Network, that is different than MGMT Network's MTU $~~$
  1. When a mgmt nad is built like:
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  name: mgmt-nad-1
  annotations:
    field.cattle.io/description: mgmt nad 1
    #  key: string
  labels:
    {}
    #  key: string
  namespace: default
spec:
  config: >-
    {"cniVersion":"0.3.1","name":"mgmt-nad-1","type":"bridge","bridge":"mgmt-br","promiscMode":true,"vlan":2011,"ipam":{}, "mtu":1500}
__clone: true
  1. then gets modified from 1500 to 1480
  2. Failure is to be expected if cluster network MTU is 1500
Screenshot from 2025-07-31 16-41-28
$\color{green}{\textsf{PASS}}$ VM Network (NAD) on MGMT Network, it's MTU can not be set to impproper values $~~$ Screenshot from 2025-07-31 16-47-34 Screenshot from 2025-07-31 16-46-36 Screenshot from 2025-07-31 16-45-15 Screenshot from 2025-07-31 16-44-39 Screenshot from 2025-07-31 16-43-55 Screenshot from 2025-07-31 16-41-28
$\color{green}{\textsf{PASS}}$ Modifying K9s/Kubectl (not from UI) the MGMT Network We Can Add MTU Annotation $~~$
  1. when there is a VM Network built off of MGMT Network
  2. w/ kubectl/k9s modifying the MGMT network adding the mtu annotation like:
Name:         mgmt                                                                                                                                          
Namespace:                                                                                                                                                  
Labels:       <none>                                                                                                                                        
Annotations:  network.harvesterhci.io/uplink-mtu: 1400                                                                                                      
API Version:  network.harvesterhci.io/v1beta1                                                                                                               
Kind:         ClusterNetwork                                                                                                                                
Metadata:                                                                                                                                                   
  Creation Timestamp:  2025-07-29T22:56:19Z                                                                                                                 
  Finalizers:                                                                                                                                               
    wrangler.cattle.io/harvester-network-manager-cn-controller                                                                                              
  Generation:        1                                                                                                                                      
  Resource Version:  2173805                                                                                                                                
  UID:               c5624bd7-45a6-4427-b3fe-b747f32876a1                                                                                                   
Status:                                                                                                                                                     
  Conditions:                                                                                                                                               
    Last Update Time:  2025-07-29T22:56:19Z                                                                                                                 
    Status:            True                                                                                                                                 
    Type:              ready                                                                                                                                
Events:                <none>                                                                                                                              
                                       
  1. the corresponding vm network (nad) built off of the MGMT cluster network will see the MTU value present
Screenshot from 2025-07-31 17-04-24

VlanConfig

$\color{green}{\textsf{PASS}}$ Create (pending other issue, passing... overlap likely expected behavior) $~~$
  1. https://www.github.com/harvester/network-controller-harvester/pull/149#issuecomment-2697974336
$\color{green}{\textsf{PASS}}$ Update Passing $~~$
  1. https://www.github.com/harvester/network-controller-harvester/pull/149#issuecomment-2697974336
Screenshot from 2025-08-04 17-22-30 Screenshot from 2025-08-04 17-12-20 Screenshot from 2025-08-04 17-11-16 Screenshot from 2025-08-04 17-10-25 Screenshot from 2025-08-04 17-09-11 Screenshot from 2025-08-04 17-05-03 Screenshot from 2025-08-04 16-58-47 Screenshot from 2025-08-04 17-32-17 Screenshot from 2025-08-04 17-28-50
$\color{green}{\textsf{PASS}}$ Delete $~~$
  1. https://www.github.com/harvester/network-controller-harvester/pull/149#issuecomment-2697974336
Screenshot from 2025-08-04 17-46-15

NAD

$\color{green}{\textsf{PASS}}$ Create $~~$
  1. https://www.github.com/harvester/network-controller-harvester/pull/149#issuecomment-2697974336
Screenshot from 2025-08-04 17-54-46 Screenshot from 2025-08-04 17-51-09
$\color{green}{\textsf{PASS}}$ Update (mostly all, noting still elements with: https://www.github.com/harvester/harvester/issues/8788#issuecomment-3152942073 ) $~~$
  1. https://www.github.com/harvester/network-controller-harvester/pull/149#issuecomment-2697974336
Screenshot from 2025-08-04 18-08-58 Screenshot from 2025-08-04 18-06-10 Screenshot from 2025-08-04 18-04-48 Screenshot from 2025-08-04 18-03-01
$\color{green}{\textsf{PASS}}$ Delete $~~$
  1. https://www.github.com/harvester/network-controller-harvester/pull/149#issuecomment-2697974336
Screenshot from 2025-08-04 18-31-50 Screenshot from 2025-08-04 18-31-31 Screenshot from 2025-08-04 18-21-25 Screenshot from 2025-08-04 18-21-04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment