ipvs

package
v0.0.0-...-9802481 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PkgVersion

func PkgVersion() (semver.Version, error)

PkgVersion uses reflection to determine the version of the current package. If a version cannot be determined, v1 will be assumed. The second return value is always nil.

Types

type Backend

type Backend struct {
	// forwarder is one of the 'g','i','m'
	//  g - gatewaying. Use gatewaying (direct routing). This is the default.
	//  i - ipip. Use ipip encapsulation (tunneling).
	// m - masquerading. Use masquerading (network access translation, or NAT).
	// Note: Regardless of the packet-forwarding mechanism specified, real servers for addresses for which there are interfaces on the local node will be use the local forwarding method, then packets for the servers will be passed to upper layer on the local node. This cannot be specified by ipvsadm, rather it set by the kernel as real servers are added or modified.
	Forwarder *string `pulumi:"forwarder"`
	// The host of the server-address. Host can be either a plain IP address or a hostname.
	Host string `pulumi:"host"`
	// lthreshold is an integer specifying the lower connection threshold of a server. The valid values of lthreshold are 0 through to 65535. The default is 0, which means the lower connection threshold is not set. If lthreshold is set with other values, the server will receive new connections when the number of its connections drops below its lower connection threshold. If lthreshold is not set but uthreshold is set, the server will receive new connections when the number of its connections drops below three forth of its upper connection threshold.
	Lthreshold *int `pulumi:"lthreshold"`
	// The port of the server-address.
	Port int `pulumi:"port"`
	// uthreshold is an integer specifying the upper connection threshold of a server. The valid values of uthreshold are 0 through to 65535. The default is 0, which means the upper connection threshold is not set. If uthreshold is set with other values, no new connections will be sent to the server when the number of its connections exceeds its upper connection threshold.
	Uthreshold *int `pulumi:"uthreshold"`
	// Weight is an integer specifying the capacity of a server relative to the others in the pool. The valid values of weight are 0 through to 65535. The default is 1. Quiescent servers are specified with a weight of zero. A quiescent server will receive no new jobs but still serve the existing jobs, for all scheduling algorithms distributed with the Linux Virtual Server. Setting a quiescent server may be useful if the server is overloaded or needs to be taken out of service for maintenance.
	Weight *int `pulumi:"weight"`
}

Real server that an associated request for service may be assigned to. The server-address is the host address of a real server, and may plus port. Host can be either a plain IP address or a hostname. Port can be either a plain port number or the service name of port. In the case of the masquerading method, the host address is usually an RFC 1918 private IP address, and the port can be different from that of the associated service. With the tunneling and direct routing methods, port must be equal to that of the service address. For normal services, the port specified in the service address will be used if port is not specified. For fwmark services, port may be omitted, in which case the destination port on the real server will be the destination port of the request sent to the virtual service.

func (*Backend) Defaults

func (val *Backend) Defaults() *Backend

Defaults sets the appropriate defaults for Backend

type BackendArgs

type BackendArgs struct {
	// forwarder is one of the 'g','i','m'
	//  g - gatewaying. Use gatewaying (direct routing). This is the default.
	//  i - ipip. Use ipip encapsulation (tunneling).
	// m - masquerading. Use masquerading (network access translation, or NAT).
	// Note: Regardless of the packet-forwarding mechanism specified, real servers for addresses for which there are interfaces on the local node will be use the local forwarding method, then packets for the servers will be passed to upper layer on the local node. This cannot be specified by ipvsadm, rather it set by the kernel as real servers are added or modified.
	Forwarder pulumi.StringPtrInput `pulumi:"forwarder"`
	// The host of the server-address. Host can be either a plain IP address or a hostname.
	Host pulumi.StringInput `pulumi:"host"`
	// lthreshold is an integer specifying the lower connection threshold of a server. The valid values of lthreshold are 0 through to 65535. The default is 0, which means the lower connection threshold is not set. If lthreshold is set with other values, the server will receive new connections when the number of its connections drops below its lower connection threshold. If lthreshold is not set but uthreshold is set, the server will receive new connections when the number of its connections drops below three forth of its upper connection threshold.
	Lthreshold pulumi.IntPtrInput `pulumi:"lthreshold"`
	// The port of the server-address.
	Port pulumi.IntInput `pulumi:"port"`
	// uthreshold is an integer specifying the upper connection threshold of a server. The valid values of uthreshold are 0 through to 65535. The default is 0, which means the upper connection threshold is not set. If uthreshold is set with other values, no new connections will be sent to the server when the number of its connections exceeds its upper connection threshold.
	Uthreshold pulumi.IntPtrInput `pulumi:"uthreshold"`
	// Weight is an integer specifying the capacity of a server relative to the others in the pool. The valid values of weight are 0 through to 65535. The default is 1. Quiescent servers are specified with a weight of zero. A quiescent server will receive no new jobs but still serve the existing jobs, for all scheduling algorithms distributed with the Linux Virtual Server. Setting a quiescent server may be useful if the server is overloaded or needs to be taken out of service for maintenance.
	Weight pulumi.IntPtrInput `pulumi:"weight"`
}

