Documentation
¶
Index ¶
- func AdditionalServices(ctx context.Context, rclient client.Client, defaultName, namespace string, ...) error
- func ClusterRole(ctx context.Context, rclient client.Client, ...) error
- func ClusterRoleBinding(ctx context.Context, rclient client.Client, ...) error
- func ConfigMap(ctx context.Context, rclient client.Client, newCM *corev1.ConfigMap, ...) error
- func DaemonSet(ctx context.Context, rclient client.Client, newDs, prevDs *appsv1.DaemonSet) error
- func Deployment(ctx context.Context, rclient client.Client, ...) error
- func HPA(ctx context.Context, rclient client.Client, ...) error
- func HandleSTSUpdate(ctx context.Context, rclient client.Client, cr STSOptions, ...) error
- func InitDeadlines(intervalCheck, appWaitDeadline, podReadyDeadline time.Duration)
- func IsErrorWaitTimeout(err error) bool
- func PDB(ctx context.Context, rclient client.Client, ...) error
- func PersistentVolumeClaim(ctx context.Context, rclient client.Client, ...) error
- func PodIsReady(pod *corev1.Pod, minReadySeconds int32) bool
- func Role(ctx context.Context, rclient client.Client, newRL, prevRL *rbacv1.Role) error
- func RoleBinding(ctx context.Context, rclient client.Client, newRB, prevRB *rbacv1.RoleBinding) error
- func Secret(ctx context.Context, rclient client.Client, newS *corev1.Secret, ...) error
- func Service(ctx context.Context, rclient client.Client, ...) error
- func ServiceAccount(ctx context.Context, rclient client.Client, ...) error
- func SetStatusUpdateTTL(v time.Duration)
- func StatusForChildObjects[T any, PT interface{ ... }](ctx context.Context, rclient client.Client, parentObjectName string, ...) error
- func UpdateObjectStatus[T client.Object, ST StatusWithMetadata[STC], STC any](ctx context.Context, rclient client.Client, ...) error
- func VMPodScrapeForCRD(ctx context.Context, rclient client.Client, vps *vmv1beta1.VMPodScrape) error
- func VMServiceScrapeForCRD(ctx context.Context, rclient client.Client, vss *vmv1beta1.VMServiceScrape) error
- type ObjectWithDeepCopyAndStatus
- type STSOptions
- type StatusWithMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdditionalServices ¶ added in v0.48.0
func AdditionalServices(ctx context.Context, rclient client.Client, defaultName, namespace string, prevSvc, currSvc *vmv1beta1.AdditionalServiceSpec) error
AdditionalServices reconcile AdditionalServices by conditionally removing service from previous state
func ClusterRole ¶ added in v0.51.0
func ClusterRole(ctx context.Context, rclient client.Client, newClusterRole, prevClusterRole *rbacv1.ClusterRole) error
ClusterRole reconciles cluster role object
func ClusterRoleBinding ¶ added in v0.51.0
func ClusterRoleBinding(ctx context.Context, rclient client.Client, newCRB, prevCRB *rbacv1.ClusterRoleBinding) error
ClusterRoleBinding reconciles cluster role binding object
func ConfigMap ¶ added in v0.48.0
func ConfigMap(ctx context.Context, rclient client.Client, newCM *corev1.ConfigMap, prevCMMEta *metav1.ObjectMeta) error
ConfigMap reconciles configmap object
func DaemonSet ¶ added in v0.55.0
DaemonSet performs an update or create operator for daemonset and waits until it finishes update rollout
func Deployment ¶
func Deployment(ctx context.Context, rclient client.Client, newDeploy, prevDeploy *appsv1.Deployment, hasHPA bool) error
Deployment performs an update or create operator for deployment and waits until it's replicas is ready
func HPA ¶
func HPA(ctx context.Context, rclient client.Client, newHPA, prevHPA *v2.HorizontalPodAutoscaler) error
HPA creates or update horizontalPodAutoscaler object
func HandleSTSUpdate ¶
func HandleSTSUpdate(ctx context.Context, rclient client.Client, cr STSOptions, newSts, prevSts *appsv1.StatefulSet) error
HandleSTSUpdate performs create and update operations for given statefulSet with STSOptions
func InitDeadlines ¶ added in v0.48.0
InitFromConfig sets package configuration from config
func IsErrorWaitTimeout ¶ added in v0.51.2
IsErrorWaitTimeout determines if the err is an error which indicates that timeout for app transition into Ready state reached and should be continued at the next reconcile loop
func PDB ¶
func PDB(ctx context.Context, rclient client.Client, newPDB, prevPDB *policyv1.PodDisruptionBudget) error
PDB creates or updates PodDisruptionBudget
func PersistentVolumeClaim ¶ added in v0.48.0
func PersistentVolumeClaim(ctx context.Context, rclient client.Client, newPVC, prevPVC *corev1.PersistentVolumeClaim) error
PersistentVolumeClaim reconciles PVC object It updates only resource spec other fields are ignored Makes attempt to resize pvc if needed in case of deletion timestamp > 0 does nothing user must manually remove finalizer if needed
func PodIsReady ¶
PodIsReady check is pod is ready
func RoleBinding ¶ added in v0.48.0
func RoleBinding(ctx context.Context, rclient client.Client, newRB, prevRB *rbacv1.RoleBinding) error
RoleBinding reconciles rolebindg object
func Secret ¶ added in v0.48.0
func Secret(ctx context.Context, rclient client.Client, newS *corev1.Secret, prevMeta *metav1.ObjectMeta) error
Secret reconciles secret object
func Service ¶ added in v0.48.0
func Service(ctx context.Context, rclient client.Client, newService, prevService *corev1.Service) error
Service - reconcile needed and actual state of service for given crd, it will recreate service if needed. NOTE it doesn't perform validation: in case of spec.type= LoadBalancer or NodePort, clusterIP: None is not allowed, its users responsibility to define it correctly.
func ServiceAccount ¶
func ServiceAccount(ctx context.Context, rclient client.Client, newSA, prevSA *corev1.ServiceAccount) error
ServiceAccount creates service account or updates exist one
func SetStatusUpdateTTL ¶ added in v0.52.0
SetStatusUpdateTTL configures TTL for LastUpdateTime field
Higher value decreases load on Kubernetes API server
func StatusForChildObjects ¶ added in v0.51.0
func StatusForChildObjects[T any, PT interface { *T objectWithStatus }](ctx context.Context, rclient client.Client, parentObjectName string, childObjects []PT) error
StatusForChildObjects reconciles status sub-resources Expects parentObjectName in the following form: NAME.NAMESPACE.RESOURCE
for example vmalertmanager `main` at namespace `monitoring` must be in form: main.monitoring.vmalertmanager
func UpdateObjectStatus ¶ added in v0.59.0
func UpdateObjectStatus[T client.Object, ST StatusWithMetadata[STC], STC any](ctx context.Context, rclient client.Client, object ObjectWithDeepCopyAndStatus[T, ST, STC], actualStatus vmv1beta1.UpdateStatus, maybeErr error) error
UpdateStatus reconcile provided object status with given actualStatus status
func VMPodScrapeForCRD ¶ added in v0.55.0
func VMPodScrapeForCRD(ctx context.Context, rclient client.Client, vps *vmv1beta1.VMPodScrape) error
VMPodScrapeForCRD creates or updates given object
func VMServiceScrapeForCRD ¶
func VMServiceScrapeForCRD(ctx context.Context, rclient client.Client, vss *vmv1beta1.VMServiceScrape) error
VMServiceScrapeForCRD creates or updates given object
Types ¶
type ObjectWithDeepCopyAndStatus ¶ added in v0.59.0
type STSOptions ¶
type STSOptions struct {
HasClaim bool
SelectorLabels func() map[string]string
HPA *vmv1beta1.EmbeddedHPA
UpdateReplicaCount func(count *int32)
UpdateBehavior *vmv1beta1.StatefulSetUpdateStrategyBehavior
}
STSOptions options for StatefulSet update HPA and UpdateReplicaCount optional
type StatusWithMetadata ¶ added in v0.59.0
type StatusWithMetadata[T any] interface { DeepCopy() T GetStatusMetadata() *vmv1beta1.StatusMetadata }
StatusWithMetadata defines