k8sutil

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKafkaTopicIndexers added in v0.20.1

func AddKafkaTopicIndexers(ctx context.Context, cache cache.Cache) error

func AddNewBrokerToCr

func AddNewBrokerToCr(broker v1beta1.Broker, crName, namespace string, client runtimeClient.Client) error

AddNewBrokerToCr modifies the CR and adds a new broker

func AddPvToSpecificBroker

func AddPvToSpecificBroker(brokerID, crName, namespace string, storageConfig *v1beta1.StorageConfig, client runtimeClient.Client) error

AddPvToSpecificBroker adds a new PV to a specific broker

func CheckIfObjectUpdated

func CheckIfObjectUpdated(log logr.Logger, desiredType reflect.Type, current, desired runtime.Object) bool

CheckIfObjectUpdated checks if the given object is updated using K8sObjectMatcher

func DeleteStatus

func DeleteStatus(c client.Client, brokerID string, cluster *banzaicloudv1beta1.KafkaCluster, logger logr.Logger) error

DeleteStatus deletes the given broker state from the CR

func GetCr

func GetCr(name, namespace string, client runtimeClient.Client) (*v1beta1.KafkaCluster, error)

GetCr returns the given cr object

func GetDefaultInitContainerResourceRequirements

func GetDefaultInitContainerResourceRequirements() corev1.ResourceRequirements

func IsAlreadyOwnedError

func IsAlreadyOwnedError(err error) bool

IsAlreadyOwnedError checks if a controller already own the instance

func IsMarkedForDeletion

func IsMarkedForDeletion(m metav1.ObjectMeta) bool

IsMarkedForDeletion determines if the object is marked for deletion

func IsPodContainsEvictedContainer

func IsPodContainsEvictedContainer(pod *corev1.Pod) bool

IsPodContainsEvictedContainer returns true if pod status has an evicted reason false otherwise

func IsPodContainsPendingContainer

func IsPodContainsPendingContainer(pod *corev1.Pod) bool

func IsPodContainsShutdownContainer added in v0.18.2

func IsPodContainsShutdownContainer(pod *corev1.Pod) bool

IsPodContainsShutdownContainer returns true if pod status has an shutdown reason false otherwise

func IsPodContainsTerminatedContainer

func IsPodContainsTerminatedContainer(pod *corev1.Pod) bool

func LookupKafkaCluster

func LookupKafkaCluster(ctx context.Context, client runtimeClient.Reader, clusterName, clusterNamespace string) (cluster *v1beta1.KafkaCluster, err error)

LookupKafkaCluster returns the running cluster instance based on its name and namespace

func Reconcile

func Reconcile(log logr.Logger, client runtimeClient.Client, desired runtime.Object, cr *v1beta1.KafkaCluster) error

Reconcile reconciles K8S resources

func RemoveBrokerFromCr

func RemoveBrokerFromCr(brokerID, crName, namespace string, client runtimeClient.Client) error

RemoveBrokerFromCr modifies the CR and removes the given broker from the cluster

func UpdateBrokerConfigurationBackup added in v0.22.0

func UpdateBrokerConfigurationBackup(c client.Client, cluster *banzaicloudv1beta1.KafkaCluster) error

UpdateBrokerConfigurationBackup updates the broker status with a backup from kafka broker configurations

func UpdateBrokerStatus

func UpdateBrokerStatus(c client.Client, brokerIDs []string, cluster *banzaicloudv1beta1.KafkaCluster, state interface{}, logger logr.Logger) error

UpdateBrokerStatus updates the broker status with rack and configuration infos

func UpdateCRStatus

func UpdateCRStatus(c client.Client, cluster *banzaicloudv1beta1.KafkaCluster, state interface{}, logger logr.Logger) error

UpdateCRStatus updates the cluster state

func UpdateCr

func UpdateCr(cr *v1beta1.KafkaCluster, client runtimeClient.Client) error

func UpdateCrWithRackAwarenessConfig

func UpdateCrWithRackAwarenessConfig(pod *corev1.Pod, cr *v1beta1.KafkaCluster, client runtimeClient.Client, directClient runtimeClient.Reader) (v1beta1.RackAwarenessState, error)

UpdateCrWithRackAwarenessConfig updates the CR with rack awareness config

func UpdateCrWithRollingUpgrade

func UpdateCrWithRollingUpgrade(errorCount int, cr *v1beta1.KafkaCluster, client runtimeClient.Client, logger logr.Logger) error

UpdateCrWithRollingUpgrade modifies CR status

func UpdateListenerStatuses

func UpdateListenerStatuses(ctx context.Context, c client.Client, cluster *banzaicloudv1beta1.KafkaCluster, intListenerStatuses, extListenerStatuses map[string]banzaicloudv1beta1.ListenerStatusList) error

func UpdateRollingUpgradeState

func UpdateRollingUpgradeState(c client.Client, cluster *banzaicloudv1beta1.KafkaCluster, time time.Time, logger logr.Logger) error

UpdateRollingUpgradeState updates the state of the cluster with rolling upgrade info

Types

This section is empty.

Jump to

Keyboard shortcuts

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