Real server that an associated request for service may be assigned to. The server-address is the host address of a real server, and may plus port. Host can be either a plain IP address or a hostname. Port can be either a plain port number or the service name of port. In the case of the masquerading method, the host address is usually an RFC 1918 private IP address, and the port can be different from that of the associated service. With the tunneling and direct routing methods, port must be equal to that of the service address. For normal services, the port specified in the service address will be used if port is not specified. For fwmark services, port may be omitted, in which case the destination port on the real server will be the destination port of the request sent to the virtual service.

func (*BackendArgs) Defaults

func (val *BackendArgs) Defaults() *BackendArgs

Defaults sets the appropriate defaults for BackendArgs

func (BackendArgs) ElementType

func (BackendArgs) ElementType() reflect.Type

func (BackendArgs) ToBackendOutput

func (i BackendArgs) ToBackendOutput() BackendOutput

func (BackendArgs) ToBackendOutputWithContext

func (i BackendArgs) ToBackendOutputWithContext(ctx context.Context) BackendOutput

type BackendArray

type BackendArray []BackendInput

func (BackendArray) ElementType

func (BackendArray) ElementType() reflect.Type

func (BackendArray) ToBackendArrayOutput

func (i BackendArray) ToBackendArrayOutput() BackendArrayOutput

func (BackendArray) ToBackendArrayOutputWithContext

func (i BackendArray) ToBackendArrayOutputWithContext(ctx context.Context) BackendArrayOutput

type BackendArrayInput

type BackendArrayInput interface {
	pulumi.Input

	ToBackendArrayOutput() BackendArrayOutput
	ToBackendArrayOutputWithContext(context.Context) BackendArrayOutput
}

BackendArrayInput is an input type that accepts BackendArray and BackendArrayOutput values. You can construct a concrete instance of `BackendArrayInput` via:

BackendArray{ BackendArgs{...} }

type BackendArrayOutput

type BackendArrayOutput struct{ *pulumi.OutputState }

func (BackendArrayOutput) ElementType

func (BackendArrayOutput) ElementType() reflect.Type

func (BackendArrayOutput) Index

func (BackendArrayOutput) ToBackendArrayOutput

func (o BackendArrayOutput) ToBackendArrayOutput() BackendArrayOutput

func (BackendArrayOutput) ToBackendArrayOutputWithContext

func (o BackendArrayOutput) ToBackendArrayOutputWithContext(ctx context.Context) BackendArrayOutput

type BackendInput

type BackendInput interface {
	pulumi.Input

	ToBackendOutput() BackendOutput
	ToBackendOutputWithContext(context.Context) BackendOutput
}

BackendInput is an input type that accepts BackendArgs and BackendOutput values. You can construct a concrete instance of `BackendInput` via:

BackendArgs{...}

type BackendOutput

type BackendOutput struct{ *pulumi.OutputState }

Real server that an associated request for service may be assigned to. The server-address is the host address of a real server, and may plus port. Host can be either a plain IP address or a hostname. Port can be either a plain port number or the service name of port. In the case of the masquerading method, the host address is usually an RFC 1918 private IP address, and the port can be different from that of the associated service. With the tunneling and direct routing methods, port must be equal to that of the service address. For normal services, the port specified in the service address will be used if port is not specified. For fwmark services, port may be omitted, in which case the destination port on the real server will be the destination port of the request sent to the virtual service.

