Documentation ¶
Index ¶
- Constants
- func AddAnnotation(obj client.Object, key, value string)
- func AddLabel(obj client.Object, key, value string)
- func ConfigMap(name, namespace, filename, data string) *corev1.ConfigMap
- func DefaultAPINamespace() (string, error)
- func EnsureObject(ctx context.Context, cl client.Client, cr *apiv1alpha1.PerconaServerMySQL, ...) error
- func EnsureObjectWithHash(ctx context.Context, cl client.Client, owner metav1.Object, obj client.Object, ...) error
- func EnsureService(ctx context.Context, cl client.Client, cr *apiv1alpha1.PerconaServerMySQL, ...) error
- func ExecProbe(probe corev1.Probe, cmd []string) *corev1.Probe
- func GetCRWithDefaults(ctx context.Context, cl client.Client, nn types.NamespacedName, ...) (*apiv1alpha1.PerconaServerMySQL, error)
- func GetOperatorNamespace() (string, error)
- func GetWatchNamespace() (string, error)
- func InitContainer(component, image string, pullPolicy corev1.PullPolicy, ...) corev1.Container
- func InitImage(ctx context.Context, cl client.Reader, cr *apiv1alpha1.PerconaServerMySQL, ...) (string, error)
- func IsPodReady(pod corev1.Pod) bool
- func IsPodWithNameReady(ctx context.Context, cl client.Client, nn types.NamespacedName) (bool, error)
- func ObjectExists(ctx context.Context, cl client.Reader, nn types.NamespacedName, ...) (bool, error)
- func ObjectHash(obj runtime.Object) (string, error)
- func OperatorImage(ctx context.Context, cl client.Reader) (string, error)
- func PVC(name string, spec *apiv1alpha1.VolumeSpec) corev1.PersistentVolumeClaim
- func PVCsByLabels(ctx context.Context, cl client.Reader, l map[string]string) ([]corev1.PersistentVolumeClaim, error)
- func PodsByLabels(ctx context.Context, cl client.Reader, l map[string]string) ([]corev1.Pod, error)
- func RemoveLabel(obj client.Object, key string)
- func RolloutRestart(ctx context.Context, cl client.Client, obj runtime.Object, ...) error
- func SecretKeySelector(name, key string) *corev1.SecretKeySelector
- func ServicesByLabels(ctx context.Context, cl client.Reader, l map[string]string) ([]corev1.Service, error)
- func UserPassword(ctx context.Context, cl client.Reader, cr *apiv1alpha1.PerconaServerMySQL, ...) (string, error)
- type ComponentWithInit
Constants ¶
const WatchNamespaceEnvVar = "WATCH_NAMESPACE"
Variables ¶
This section is empty.
Functions ¶
func AddAnnotation ¶ added in v0.6.0
func DefaultAPINamespace ¶
DefaultAPINamespace returns namespace for direct api access from a pod https://v1-21.docs.kubernetes.io/docs/tasks/run-application/access-api-from-pod/#directly-accessing-the-rest-api
func EnsureObject ¶
func EnsureObjectWithHash ¶
func EnsureService ¶ added in v0.4.0
func GetCRWithDefaults ¶ added in v0.4.0
func GetCRWithDefaults( ctx context.Context, cl client.Client, nn types.NamespacedName, serverVersion *platform.ServerVersion, ) (*apiv1alpha1.PerconaServerMySQL, error)
func GetOperatorNamespace ¶ added in v0.7.0
GetOperatorNamespace returns the namespace of the operator pod
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
func InitContainer ¶ added in v0.3.0
func InitContainer(component, image string, pullPolicy corev1.PullPolicy, secCtx *corev1.SecurityContext) corev1.Container
func InitImage ¶
func InitImage(ctx context.Context, cl client.Reader, cr *apiv1alpha1.PerconaServerMySQL, comp ComponentWithInit) (string, error)
InitImage returns the image to be used in init container. It returns component specific init image if it's defined, else it return top level init image. If there is no init image defined in the CR, it returns the current running operator image.
func IsPodReady ¶
func IsPodWithNameReady ¶ added in v0.3.0
func ObjectExists ¶
func OperatorImage ¶ added in v0.2.0
func PVC ¶
func PVC(name string, spec *apiv1alpha1.VolumeSpec) corev1.PersistentVolumeClaim
func PVCsByLabels ¶ added in v0.4.0
func PodsByLabels ¶
func RemoveLabel ¶
func RolloutRestart ¶
func RolloutRestart(ctx context.Context, cl client.Client, obj runtime.Object, key apiv1alpha1.AnnotationKey, value string) error
RolloutRestart restarts pods owned by object by updating the pod template with passed annotation key-value.
func SecretKeySelector ¶
func SecretKeySelector(name, key string) *corev1.SecretKeySelector
SecretKeySelector is a k8s helper to create SecretKeySelector object
func ServicesByLabels ¶
func UserPassword ¶
func UserPassword(ctx context.Context, cl client.Reader, cr *apiv1alpha1.PerconaServerMySQL, username apiv1alpha1.SystemUser) (string, error)
Types ¶
type ComponentWithInit ¶ added in v0.3.0
type ComponentWithInit interface {
GetInitImage() string
}