Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HAProxyError ¶
type HAProxyManager ¶
type HAProxyManager struct {
// contains filtered or unexported fields
}
func NewHAProxy ¶
func NewHAProxy(ctx context.Context, binary string, configDir, listenAddr string, podIPs []string, targetPort, servicePort string, errChan chan HAProxyError, logger logrus.FieldLogger) (*HAProxyManager, error)
type HAProxySet ¶
type HAProxySet interface { // Configure will create or update an HAProxy Instance. Configure(VIPConfig) error // StopAll will stop all HAProxy instances. // StopAll is blocking until all instances have been destroyed. StopAll() // StopOne will stop a single HAProxy instance. StopOne(listenAddrWithPort string) GetRemovals(v6Addrs []string) (removals []string) }
The HAProxySet provides a simple mechanism for managing a group of HAProxy services for multiple source and destination IP addresses. Specifically it provides a mechanism to create and reconfigure an HAProxy instance, as well as an instance to stop all running instances.
type HAProxySetManager ¶
func NewHAProxySet ¶
func NewHAProxySet(ctx context.Context, binary, configDir string, logger logrus.FieldLogger) (*HAProxySetManager, error)
func (*HAProxySetManager) Configure ¶
func (h *HAProxySetManager) Configure(config VIPConfig) error
Configure creates an haproxy config from a given v6 backend and set of pods. It makes a config for each v6-addr:port combination the reason for this is that when a pod supporting a VIP goes away, the config MUST be rewritten so we don't route traffic to dead pod IPs. When this happens, HAProxy must reload the config which causes a (very brief) downtime for a server. A 1:1 map from backend to pod minimizes the detrimental effect of pod churn from a different service reloading a config for a service that isn't relevant to it
func (*HAProxySetManager) GetRemovals ¶
func (h *HAProxySetManager) GetRemovals(v6addrs []string) []string
GetRemovals documented in HAProxySet interface
func (*HAProxySetManager) StopAll ¶
func (h *HAProxySetManager) StopAll()
func (*HAProxySetManager) StopOne ¶
func (h *HAProxySetManager) StopOne(listenAddrWithPort string)
StopOne key generated by GetRemovals which iterates over h.sources call stop with prebuilt key