ha

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ha takes care of concerns related to running the application in high availability mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HAService

type HAService struct {
	// contains filtered or unexported fields
}

HAService is the main type of the package. It takes care of concerns related to running the application in high availability mode. When running in active/passive replication mode, HAService ensures that all requests go to the active replica. HAService implements ctlmgr.Runnable. For information about individual fields, see NewHAService().

func NewHAService

func NewHAService(
	manager ctlmgr.Manager, namespace string, servingIPAddress string, servingPort int, parentLogger logr.Logger) *HAService

NewHAService creates a new HAService instance.

manager is the ctlmgr.Manager instance which orchestrates the leader election process upon which HA operation relies.

namespace is the K8s namespace in which this process and associated artefacts belong.

servingIPAddress is the IP address at which custom metrics from this process can be consumed.

servingPort is the network port at which custom metrics from this process can be consumed.

func (*HAService) Start

func (ha *HAService) Start(ctx context.Context) error

Start implements ctlmgr.Runnable.Start. The HAService.manager runs this function when this process becomes the leader. The function ensures that the single endpoint for the gardener-metrics-provider service points to this process' server endpoint, thus ensuring that all requests go to the leader.

Jump to

Keyboard shortcuts

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