package winkernel
import "k8s.io/kubernetes/pkg/proxy/winkernel"
Index ¶
- Constants
- Variables
- func CanUseWinKernelProxier(kcompat KernelCompatTester) (bool, error)
- func CleanupLeftovers() (encounteredError bool)
- func Enum(p v1.Protocol) uint16
- func NewDualStackProxier( syncPeriod time.Duration, minSyncPeriod time.Duration, clusterCIDR string, hostname string, nodeIPs map[v1.IPFamily]net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxierHealthServer, config config.KubeProxyWinkernelConfiguration, healthzPort int, ) (proxy.Provider, error)
- func RegisterMetrics()
- type DualStackCompatTester
- type HcnService
- type HostNetworkService
- type KernelCompatTester
- type Proxier
- func NewProxier( ipFamily v1.IPFamily, syncPeriod time.Duration, minSyncPeriod time.Duration, clusterCIDR string, hostname string, nodeIP net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxierHealthServer, config config.KubeProxyWinkernelConfiguration, healthzPort int, ) (*Proxier, error)
- func (proxier *Proxier) OnEndpointSliceAdd(endpointSlice *discovery.EndpointSlice)
- func (proxier *Proxier) OnEndpointSliceDelete(endpointSlice *discovery.EndpointSlice)
- func (proxier *Proxier) OnEndpointSliceUpdate(_, endpointSlice *discovery.EndpointSlice)
- func (proxier *Proxier) OnEndpointSlicesSynced()
- func (proxier *Proxier) OnServiceAdd(service *v1.Service)
- func (proxier *Proxier) OnServiceDelete(service *v1.Service)
- func (proxier *Proxier) OnServiceSynced()
- func (proxier *Proxier) OnServiceUpdate(oldService, service *v1.Service)
- func (proxier *Proxier) Sync()
- func (proxier *Proxier) SyncLoop()
- type StackCompatTester
- type WindowsKernelCompatTester
Constants ¶
const ( NETWORK_TYPE_OVERLAY = "overlay" // MAX_COUNT_STALE_LOADBALANCERS is the maximum number of stale loadbalancers which cleanedup in single syncproxyrules. // If there are more stale loadbalancers to clean, it will go to next iteration of syncproxyrules. MAX_COUNT_STALE_LOADBALANCERS = 20 )
Variables ¶
var ( // LoadBalancerFlagsIPv6 enables IPV6. LoadBalancerFlagsIPv6 hcn.LoadBalancerFlags = 2 // LoadBalancerPortMappingFlagsVipExternalIP enables VipExternalIP. LoadBalancerPortMappingFlagsVipExternalIP hcn.LoadBalancerPortMappingFlags = 16 )
Functions ¶
func CanUseWinKernelProxier ¶
func CanUseWinKernelProxier(kcompat KernelCompatTester) (bool, error)
CanUseWinKernelProxier returns true if we should use the Kernel Proxier instead of the "classic" userspace Proxier. This is determined by checking the windows kernel version and for the existence of kernel features.
func CleanupLeftovers ¶
func CleanupLeftovers() (encounteredError bool)
CleanupLeftovers removes all hns rules created by the Proxier It returns true if an error was encountered. Errors are logged.
func Enum ¶
func NewDualStackProxier ¶
func NewDualStackProxier( syncPeriod time.Duration, minSyncPeriod time.Duration, clusterCIDR string, hostname string, nodeIPs map[v1.IPFamily]net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxierHealthServer, config config.KubeProxyWinkernelConfiguration, healthzPort int, ) (proxy.Provider, error)
func RegisterMetrics ¶
func RegisterMetrics()
RegisterMetrics registers kube-proxy metrics for Windows modes.
Types ¶
type DualStackCompatTester ¶
type DualStackCompatTester struct{}
func (DualStackCompatTester) DualStackCompatible ¶
func (t DualStackCompatTester) DualStackCompatible(networkName string) bool
type HcnService ¶
type HcnService interface { // Network functions GetNetworkByName(networkName string) (*hcn.HostComputeNetwork, error) GetNetworkByID(networkID string) (*hcn.HostComputeNetwork, error) // Endpoint functions ListEndpoints() ([]hcn.HostComputeEndpoint, error) ListEndpointsOfNetwork(networkId string) ([]hcn.HostComputeEndpoint, error) GetEndpointByID(endpointId string) (*hcn.HostComputeEndpoint, error) GetEndpointByName(endpointName string) (*hcn.HostComputeEndpoint, error) CreateEndpoint(network *hcn.HostComputeNetwork, endpoint *hcn.HostComputeEndpoint) (*hcn.HostComputeEndpoint, error) CreateRemoteEndpoint(network *hcn.HostComputeNetwork, endpoint *hcn.HostComputeEndpoint) (*hcn.HostComputeEndpoint, error) DeleteEndpoint(endpoint *hcn.HostComputeEndpoint) error // LoadBalancer functions ListLoadBalancers() ([]hcn.HostComputeLoadBalancer, error) GetLoadBalancerByID(loadBalancerId string) (*hcn.HostComputeLoadBalancer, error) CreateLoadBalancer(loadBalancer *hcn.HostComputeLoadBalancer) (*hcn.HostComputeLoadBalancer, error) DeleteLoadBalancer(loadBalancer *hcn.HostComputeLoadBalancer) error // Features functions GetSupportedFeatures() hcn.SupportedFeatures Ipv6DualStackSupported() error DsrSupported() error // Policy functions DeleteAllHnsLoadBalancerPolicy() }
type HostNetworkService ¶
type HostNetworkService interface {
// contains filtered or unexported methods
}
type KernelCompatTester ¶
type KernelCompatTester interface { IsCompatible() error }
KernelCompatTester tests whether the required kernel capabilities are present to run the windows kernel proxier.
type Proxier ¶
type Proxier struct { // TODO(imroc): implement node handler for winkernel proxier. proxyconfig.NoopNodeHandler // contains filtered or unexported fields }
Proxier is an hns based proxy for connections between a localhost:lport and services that provide the actual backends.
func NewProxier ¶
func NewProxier( ipFamily v1.IPFamily, syncPeriod time.Duration, minSyncPeriod time.Duration, clusterCIDR string, hostname string, nodeIP net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxierHealthServer, config config.KubeProxyWinkernelConfiguration, healthzPort int, ) (*Proxier, error)
NewProxier returns a new Proxier
func (*Proxier) OnEndpointSliceAdd ¶
func (proxier *Proxier) OnEndpointSliceAdd(endpointSlice *discovery.EndpointSlice)
OnEndpointSliceAdd is called whenever creation of a new endpoint slice object is observed.
func (*Proxier) OnEndpointSliceDelete ¶
func (proxier *Proxier) OnEndpointSliceDelete(endpointSlice *discovery.EndpointSlice)
OnEndpointSliceDelete is called whenever deletion of an existing endpoint slice object is observed.
func (*Proxier) OnEndpointSliceUpdate ¶
func (proxier *Proxier) OnEndpointSliceUpdate(_, endpointSlice *discovery.EndpointSlice)
OnEndpointSliceUpdate is called whenever modification of an existing endpoint slice object is observed.
func (*Proxier) OnEndpointSlicesSynced ¶
func (proxier *Proxier) OnEndpointSlicesSynced()
OnEndpointSlicesSynced is called once all the initial event handlers were called and the state is fully propagated to local cache.
func (*Proxier) OnServiceAdd ¶
OnServiceAdd is called whenever creation of new service object is observed.
func (*Proxier) OnServiceDelete ¶
OnServiceDelete is called whenever deletion of an existing service object is observed.
func (*Proxier) OnServiceSynced ¶
func (proxier *Proxier) OnServiceSynced()
OnServiceSynced is called once all the initial event handlers were called and the state is fully propagated to local cache.
func (*Proxier) OnServiceUpdate ¶
OnServiceUpdate is called whenever modification of an existing service object is observed.
func (*Proxier) Sync ¶
func (proxier *Proxier) Sync()
Sync is called to synchronize the proxier state to hns as soon as possible.
func (*Proxier) SyncLoop ¶
func (proxier *Proxier) SyncLoop()
SyncLoop runs periodic work. This is expected to run as a goroutine or as the main loop of the app. It does not return.
type StackCompatTester ¶
StackCompatTester tests whether the required kernel and network are dualstack capable
type WindowsKernelCompatTester ¶
type WindowsKernelCompatTester struct{}
func (WindowsKernelCompatTester) IsCompatible ¶
func (lkct WindowsKernelCompatTester) IsCompatible() error
IsCompatible returns true if winkernel can support this mode of proxy
Source Files ¶
hcnutils.go hns.go metrics.go proxier.go
Directories ¶
Path | Synopsis |
---|---|
pkg/proxy/winkernel/testing |
- Version
- v1.29.8
- Published
- Aug 14, 2024
- Platform
- windows/amd64
- Imports
- 32 packages
- Last checked
- 2 minutes ago –
Tools for package owners.