func (BackendOutput) ElementType

func (BackendOutput) ElementType() reflect.Type

func (BackendOutput) Forwarder

func (o BackendOutput) Forwarder() pulumi.StringPtrOutput

forwarder is one of the 'g','i','m'

g - gatewaying. Use gatewaying (direct routing). This is the default.
i - ipip. Use ipip encapsulation (tunneling).

m - masquerading. Use masquerading (network access translation, or NAT). Note: Regardless of the packet-forwarding mechanism specified, real servers for addresses for which there are interfaces on the local node will be use the local forwarding method, then packets for the servers will be passed to upper layer on the local node. This cannot be specified by ipvsadm, rather it set by the kernel as real servers are added or modified.

func (BackendOutput) Host

The host of the server-address. Host can be either a plain IP address or a hostname.

func (BackendOutput) Lthreshold

func (o BackendOutput) Lthreshold() pulumi.IntPtrOutput

lthreshold is an integer specifying the lower connection threshold of a server. The valid values of lthreshold are 0 through to 65535. The default is 0, which means the lower connection threshold is not set. If lthreshold is set with other values, the server will receive new connections when the number of its connections drops below its lower connection threshold. If lthreshold is not set but uthreshold is set, the server will receive new connections when the number of its connections drops below three forth of its upper connection threshold.

func (BackendOutput) Port

func (o BackendOutput) Port() pulumi.IntOutput

The port of the server-address.

func (BackendOutput) ToBackendOutput

func (o BackendOutput) ToBackendOutput() BackendOutput

func (BackendOutput) ToBackendOutputWithContext

func (o BackendOutput) ToBackendOutputWithContext(ctx context.Context) BackendOutput

func (BackendOutput) Uthreshold

func (o BackendOutput) Uthreshold() pulumi.IntPtrOutput

uthreshold is an integer specifying the upper connection threshold of a server. The valid values of uthreshold are 0 through to 65535. The default is 0, which means the upper connection threshold is not set. If uthreshold is set with other values, no new connections will be sent to the server when the number of its connections exceeds its upper connection threshold.

func (BackendOutput) Weight

func (o BackendOutput) Weight() pulumi.IntPtrOutput

Weight is an integer specifying the capacity of a server relative to the others in the pool. The valid values of weight are 0 through to 65535. The default is 1. Quiescent servers are specified with a weight of zero. A quiescent server will receive no new jobs but still serve the existing jobs, for all scheduling algorithms distributed with the Linux Virtual Server. Setting a quiescent server may be useful if the server is overloaded or needs to be taken out of service for maintenance.

type Service

type Service struct {
	pulumi.ResourceState

	Backends BackendArrayOutput `pulumi:"backends"`
	// The host of the service-address. Host may be one of a plain IP address or a hostname.
	Host pulumi.StringOutput `pulumi:"host"`
	// Granularity with which clients are grouped for persistent virtual services. The source address of the request is masked with this netmask to direct all clients from a network to the same real server.
	Netmask pulumi.StringOutput `pulumi:"netmask"`
	// Virtual service persistence timeout in seconds. Multiple requests from a client are redirected to the same real server selected for the first request.
	Persistence pulumi.IntPtrOutput `pulumi:"persistence"`
	// The port of the service-address.
	Port pulumi.IntOutput `pulumi:"port"`
	// Algorithm for allocating TCP connections and UDP datagrams to real servers.
	// rr - Round Robin: distributes jobs equally amongst the available real servers.
	// wrr - Weighted Round Robin: assigns jobs to real servers proportionally to there real servers' weight. Servers with higher weights receive new jobs first and get more jobs than servers with lower weights. Servers with equal weights get an equal distribution of new jobs.
	// lc - Least-Connection: assigns more jobs to real servers with fewer active jobs.
	// wlc - Weighted Least-Connection: assigns more jobs to servers with fewer jobs and relative to the real servers' weight (Ci/Wi). This is the default.
	// lblc - Locality-Based Least-Connection: assigns jobs destined for the same IP address to the same server if the server is not overloaded and available; otherwise assign jobs to servers with fewer jobs, and keep it for future assignment.
	// lblcr - Locality-Based Least-Connection with Replication: assigns jobs destined for the same IP address to the least-connection node in the server set for the IP address. If all the node in the server set are over loaded, it picks up a node with fewer jobs in the cluster and adds it in the sever set for the target. If the server set has not been modified for the specified time, the most loaded node is removed from the server set, in order to avoid high degree of replication.
	// dh - Destination Hashing: assigns jobs to servers through looking up a statically assigned hash table by their destination IP addresses.
	// sh - Source Hashing: assigns jobs to servers through looking up a statically assigned hash table by their source IP addresses.
	// sed - Shortest Expected Delay: assigns an incoming job to the server with the shortest expected delay. The expected delay that the job will experience is (Ci + 1) / Ui if sent to the ith server, in which Ci is the number of jobs on the the ith server and Ui is the fixed service rate (weight) of the ith server.
	// nq - Never Queue: assigns an incoming job to an idle server if there is, instead of waiting for a fast one; if all the servers are busy, it adopts the Shortest Expected Delay policy to assign the job.
	Scheduler pulumi.StringOutput `pulumi:"scheduler"`
	// Service type, one of the tcp, udp, fwmark
	Type pulumi.StringOutput `pulumi:"type"`
}

