kubernetes: k8s.io/kubernetes/cmd/kube-proxy/app Index | Files

package app

import "k8s.io/kubernetes/cmd/kube-proxy/app"

Package app does all of the work necessary to configure and run a Kubernetes app process.

Package app does all of the work necessary to configure and run a Kubernetes app process.


Package Files

conntrack.go init_others.go server.go server_others.go

func NewProxyCommand Uses

func NewProxyCommand() *cobra.Command

NewProxyCommand creates a *cobra.Command object with default parameters

type Conntracker Uses

type Conntracker interface {
    // SetMax adjusts nf_conntrack_max.
    SetMax(max int) error
    // SetTCPEstablishedTimeout adjusts nf_conntrack_tcp_timeout_established.
    SetTCPEstablishedTimeout(seconds int) error
    // SetTCPCloseWaitTimeout nf_conntrack_tcp_timeout_close_wait.
    SetTCPCloseWaitTimeout(seconds int) error

Conntracker is an interface to the global sysctl. Descriptions of the various sysctl fields can be found here:


type Options Uses

type Options struct {
    // ConfigFile is the location of the proxy server's configuration file.
    ConfigFile string
    // WriteConfigTo is the path where the default configuration will be written.
    WriteConfigTo string
    // CleanupAndExit, when true, makes the proxy server clean up iptables and ipvs rules, then exit.
    CleanupAndExit bool
    // WindowsService should be set to true if kube-proxy is running as a service on Windows.
    // Its corresponding flag only gets registered in Windows builds
    WindowsService bool
    // contains filtered or unexported fields

Options contains everything necessary to create and run a proxy server.

func NewOptions Uses

func NewOptions() *Options

NewOptions returns initialized Options

func (*Options) AddFlags Uses

func (o *Options) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags to fs and binds them to options.

func (*Options) ApplyDefaults Uses

func (o *Options) ApplyDefaults(in *kubeproxyconfig.KubeProxyConfiguration) (*kubeproxyconfig.KubeProxyConfiguration, error)

ApplyDefaults applies the default values to Options.

func (*Options) Complete Uses

func (o *Options) Complete() error

Complete completes all the required options.

func (*Options) Run Uses

func (o *Options) Run() error

Run runs the specified ProxyServer.

func (*Options) Validate Uses

func (o *Options) Validate() error

Validate validates all the required options.

type ProxyServer Uses

type ProxyServer struct {
    Client         clientset.Interface
    EventClient    v1core.EventsGetter
    IptInterface   utiliptables.Interface
    IpvsInterface  utilipvs.Interface
    IpsetInterface utilipset.Interface

    Proxier                proxy.Provider
    Broadcaster            record.EventBroadcaster
    Recorder               record.EventRecorder
    ConntrackConfiguration kubeproxyconfig.KubeProxyConntrackConfiguration
    Conntracker            Conntracker // if nil, ignored
    ProxyMode              string
    NodeRef                *v1.ObjectReference
    MetricsBindAddress     string
    BindAddressHardFail    bool
    EnableProfiling        bool
    UseEndpointSlices      bool
    OOMScoreAdj            *int32
    ConfigSyncPeriod       time.Duration
    HealthzServer          healthcheck.ProxierHealthUpdater
    // contains filtered or unexported fields

ProxyServer represents all the parameters required to start the Kubernetes proxy server. All fields are required.

func NewProxyServer Uses

func NewProxyServer(o *Options) (*ProxyServer, error)

NewProxyServer returns a new ProxyServer.

func (*ProxyServer) CleanupAndExit Uses

func (s *ProxyServer) CleanupAndExit() error

CleanupAndExit remove iptables rules and ipset/ipvs rules in ipvs proxy mode and exit if success return nil

func (*ProxyServer) Run Uses

func (s *ProxyServer) Run() error

Run runs the specified ProxyServer. This should never exit (unless CleanupAndExit is set). TODO: At the moment, Run() cannot return a nil error, otherwise it's caller will never exit. Update callers of Run to handle nil errors.

Package app imports 79 packages (graph) and is imported by 368 packages. Updated 2021-01-05. Refresh now. Tools for package owners.