mirror of https://github.com/k3s-io/k3s
kubelet: remove NET_PLUGIN_CAPABILITY_SHAPING
This was effectively unused with v1.5 and later when kubelet stopped doing internal shaping and delegated all shaping to plugins.pull/6/head
parent
5b8ad3f7c5
commit
36a54bd5a4
|
@ -280,25 +280,6 @@ func (kl *Kubelet) updatePodCIDR(cidr string) {
|
|||
kl.runtimeState.setPodCIDR(cidr)
|
||||
}
|
||||
|
||||
// shapingEnabled returns whether traffic shaping is enabled.
|
||||
func (kl *Kubelet) shapingEnabled() bool {
|
||||
// Disable shaping if a network plugin is defined and supports shaping
|
||||
if kl.networkPlugin != nil && kl.networkPlugin.Capabilities().Has(network.NET_PLUGIN_CAPABILITY_SHAPING) {
|
||||
return false
|
||||
}
|
||||
// This is not strictly true but we need to figure out how to handle
|
||||
// bandwidth shaping anyway. If the kubelet doesn't have a networkPlugin,
|
||||
// it could mean:
|
||||
// a. the kubelet is responsible for bandwidth shaping
|
||||
// b. the kubelet is using cri, and the cri has a network plugin
|
||||
// Today, the only plugin that understands bandwidth shaping is kubenet, and
|
||||
// it doesn't support bandwidth shaping when invoked through cri, so it
|
||||
// effectively boils down to letting the kubelet decide how to handle
|
||||
// shaping annotations. The combination of (cri + network plugin that
|
||||
// handles bandwidth shaping) may not work because of this.
|
||||
return true
|
||||
}
|
||||
|
||||
// syncNetworkUtil ensures the network utility are present on host.
|
||||
// Network util includes:
|
||||
// 1. In nat table, KUBE-MARK-DROP rule to mark connections for dropping
|
||||
|
|
|
@ -304,7 +304,7 @@ func (plugin *kubenetNetworkPlugin) Name() string {
|
|||
}
|
||||
|
||||
func (plugin *kubenetNetworkPlugin) Capabilities() utilsets.Int {
|
||||
return utilsets.NewInt(network.NET_PLUGIN_CAPABILITY_SHAPING)
|
||||
return utilsets.NewInt()
|
||||
}
|
||||
|
||||
// setup sets up networking through CNI using the given ns/name and sandbox ID.
|
||||
|
|
|
@ -43,12 +43,6 @@ const DefaultPluginName = "kubernetes.io/no-op"
|
|||
const NET_PLUGIN_EVENT_POD_CIDR_CHANGE = "pod-cidr-change"
|
||||
const NET_PLUGIN_EVENT_POD_CIDR_CHANGE_DETAIL_CIDR = "pod-cidr"
|
||||
|
||||
// Plugin capabilities
|
||||
const (
|
||||
// Indicates the plugin handles Kubernetes bandwidth shaping annotations internally
|
||||
NET_PLUGIN_CAPABILITY_SHAPING int = 1
|
||||
)
|
||||
|
||||
// Plugin is an interface to network plugins for the kubelet
|
||||
type NetworkPlugin interface {
|
||||
// Init initializes the plugin. This will be called exactly once
|
||||
|
|
Loading…
Reference in New Issue