Virtual service serves requests to real servers (backends)

func NewService

func NewService(ctx *pulumi.Context,
	name string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error)

NewService registers a new resource with the given unique name, arguments, and options.

func (*Service) ElementType

func (*Service) ElementType() reflect.Type

func (*Service) ToServiceOutput

func (i *Service) ToServiceOutput() ServiceOutput

func (*Service) ToServiceOutputWithContext

func (i *Service) ToServiceOutputWithContext(ctx context.Context) ServiceOutput

type ServiceArgs

type ServiceArgs struct {
	Backends BackendArrayInput
	// The host of the service-address. Host may be one of a plain IP address or a hostname.
	Host pulumi.StringInput
	// Target instance for IPVS management
	Instance linux.IpvsInput
	// Specify the granularity with which clients are grouped for persistent virtual services. The source address of the request is masked with this netmask to direct all clients from a network to the same real server. The default is 255.255.255.255, that is, the persistence granularity is per client host. Less specific netmasks may be used to resolve problems with non-persistent cache clusters on the client side. IPv6 netmasks should be specified as a prefix length between 1 and 128. The default prefix length is 128.
	Netmask pulumi.StringInput
	// Specify that a virtual service is persistent. If this option is specified, multiple requests from a client are redirected to the same real server selected for the first request. Optionally, the timeout of persistent sessions may be specified given in seconds, otherwise the default of 300 seconds will be used. This option may be used in conjunction with protocols such as SSL or FTP where it is important that clients consistently connect with the same real server.
	// Note: If a virtual service is to handle FTP connections then persistence must be set for the virtual service if Direct Routing or Tunnelling is used as the forwarding mechanism. If Masquerading is used in conjunction with an FTP service than persistence is not necessary, but the ip_vs_ftp kernel module must be used. This module may be manually inserted into the kernel using insmod(8).
	Persistence pulumi.IntPtrInput
	// The port of the service-address. The Port may be omitted, in which case zero will be used. A Port of zero is only valid if the service is persistent, in which case it is a wild-card port, that is connections will be accepted to any port.
	Port pulumi.IntInput
	// Algorithm for allocating TCP connections and UDP datagrams to real servers. Scheduling algorithms are implemented as kernel modules. Ten are shipped with the Linux Virtual Server:
	// rr - Round Robin: distributes jobs equally amongst the available real servers.
	// wrr - Weighted Round Robin: assigns jobs to real servers proportionally to there real servers' weight. Servers with higher weights receive new jobs first and get more jobs than servers with lower weights. Servers with equal weights get an equal distribution of new jobs.
	// lc - Least-Connection: assigns more jobs to real servers with fewer active jobs.
	// wlc - Weighted Least-Connection: assigns more jobs to servers with fewer jobs and relative to the real servers' weight (Ci/Wi). This is the default.
	// lblc - Locality-Based Least-Connection: assigns jobs destined for the same IP address to the same server if the server is not overloaded and available; otherwise assign jobs to servers with fewer jobs, and keep it for future assignment.
	// lblcr - Locality-Based Least-Connection with Replication: assigns jobs destined for the same IP address to the least-connection node in the server set for the IP address. If all the node in the server set are over loaded, it picks up a node with fewer jobs in the cluster and adds it in the sever set for the target. If the server set has not been modified for the specified time, the most loaded node is removed from the server set, in order to avoid high degree of replication.
	// dh - Destination Hashing: assigns jobs to servers through looking up a statically assigned hash table by their destination IP addresses.
	// sh - Source Hashing: assigns jobs to servers through looking up a statically assigned hash table by their source IP addresses.
	// sed - Shortest Expected Delay: assigns an incoming job to the server with the shortest expected delay. The expected delay that the job will experience is (Ci + 1) / Ui if sent to the ith server, in which Ci is the number of jobs on the the ith server and Ui is the fixed service rate (weight) of the ith server.
	// nq - Never Queue: assigns an incoming job to an idle server if there is, instead of waiting for a fast one; if all the servers are busy, it adopts the Shortest Expected Delay policy to assign the job.
	Scheduler pulumi.StringInput
	// Service type, one of the tcp, udp, fwmark. Default is tcp.
	//  Use a firewall-mark, an integer value greater than zero, to denote a virtual service instead of an address, port and protocol (UDP or TCP). The marking of packets with a firewall-mark is configured using the -m|--mark option to iptables. It can be used to build a virtual service assoicated with the same real servers, covering multiple IP address, port and protocol tripplets. If IPv6 addresses are used, the -6 option must be used.
	// Using firewall-mark virtual services provides a convenient method of grouping together different IP addresses, ports and protocols into a single virtual service. This is useful for both simplifying configuration if a large number of virtual services are required and grouping persistence across what would otherwise be multiple virtual services.
	Type pulumi.StringInput
}

