Documentation ¶
Index ¶
- func GetPodSpec(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (*corev1.PodSpec, error)
- func GetProcessClass(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod) (fdbv1beta2.ProcessClass, error)
- func GetProcessGroupID(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod) fdbv1beta2.ProcessGroupID
- func GetProcessGroupIDFromProcessID(id string) string
- func GetPublicIPSource(pod *corev1.Pod) (fdbv1beta2.PublicIPSource, error)
- func GetPublicIPs(pod *corev1.Pod, log logr.Logger) []string
- func ParseProcessGroupID(id fdbv1beta2.ProcessGroupID) (fdbv1beta2.ProcessClass, int, error)
- type PodLifecycleManager
- type StandardPodLifecycleManager
- func (manager StandardPodLifecycleManager) CanDeletePods(ctx context.Context, adminClient fdbadminclient.AdminClient, ...) (bool, error)
- func (manager StandardPodLifecycleManager) CreatePod(ctx context.Context, r client.Client, pod *corev1.Pod) error
- func (manager StandardPodLifecycleManager) DeletePod(ctx context.Context, r client.Client, pod *corev1.Pod) error
- func (manager StandardPodLifecycleManager) GetDeletionMode(cluster *fdbv1beta2.FoundationDBCluster) fdbv1beta2.PodUpdateMode
- func (manager StandardPodLifecycleManager) GetPods(ctx context.Context, r client.Client, cluster *fdbv1beta2.FoundationDBCluster, ...) ([]*corev1.Pod, error)
- func (manager StandardPodLifecycleManager) PodIsUpdated(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, *corev1.Pod) (bool, error)
- func (manager StandardPodLifecycleManager) UpdateImageVersion(ctx context.Context, r client.Client, _ *fdbv1beta2.FoundationDBCluster, ...) error
- func (manager StandardPodLifecycleManager) UpdateMetadata(ctx context.Context, r client.Client, _ *fdbv1beta2.FoundationDBCluster, ...) error
- func (manager StandardPodLifecycleManager) UpdatePods(ctx context.Context, r client.Client, _ *fdbv1beta2.FoundationDBCluster, ...) error
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 ¶
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 ¶
GetPublicIPs returns the public IP of a pod.
func ParseProcessGroupID ¶
func ParseProcessGroupID(id fdbv1beta2.ProcessGroupID) (fdbv1beta2.ProcessClass, int, error)
ParseProcessGroupID extracts the components of a process group ID.
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) // 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
func (manager StandardPodLifecycleManager) GetDeletionMode(cluster *fdbv1beta2.FoundationDBCluster) fdbv1beta2.PodUpdateMode
GetDeletionMode returns the PodUpdateMode of the cluster if set or the default value Zone.
func (StandardPodLifecycleManager) GetPods ¶
func (manager StandardPodLifecycleManager) GetPods(ctx context.Context, r client.Client, cluster *fdbv1beta2.FoundationDBCluster, options ...client.ListOption) ([]*corev1.Pod, error)
GetPods returns a list of Pods for FDB pods that have been created.
func (StandardPodLifecycleManager) PodIsUpdated ¶
func (manager StandardPodLifecycleManager) PodIsUpdated(context.Context, client.Client, *fdbv1beta2.FoundationDBCluster, *corev1.Pod) (bool, 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 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 ¶
func (manager StandardPodLifecycleManager) UpdateMetadata(ctx context.Context, r client.Client, _ *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod) error
UpdateMetadata updates an Pod's metadata.
func (StandardPodLifecycleManager) UpdatePods ¶
func (manager StandardPodLifecycleManager) UpdatePods(ctx context.Context, r client.Client, _ *fdbv1beta2.FoundationDBCluster, pods []*corev1.Pod, _ bool) error
UpdatePods updates a list of Pods to match the latest specs.