Documentation ¶
Index ¶
- Constants
- func BuildOwnerReference(ownerType metav1.TypeMeta, ownerMetadata metav1.ObjectMeta) []metav1.OwnerReference
- func CreateDefaultBackup(cluster *fdbv1beta2.FoundationDBCluster) *fdbv1beta2.FoundationDBBackup
- func CreateDefaultCluster() *fdbv1beta2.FoundationDBCluster
- func CreatePVCMap(cluster *fdbv1beta2.FoundationDBCluster, ...) map[string]corev1.PersistentVolumeClaim
- func CreatePodMap(cluster *fdbv1beta2.FoundationDBCluster, pods []*corev1.Pod) map[string]*corev1.Pod
- func GetBackupDeployment(backup *fdbv1beta2.FoundationDBBackup) (*appsv1.Deployment, error)
- func GetConfigMap(cluster *fdbv1beta2.FoundationDBCluster) (*corev1.ConfigMap, error)
- func GetConfigMapMonitorConfEntry(pClass fdbv1beta2.ProcessClass, imageType FDBImageType, serversPerPod int) string
- func GetCoordinatorsFromStatus(status *v1beta2.FoundationDBStatus) map[string]struct{}
- func GetDynamicConfHash(configMap *corev1.ConfigMap, pClass fdbv1beta2.ProcessClass, ...) (string, error)
- func GetEnvVars(container v1.Container) map[string]*v1.EnvVar
- func GetHeadlessService(cluster *fdbv1beta2.FoundationDBCluster) *corev1.Service
- func GetImage(image string, configs []fdbv1beta2.ImageConfig, versionString string, ...) (string, error)
- func GetJSONHash(object interface{}) (string, error)
- func GetMonitorConf(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (string, error)
- func GetMonitorProcessConfiguration(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (monitorapi.ProcessConfiguration, error)
- func GetObjectMetadata(cluster *fdbv1beta2.FoundationDBCluster, base *metav1.ObjectMeta, ...) metav1.ObjectMeta
- func GetPod(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (*corev1.Pod, error)
- func GetPodDNSName(cluster *fdbv1beta2.FoundationDBCluster, podName string) string
- func GetPodLabels(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) map[string]string
- func GetPodListOptions(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) []client.ListOption
- func GetPodMatchLabels(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) map[string]string
- func GetPodMetadata(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) metav1.ObjectMeta
- func GetPodSpec(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (*corev1.PodSpec, error)
- func GetPodSpecHash(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (string, error)
- func GetProcessClassFromMeta(cluster *fdbv1beta2.FoundationDBCluster, metadata v1.ObjectMeta) fdbv1beta2.ProcessClass
- func GetProcessGroupID(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (string, string)
- func GetProcessGroupIDFromMeta(cluster *fdbv1beta2.FoundationDBCluster, metadata metav1.ObjectMeta) string
- func GetPublicIPSource(pod *corev1.Pod) (fdbv1beta2.PublicIPSource, error)
- func GetPublicIPsForPod(pod *corev1.Pod, log logr.Logger) []string
- func GetPvc(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (*corev1.PersistentVolumeClaim, error)
- func GetPvcMetadata(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) metav1.ObjectMeta
- func GetService(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (*corev1.Service, error)
- func GetSidecarImage(cluster *fdbv1beta2.FoundationDBCluster, pClass fdbv1beta2.ProcessClass) (string, error)
- func GetSinglePodListOptions(cluster *fdbv1beta2.FoundationDBCluster, processGroupID string) []client.ListOption
- func GetStartCommand(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, ...) (string, error)
- func GetStorageServersPerPodForPod(pod *corev1.Pod) (int, error)
- func HasDesiredFaultTolerance(log logr.Logger, adminClient fdbadminclient.AdminClient, ...) (bool, error)
- func IsNetworkError(err error) bool
- func IsQuotaExceeded(err error) bool
- func IsTimeoutError(err error) bool
- func NewFdbPodClient(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod, log logr.Logger, ...) (podclient.FdbPodClient, error)
- func NewMockFdbPodClient(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod) (podclient.FdbPodClient, error)
- func NormalizeClusterSpec(cluster *fdbtypes.FoundationDBCluster, options DeprecationOptions) error
- func ParseProcessGroupID(id string) (fdbv1beta2.ProcessClass, int, error)
- func ProcessClassFromLabels(cluster *fdbv1beta2.FoundationDBCluster, labels map[string]string) fdbv1beta2.ProcessClass
- func RemoveWarningsInJSON(jsonString string) (string, error)
- type CliLogFileCleaner
- type DeprecationOptions
- type FDBImageType
Constants ¶
const ( // MockUnreachableAnnotation defines if a Pod should be unreachable. This annotation // is currently only used for testing cases. MockUnreachableAnnotation = "foundationdb.org/mock-unreachable" // FDBImageTypeUnified indicates that a pod is using a unified image for the // main container and sidecar container. FDBImageTypeUnified FDBImageType = "unified" // FDBImageTypeSplit indicates that a pod is using a different image for the // main container and sidecar container. FDBImageTypeSplit FDBImageType = "split" // CurrentConfigurationAnnotation is the annotation we use to store the // latest configuration. CurrentConfigurationAnnotation = "foundationdb.org/launcher-current-configuration" // EnvironmentAnnotation is the annotation we use to store the environment // variables. EnvironmentAnnotation = "foundationdb.org/launcher-environment" )
const (
// ClusterFileKey defines the key name in the ConfigMap
ClusterFileKey = "cluster-file"
)
Variables ¶
This section is empty.
Functions ¶
func BuildOwnerReference ¶ added in v0.39.2
func BuildOwnerReference(ownerType metav1.TypeMeta, ownerMetadata metav1.ObjectMeta) []metav1.OwnerReference
BuildOwnerReference returns an OwnerReference for the provided input
func CreateDefaultBackup ¶ added in v0.39.2
func CreateDefaultBackup(cluster *fdbv1beta2.FoundationDBCluster) *fdbv1beta2.FoundationDBBackup
CreateDefaultBackup creates a defaultFoundationDBCluster for testing
func CreateDefaultCluster ¶ added in v0.39.2
func CreateDefaultCluster() *fdbv1beta2.FoundationDBCluster
CreateDefaultCluster creates a default FoundationDBCluster for testing
func CreatePVCMap ¶ added in v0.45.0
func CreatePVCMap(cluster *fdbv1beta2.FoundationDBCluster, pvcs *corev1.PersistentVolumeClaimList) map[string]corev1.PersistentVolumeClaim
CreatePVCMap creates a map with the process group ID as a key and the according PVC as a value
func CreatePodMap ¶ added in v0.45.0
func CreatePodMap(cluster *fdbv1beta2.FoundationDBCluster, pods []*corev1.Pod) map[string]*corev1.Pod
CreatePodMap creates a map with the process group ID as a key and the according Pod as a value
func GetBackupDeployment ¶ added in v0.39.2
func GetBackupDeployment(backup *fdbv1beta2.FoundationDBBackup) (*appsv1.Deployment, error)
GetBackupDeployment builds a deployment for backup agents for a cluster.
func GetConfigMap ¶ added in v0.39.2
func GetConfigMap(cluster *fdbv1beta2.FoundationDBCluster) (*corev1.ConfigMap, error)
GetConfigMap builds a config map for a cluster's dynamic config
func GetConfigMapMonitorConfEntry ¶ added in v0.39.2
func GetConfigMapMonitorConfEntry(pClass fdbv1beta2.ProcessClass, imageType FDBImageType, serversPerPod int) string
GetConfigMapMonitorConfEntry returns the specific key for the monitor conf in the ConfigMap
func GetCoordinatorsFromStatus ¶ added in v0.37.0
func GetCoordinatorsFromStatus(status *v1beta2.FoundationDBStatus) map[string]struct{}
GetCoordinatorsFromStatus gets the current coordinators from the status. The returning set will contain all processes by their process group ID.
func GetDynamicConfHash ¶ added in v0.39.2
func GetDynamicConfHash(configMap *corev1.ConfigMap, pClass fdbv1beta2.ProcessClass, imageType FDBImageType, serversPerPod int) (string, error)
GetDynamicConfHash gets a hash of the data from the config map holding the cluster's dynamic conf.
This will omit keys that we do not expect the Pods to reference e.g. for storage Pods only include the storage config.
func GetEnvVars ¶ added in v0.39.2
GetEnvVars returns a HashMap of EnvVars for the container
func GetHeadlessService ¶ added in v0.39.2
func GetHeadlessService(cluster *fdbv1beta2.FoundationDBCluster) *corev1.Service
GetHeadlessService builds a headless service for a FoundationDB cluster.
func GetImage ¶ added in v0.39.2
func GetImage(image string, configs []fdbv1beta2.ImageConfig, versionString string, allowTagOverride bool) (string, error)
GetImage returns the image for container
func GetJSONHash ¶ added in v0.39.2
GetJSONHash serializes an object to JSON and takes a hash of the resulting JSON.
func GetMonitorConf ¶ added in v0.39.2
func GetMonitorConf(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, podClient podclient.FdbPodClient, serversPerPod int) (string, error)
GetMonitorConf builds the monitor conf template
func GetMonitorProcessConfiguration ¶ added in v0.49.0
func GetMonitorProcessConfiguration(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, processCount int, imageType FDBImageType, customParameterSubstitutions map[string]string) (monitorapi.ProcessConfiguration, error)
GetMonitorProcessConfiguration builds the monitor conf template for the unified image.
func GetObjectMetadata ¶ added in v0.39.2
func GetObjectMetadata(cluster *fdbv1beta2.FoundationDBCluster, base *metav1.ObjectMeta, processClass fdbv1beta2.ProcessClass, id string) metav1.ObjectMeta
GetObjectMetadata returns the ObjectMetadata for a process
func GetPod ¶ added in v0.39.2
func GetPod(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, idNum int) (*corev1.Pod, error)
GetPod builds a pod for a new process group
func GetPodDNSName ¶ added in v0.51.0
func GetPodDNSName(cluster *fdbv1beta2.FoundationDBCluster, podName string) string
GetPodDNSName determines the fully qualified DNS name for a pod.
func GetPodLabels ¶ added in v0.44.0
func GetPodLabels(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, id string) map[string]string
GetPodLabels creates the labels that we will apply to a Pod
func GetPodListOptions ¶ added in v0.39.2
func GetPodListOptions(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, id string) []client.ListOption
GetPodListOptions returns the listOptions to list Pods
func GetPodMatchLabels ¶ added in v0.44.0
func GetPodMatchLabels(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, id string) map[string]string
GetPodMatchLabels creates the labels that we will use when filtering for a pod.
func GetPodMetadata ¶ added in v0.39.2
func GetPodMetadata(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, id string, specHash string) metav1.ObjectMeta
GetPodMetadata returns the metadata for a specific Pod
func GetPodSpec ¶ added in v0.39.2
func GetPodSpec(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, idNum int) (*corev1.PodSpec, error)
GetPodSpec builds a pod spec for a FoundationDB pod
func GetPodSpecHash ¶ added in v0.39.2
func GetPodSpecHash(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, id int, spec *corev1.PodSpec) (string, error)
GetPodSpecHash builds the hash of the expected spec for a pod.
func GetProcessClassFromMeta ¶
func GetProcessClassFromMeta(cluster *fdbv1beta2.FoundationDBCluster, metadata v1.ObjectMeta) fdbv1beta2.ProcessClass
GetProcessClassFromMeta fetches the process class from an object's metadata.
func GetProcessGroupID ¶ added in v0.48.0
func GetProcessGroupID(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, idNum int) (string, string)
GetProcessGroupID generates an ID for a process group.
This will return the pod name and the processGroupID ID.
func GetProcessGroupIDFromMeta ¶ added in v0.44.0
func GetProcessGroupIDFromMeta(cluster *fdbv1beta2.FoundationDBCluster, metadata metav1.ObjectMeta) string
GetProcessGroupIDFromMeta fetches the process group ID from an object's metadata.
func GetPublicIPSource ¶ added in v0.46.0
func GetPublicIPSource(pod *corev1.Pod) (fdbv1beta2.PublicIPSource, error)
GetPublicIPSource determines how a Pod has gotten its public IP.
func GetPublicIPsForPod ¶ added in v0.39.2
GetPublicIPsForPod returns the public IPs for a Pod
func GetPvc ¶ added in v0.39.2
func GetPvc(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, idNum int) (*corev1.PersistentVolumeClaim, error)
GetPvc builds a persistent volume claim for a FoundationDB process group.
func GetPvcMetadata ¶ added in v0.39.2
func GetPvcMetadata(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, id string) metav1.ObjectMeta
GetPvcMetadata returns the metadata for a PVC
func GetService ¶ added in v0.39.2
func GetService(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, idNum int) (*corev1.Service, error)
GetService builds a service for a new process group
func GetSidecarImage ¶ added in v0.44.0
func GetSidecarImage(cluster *fdbv1beta2.FoundationDBCluster, pClass fdbv1beta2.ProcessClass) (string, error)
GetSidecarImage returns the expected sidecar image for a specific process class
func GetSinglePodListOptions ¶ added in v0.39.2
func GetSinglePodListOptions(cluster *fdbv1beta2.FoundationDBCluster, processGroupID string) []client.ListOption
GetSinglePodListOptions returns the listOptions to list a single Pod
func GetStartCommand ¶ added in v0.39.2
func GetStartCommand(cluster *fdbv1beta2.FoundationDBCluster, processClass fdbv1beta2.ProcessClass, podClient podclient.FdbPodClient, processNumber int, processCount int) (string, error)
GetStartCommand builds the expected start command for a process group.
func GetStorageServersPerPodForPod ¶ added in v0.39.2
GetStorageServersPerPodForPod returns the value of STORAGE_SERVERS_PER_POD from the sidecar or 1
func HasDesiredFaultTolerance ¶ added in v0.44.0
func HasDesiredFaultTolerance(log logr.Logger, adminClient fdbadminclient.AdminClient, cluster *fdbv1beta2.FoundationDBCluster) (bool, error)
HasDesiredFaultTolerance checks if the cluster has the desired fault tolerance.
func IsNetworkError ¶ added in v0.39.1
IsNetworkError returns true if the network is a network error net.Error
func IsQuotaExceeded ¶ added in v1.0.0
IsQuotaExceeded returns true if the error returned by the Kubernetes API is a forbidden error with the error message that the quota was exceeded
func IsTimeoutError ¶ added in v0.48.0
IsTimeoutError returns true if the observed error was a timeout error
func NewFdbPodClient ¶ added in v0.39.2
func NewFdbPodClient(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod, log logr.Logger, getTimeout time.Duration, postTimeout time.Duration) (podclient.FdbPodClient, error)
NewFdbPodClient builds a client for working with an FDB Pod
func NewMockFdbPodClient ¶ added in v0.39.2
func NewMockFdbPodClient(cluster *fdbv1beta2.FoundationDBCluster, pod *corev1.Pod) (podclient.FdbPodClient, error)
NewMockFdbPodClient builds a mock client for working with an FDB pod
func NormalizeClusterSpec ¶
func NormalizeClusterSpec(cluster *fdbtypes.FoundationDBCluster, options DeprecationOptions) error
NormalizeClusterSpec converts a cluster spec into an unambiguous, future-proof form, by applying any implicit defaults and moving configuration from deprecated fields into fully-supported fields.
func ParseProcessGroupID ¶ added in v0.46.0
func ParseProcessGroupID(id string) (fdbv1beta2.ProcessClass, int, error)
ParseProcessGroupID extracts the components of an process group ID.
func ProcessClassFromLabels ¶
func ProcessClassFromLabels(cluster *fdbv1beta2.FoundationDBCluster, labels map[string]string) fdbv1beta2.ProcessClass
ProcessClassFromLabels extracts the ProcessClass label from the metav1.ObjectMeta.Labels map
func RemoveWarningsInJSON ¶ added in v1.3.0
RemoveWarningsInJSON removes any warning messages that might appear in the status output from the fdbcli and returns the JSON output without the warning message.
Types ¶
type CliLogFileCleaner ¶ added in v1.1.1
type CliLogFileCleaner struct {
// contains filtered or unexported fields
}
CliLogFileCleaner contains the logger and the minFileAge
func NewCliLogFileCleaner ¶ added in v1.1.1
func NewCliLogFileCleaner(log logr.Logger, minFileAge time.Duration) *CliLogFileCleaner
NewCliLogFileCleaner returns a new CliLogFileCleaner
func (CliLogFileCleaner) CleanupOldCliLogs ¶ added in v1.1.1
func (c CliLogFileCleaner) CleanupOldCliLogs()
CleanupOldCliLogs removes old fdbcli log files.
type DeprecationOptions ¶
type DeprecationOptions struct { // Whether we should apply the latest defaults rather than the defaults that // were initially established for this major version. UseFutureDefaults bool // Whether we should only fill in defaults that have changes between major // versions of the operator. OnlyShowChanges bool }
DeprecationOptions controls how deprecations and changes to defaults get applied to our specs.
type FDBImageType ¶ added in v0.49.0
type FDBImageType string
FDBImageType describes a type of image a pod or cluster is using.
func GetDesiredImageType ¶ added in v0.49.0
func GetDesiredImageType(cluster *fdbv1beta2.FoundationDBCluster) FDBImageType
GetDesiredImageType determines whether a cluster is configured to use the unified or the split image.
func GetImageType ¶ added in v0.49.0
func GetImageType(pod *corev1.Pod) FDBImageType
GetImageType determines whether a pod is using the unified or the split image.