The set of arguments for constructing a Service resource.

func (ServiceArgs) ElementType

func (ServiceArgs) ElementType() reflect.Type

type ServiceArray

type ServiceArray []ServiceInput

func (ServiceArray) ElementType

func (ServiceArray) ElementType() reflect.Type

func (ServiceArray) ToServiceArrayOutput

func (i ServiceArray) ToServiceArrayOutput() ServiceArrayOutput

func (ServiceArray) ToServiceArrayOutputWithContext

func (i ServiceArray) ToServiceArrayOutputWithContext(ctx context.Context) ServiceArrayOutput

type ServiceArrayInput

type ServiceArrayInput interface {
	pulumi.Input

	ToServiceArrayOutput() ServiceArrayOutput
	ToServiceArrayOutputWithContext(context.Context) ServiceArrayOutput
}

ServiceArrayInput is an input type that accepts ServiceArray and ServiceArrayOutput values. You can construct a concrete instance of `ServiceArrayInput` via:

ServiceArray{ ServiceArgs{...} }

type ServiceArrayOutput

type ServiceArrayOutput struct{ *pulumi.OutputState }

func (ServiceArrayOutput) ElementType

func (ServiceArrayOutput) ElementType() reflect.Type

func (ServiceArrayOutput) Index

func (ServiceArrayOutput) ToServiceArrayOutput

func (o ServiceArrayOutput) ToServiceArrayOutput() ServiceArrayOutput

func (ServiceArrayOutput) ToServiceArrayOutputWithContext

func (o ServiceArrayOutput) ToServiceArrayOutputWithContext(ctx context.Context) ServiceArrayOutput

type ServiceInput

type ServiceInput interface {
	pulumi.Input

	ToServiceOutput() ServiceOutput
	ToServiceOutputWithContext(ctx context.Context) ServiceOutput
}

type ServiceMap

type ServiceMap map[string]ServiceInput

func (ServiceMap) ElementType

func (ServiceMap) ElementType() reflect.Type

func (ServiceMap) ToServiceMapOutput

func (i ServiceMap) ToServiceMapOutput() ServiceMapOutput

func (ServiceMap) ToServiceMapOutputWithContext

func (i ServiceMap) ToServiceMapOutputWithContext(ctx context.Context) ServiceMapOutput

