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
- type PodLifecycleManager
- type PodLifecycleManagerWithPodUpdateMethod
- type PodUpdateMethod
- 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) GetPod(ctx context.Context, r client.Client, cluster *fdbv1beta2.FoundationDBCluster, ...) (*corev1.Pod, error)
- 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) SetUpdateMethod(method PodUpdateMethod)
- 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.
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 PodLifecycleManagerWithPodUpdateMethod ¶ added in v2.3.0
type PodLifecycleManagerWithPodUpdateMethod interface { // SetUpdateMethod will set the update method for pods. SetUpdateMethod(method PodUpdateMethod) }
PodLifecycleManagerWithPodUpdateMethod implements an interface to change the way how pods are updated.
type PodUpdateMethod ¶ added in v2.3.0
type PodUpdateMethod string
PodUpdateMethod defines the way how a Pod should be updated, the default is "update".
const ( // Update is the default way to update pods with the update call. Update PodUpdateMethod = "update" // Patch will use the patch method to update pods. Patch PodUpdateMethod = "patch" )
type StandardPodLifecycleManager ¶
type StandardPodLifecycleManager struct {
// contains filtered or unexported fields
}
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 ¶
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) GetPod ¶
func (manager *StandardPodLifecycleManager) GetPod( ctx context.Context, r client.Client, cluster *fdbv1beta2.FoundationDBCluster, name string, ) (*corev1.Pod, error)
GetPod returns the Pod for this cluster with the specified name.
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) SetUpdateMethod ¶ added in v2.3.0
func (manager *StandardPodLifecycleManager) SetUpdateMethod(method PodUpdateMethod)
SetUpdateMethod will set the update method for pods.
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.