podmanager

package
v1.52.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPodSpec

func GetPodSpec(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, idNum int) (*corev1.PodSpec, error)

GetPodSpec provides an external interface for the internal GetPodSpec method This is necessary for compatibility reasons.

func GetProcessClass

func GetProcessClass(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod) (fdbv1beta2.ProcessClass, error)

GetProcessClass fetches the process class from a Pod's metadata.

func GetProcessGroupID

func GetProcessGroupID(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod) fdbv1beta2.ProcessGroupID

GetProcessGroupID returns the process group ID from the Pods metadata

func GetProcessGroupIDFromProcessID

func GetProcessGroupIDFromProcessID(id string) string

GetProcessGroupIDFromProcessID returns the process group ID for the process ID

func GetPublicIPSource

func GetPublicIPSource(pod *corev1.Pod) (fdbv1beta2.PublicIPSource, error)

GetPublicIPSource determines how a Pod has gotten its public IP.

func GetPublicIPs

func GetPublicIPs(pod *corev1.Pod, log logr.Logger) []string

GetPublicIPs returns the public IP of a pod.

Types

type PodLifecycleManager

type PodLifecycleManager interface {
	// GetPods lists the Pods in the cluster.
	GetPods(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, ...client.ListOption) ([]*corev1.Pod, error)

	// GetPod returns the Pod for this cluster with the specified name.
	GetPod(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, string) (*corev1.Pod, error)

	// CreatePod creates a new Pod based on a pod definition.
	CreatePod(context.Context, client.Client, *corev1.Pod) error

	// DeletePod deletes a Pod.
	DeletePod(context.Context, client.Client, *corev1.Pod) error

	// CanDeletePods checks whether it is safe to delete pods.
	CanDeletePods(context.Context, fdbadminclient.AdminClient, *fdbv1beta2.FoundationDBCluster) (bool, error)

	// UpdatePods updates a list of pods to match the latest specs.
	UpdatePods(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, []*corev1.Pod, bool) error

	// UpdateImageVersion updates a container's image.
	UpdateImageVersion(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, *corev1.Pod, int, string) error

	// UpdateMetadata updates a Pod's metadata.
	UpdateMetadata(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, *corev1.Pod) error

	// PodIsUpdated determines whether a Pod is up to date.
	//
	// This does not need to check the metadata or the pod spec hash. This only
	// needs to check aspects of the rollout that are not available in the
	// Pod's metadata.
	PodIsUpdated(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, *corev1.Pod) (bool, error)

	// GetDeletionMode returns the PodUpdateMode of the cluster if set or the default value.
	GetDeletionMode(*fdbv1beta2.FoundationDBCluster) fdbv1beta2.PodUpdateMode
}

PodLifecycleManager provides an abstraction around Pod management to allow using intermediary controllers that will manage the Pod lifecycle.

type StandardPodLifecycleManager

type StandardPodLifecycleManager struct{}

StandardPodLifecycleManager provides an implementation of PodLifecycleManager that directly creates pods.

func (StandardPodLifecycleManager) CanDeletePods

func (manager StandardPodLifecycleManager) CanDeletePods(ctx context.Context, adminClient fdbadminclient.AdminClient, cluster *fdbv1beta2.FoundationDBCluster) (bool, error)

CanDeletePods checks whether it is safe to delete Pods.

func (StandardPodLifecycleManager) CreatePod

func (manager StandardPodLifecycleManager) CreatePod(ctx context.Context, r client.Client, pod *corev1.Pod) error

CreatePod creates a new Pod based on a Pod definition

func (StandardPodLifecycleManager) DeletePod

func (manager StandardPodLifecycleManager) DeletePod(ctx context.Context, r client.Client, pod *corev1.Pod) error

DeletePod shuts down a Pod

func (StandardPodLifecycleManager) GetDeletionMode added in v0.48.0

GetDeletionMode returns the PodUpdateMode of the cluster if set or the default value Zone.

func (StandardPodLifecycleManager) GetPod added in v1.18.0

GetPod returns the Pod for this cluster with the specified name.

func (StandardPodLifecycleManager) GetPods

GetPods returns a list of Pods for FDB Pods that have been created.

func (StandardPodLifecycleManager) PodIsUpdated

PodIsUpdated determines whether a Pod is up to date.

This does not need to check the metadata or the pod spec hash. This only needs to check aspects of the rollout that are not available in the PodIsUpdated metadata.

func (StandardPodLifecycleManager) UpdateImageVersion

func (manager StandardPodLifecycleManager) UpdateImageVersion(ctx context.Context, r client.Client, _ *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod, containerIndex int, image string) error

UpdateImageVersion updates a Pod container's image.

func (StandardPodLifecycleManager) UpdateMetadata

UpdateMetadata updates an Pod's metadata.

func (StandardPodLifecycleManager) UpdatePods

UpdatePods updates a list of Pods to match the latest specs.

Jump to

Keyboard shortcuts

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