type ServiceMapInput

type ServiceMapInput interface {
	pulumi.Input

	ToServiceMapOutput() ServiceMapOutput
	ToServiceMapOutputWithContext(context.Context) ServiceMapOutput
}

ServiceMapInput is an input type that accepts ServiceMap and ServiceMapOutput values. You can construct a concrete instance of `ServiceMapInput` via:

ServiceMap{ "key": ServiceArgs{...} }

type ServiceMapOutput

type ServiceMapOutput struct{ *pulumi.OutputState }

func (ServiceMapOutput) ElementType

func (ServiceMapOutput) ElementType() reflect.Type

func (ServiceMapOutput) MapIndex

func (ServiceMapOutput) ToServiceMapOutput

func (o ServiceMapOutput) ToServiceMapOutput() ServiceMapOutput

func (ServiceMapOutput) ToServiceMapOutputWithContext

func (o ServiceMapOutput) ToServiceMapOutputWithContext(ctx context.Context) ServiceMapOutput

type ServiceOutput

type ServiceOutput struct{ *pulumi.OutputState }

func (ServiceOutput) Backends

func (o ServiceOutput) Backends() BackendArrayOutput

func (ServiceOutput) ElementType

func (ServiceOutput) ElementType() reflect.Type

func (ServiceOutput) Host

The host of the service-address. Host may be one of a plain IP address or a hostname.

func (ServiceOutput) Netmask

func (o ServiceOutput) Netmask() pulumi.StringOutput

Granularity with which clients are grouped for persistent virtual services. The source address of the request is masked with this netmask to direct all clients from a network to the same real server.

func (ServiceOutput) Persistence

func (o ServiceOutput) Persistence() pulumi.IntPtrOutput

Virtual service persistence timeout in seconds. Multiple requests from a client are redirected to the same real server selected for the first request.

func (ServiceOutput) Port

func (o ServiceOutput) Port() pulumi.IntOutput

The port of the service-address.

func (ServiceOutput) Scheduler

func (o ServiceOutput) Scheduler() pulumi.StringOutput

Algorithm for allocating TCP connections and UDP datagrams to real servers. rr - Round Robin: distributes jobs equally amongst the available real servers. wrr - Weighted Round Robin: assigns jobs to real servers proportionally to there real servers' weight. Servers with higher weights receive new jobs first and get more jobs than servers with lower weights. Servers with equal weights get an equal distribution of new jobs. lc - Least-Connection: assigns more jobs to real servers with fewer active jobs. wlc - Weighted Least-Connection: assigns more jobs to servers with fewer jobs and relative to the real servers' weight (Ci/Wi). This is the default. lblc - Locality-Based Least-Connection: assigns jobs destined for the same IP address to the same server if the server is not overloaded and available; otherwise assign jobs to servers with fewer jobs, and keep it for future assignment. lblcr - Locality-Based Least-Connection with Replication: assigns jobs destined for the same IP address to the least-connection node in the server set for the IP address. If all the node in the server set are over loaded, it picks up a node with fewer jobs in the cluster and adds it in the sever set for the target. If the server set has not been modified for the specified time, the most loaded node is removed from the server set, in order to avoid high degree of replication. dh - Destination Hashing: assigns jobs to servers through looking up a statically assigned hash table by their destination IP addresses. sh - Source Hashing: assigns jobs to servers through looking up a statically assigned hash table by their source IP addresses. sed - Shortest Expected Delay: assigns an incoming job to the server with the shortest expected delay. The expected delay that the job will experience is (Ci + 1) / Ui if sent to the ith server, in which Ci is the number of jobs on the the ith server and Ui is the fixed service rate (weight) of the ith server. nq - Never Queue: assigns an incoming job to an idle server if there is, instead of waiting for a fast one; if all the servers are busy, it adopts the Shortest Expected Delay policy to assign the job.

func (ServiceOutput) ToServiceOutput

func (o ServiceOutput) ToServiceOutput() ServiceOutput

func (ServiceOutput) ToServiceOutputWithContext

func (o ServiceOutput) ToServiceOutputWithContext(ctx context.Context) ServiceOutput

func (ServiceOutput) Type

Service type, one of the tcp, udp, fwmark

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL