Documentation
¶
Overview ¶
Package concurrent contains the logic to manage same gateway replicas. They are managed using an active/passive approach. The gateway container try to acquire the active role using the controller manager lease. Then, the active gateway is labeled with the ActiveGatewayKey and ActiveGatewayValue, and the passive gateways are unlabeled. The gateway service target the active gateway using the ActiveGatewayKey and ActiveGatewayValue labels. In order to cohordinate the sidecar containers, the gateway uses a unix socket to manage the IPC, and to start the sidecars when it becomes leader.
Index ¶
- Constants
- func AddActiveGatewayLabel(ctx context.Context, cl client.Client, key client.ObjectKey) error
- func ListAllGatewaysReplicas(ctx context.Context, cl client.Client, namespace, gatewayName string) ([]corev1.Pod, error)
- func RemoveActiveGatewayLabel(ctx context.Context, cl client.Client, key client.ObjectKey) error
- type RunnableGateway
- type RunnableGuest
Constants ¶
const ( // ActiveGatewayKey is the key used to label the active pod gateway. ActiveGatewayKey = "networking.liqo.io/active" // ActiveGatewayValue is the value used to label the active pod gateway. ActiveGatewayValue = "true" )
Variables ¶
This section is empty.
Functions ¶
func AddActiveGatewayLabel ¶
AddActiveGatewayLabel adds the active gateway label to the pod.
Types ¶
type RunnableGateway ¶
type RunnableGateway struct { Client client.Client PodName string GatewayName string Namespace string Socket net.Listener GuestConnections ipc.GuestConnections }
RunnableGateway is a RunnableGateway that manages concurrency.
func NewRunnableGatewayStartup ¶
func NewRunnableGatewayStartup(cl client.Client, podName, gatewayName, namespace string, containerNames []string) (*RunnableGateway, error)
NewRunnableGatewayStartup creates a new Runnable.
type RunnableGuest ¶
RunnableGuest is a RunnableGuest that manages concurrency.
func NewRunnableGuest ¶
func NewRunnableGuest(guestID string) (*RunnableGuest, error)
NewRunnableGuest creates a new Runnable.