Documentation ¶
Index ¶
- Constants
- func APIList[T ListContinue](ctx context.Context, api ListAPI[T], opts meta.ListOptions, ...) error
- func AddOwnerRefToObject(obj meta.Object, ownerRef *meta.OwnerReference)
- func AppendLifecycleEnv(in []core.EnvVar) []core.EnvVar
- func AppendTLSKeyfileSecretPostfix(name string) string
- func ArangodInitContainer(name, id, engine, executable, operatorImage string, requireUUID bool, ...) core.Container
- func ArangodVolumeMount() core.VolumeMount
- func ArangodWaiterInitContainer(name, deploymentName, executable, operatorImage string, isSecured bool, ...) core.Container
- func AreContainersReady(pod *core.Pod, coreContainers utils.StringList) bool
- func ClientAuthCACertificateVolumeMount() core.VolumeMount
- func ClusterJWTVolumeMount() core.VolumeMount
- func ContainerStopTime(container core.ContainerStatus) time.Time
- func ContainersRecentStopTime(containers []core.ContainerStatus) time.Time
- func ConvertImageID2Image(imageID string) string
- func CreateAffinity(deploymentName, role string, required bool, affinityWithRole string) *core.Affinity
- func CreateAgentLeaderServiceName(deploymentName string) string
- func CreateBasicAuthSecret(ctx context.Context, secrets secretv1.ModInterface, ...) error
- func CreateCASecret(ctx context.Context, secrets secretv1.ModInterface, secretName string, ...) error
- func CreateDatabaseClientService(ctx context.Context, svcs servicev1.ModInterface, deployment meta.Object, ...) (string, bool, error)
- func CreateDatabaseClientServiceDNSName(deployment meta.Object) string
- func CreateDatabaseClientServiceDNSNameWithDomain(deployment meta.Object, domain *string) string
- func CreateDatabaseClientServiceName(deploymentName string) string
- func CreateDatabaseExternalAccessServiceName(deploymentName string) string
- func CreateEncryptionKeySecret(secrets secretv1.ModInterface, secretName string, key []byte) error
- func CreateEnvFieldPath(name, fieldPath string) core.EnvVar
- func CreateEnvSecretKeySelector(name, SecretKeyName, secretKey string) core.EnvVar
- func CreateExporterClientServiceName(deploymentName string) string
- func CreateExporterService(ctx context.Context, cachedStatus inspector.Inspector, deployment meta.Object, ...) (string, bool, error)
- func CreateExternalAccessService(ctx context.Context, svcs servicev1.ModInterface, svcName string, ...) (string, bool, error)
- func CreateHeadlessService(ctx context.Context, svcs servicev1.ModInterface, deployment meta.Object, ...) (string, bool, error)
- func CreateHeadlessServiceName(deploymentName string) string
- func CreateJWTFromSecret(ctx context.Context, cachedSecrets secretv1.ReadInterface, ...) error
- func CreateJWTTokenFromSecret(secret string, claims map[string]interface{}) (string, error)
- func CreatePersistentVolumeClaim(ctx context.Context, pvcs persistentvolumeclaimv1.ModInterface, ...) error
- func CreatePod(ctx context.Context, c podv1.ModInterface, pod *core.Pod, ns string, ...) (string, types.UID, error)
- func CreatePodDNSName(deployment meta.Object, role, id string) string
- func CreatePodDNSNameWithDomain(deployment meta.Object, domain *string, role, id string) string
- func CreatePodName(deploymentName, role, id, suffix string) string
- func CreateServiceDNSName(svc *core.Service) string
- func CreateServiceDNSNameWithDomain(svc *core.Service, domain *string) string
- func CreateServiceURL(svc core.Service, scheme string, portPredicate func(core.ServicePort) bool, ...) (string, error)
- func CreateSyncMasterClientServiceDNSName(deployment meta.Object) string
- func CreateSyncMasterClientServiceDNSNameWithDomain(deployment meta.Object, domain *string) string
- func CreateSyncMasterClientServiceName(deploymentName string) string
- func CreateTLSKeyfileSecret(ctx context.Context, secrets secretv1.ModInterface, secretName string, ...) error
- func CreateTLSKeyfileSecretName(deploymentName, role, id string) string
- func CreateTokenSecret(ctx context.Context, secrets secretv1.ModInterface, secretName, token string, ...) error
- func CreateVolumeEmptyDir(name string) core.Volume
- func CreateVolumeWithPersitantVolumeClaim(name, claimName string) core.Volume
- func CreateVolumeWithSecret(name, secretName string) core.Volume
- func DatabaseClientDetails(deploymentName string, role string, withLeader bool) ([]core.ServicePort, map[string]string)
- func DeploymentListOpt(deploymentName string) meta.ListOptions
- func EnsureFinalizerAbsent(ctx context.Context, pods podv1.Interface, pod *core.Pod, finalizers ...string) error
- func EnsureFinalizerPresent(ctx context.Context, pods podv1.Interface, pod *core.Pod, finalizers ...string) error
- func EnsureFinalizers(in meta.Object, exists []string, missing []string) bool
- func EnvExists(a []core.EnvVar, name string) bool
- func ExporterJWTVolumeMount() core.VolumeMount
- func ExporterServiceDetails(deploymentName string) ([]core.ServicePort, map[string]string)
- func ExternalAccessDetails(port, nodePort int, deploymentName, role string, withLeader bool) ([]core.ServicePort, map[string]string)
- func ExtractPodResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
- func ExtractStorageResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
- func GetAnyContainerByName(containers []core.Container, name string) (core.Container, bool)
- func GetAnyContainerStatusByName(containers []core.ContainerStatus, name string) (core.ContainerStatus, bool)
- func GetAnyVolumeByName(volumes []core.Volume, name string) (core.Volume, bool)
- func GetAnyVolumeMountByName(volumes []core.VolumeMount, name string) (core.VolumeMount, bool)
- func GetArangoDBImageIDFromPod(pod *core.Pod) (string, error)
- func GetBasicAuthSecret(secrets secretv1.Interface, secretName string) (string, string, error)
- func GetCACertficateSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) (string, error)
- func GetCAFromSecret(s *core.Secret, ownerRef *meta.OwnerReference) (string, string, bool, error)
- func GetCASecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string, ...) (string, string, bool, error)
- func GetContainerByName(p *core.Pod, name string) (core.Container, bool)
- func GetContainerStatusByName(p *core.Pod, name string) (core.ContainerStatus, bool)
- func GetFailedContainerNames(containers []core.ContainerStatus) []string
- func GetFinalizers(spec api.ServerGroupSpec, group api.ServerGroup) []string
- func GetLifecycleEnv() []core.EnvVar
- func GetPodByName(pods []core.Pod, podName string) (core.Pod, bool)
- func GetPodOwner(kubecli kubernetes.Interface, pod *core.Pod, ns string) (*apps.ReplicaSet, error)
- func GetPodSpecChecksum(podSpec core.PodSpec) (string, error)
- func GetReplicaSetOwner(kubecli kubernetes.Interface, rSet *apps.ReplicaSet, ns string) (*apps.Deployment, error)
- func GetSecretAuthCredentials(secret *core.Secret) (string, string, error)
- func GetTLSKeyfileFromSecret(s *core.Secret) (string, error)
- func GetTLSKeyfileSecret(secrets secretv1.ReadInterface, secretName string) (string, error)
- func GetTokenFromSecret(s *core.Secret) (string, error)
- func GetTokenSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) (string, error)
- func HeadlessServiceDetails(deploymentName string) ([]core.ServicePort, map[string]string)
- func InitLifecycleContainer(image string, resources *core.ResourceRequirements, ...) (core.Container, error)
- func IsAnyContainerAlive(containers []core.ContainerStatus) bool
- func IsContainerAlive(container core.ContainerStatus) bool
- func IsContainerFailed(container *core.ContainerStatus) bool
- func IsContainerRunning(pod *core.Pod, name string) bool
- func IsContainerStarted(pod *core.Pod, container string) bool
- func IsPersistentVolumeClaimFileSystemResizePending(pvc *core.PersistentVolumeClaim) bool
- func IsPersistentVolumeClaimMarkedForDeletion(pvc *core.PersistentVolumeClaim) bool
- func IsPodAlive(pod *core.Pod) bool
- func IsPodFailed(pod *core.Pod, coreContainers utils.StringList) bool
- func IsPodMarkedForDeletion(pod *core.Pod) bool
- func IsPodNotScheduledFor(pod *core.Pod, timeout time.Duration) bool
- func IsPodReady(pod *core.Pod) bool
- func IsPodScheduled(pod *core.Pod) bool
- func IsPodServerContainerRunning(pod *core.Pod) bool
- func IsPodSucceeded(pod *core.Pod, coreContainers utils.StringList) bool
- func IsPodTerminating(pod *core.Pod) bool
- func IsResourceRequirementsChanged(wanted, given core.ResourceRequirements) bool
- func IsServiceRotationRequired(spec api.DeploymentSpec, svc *core.Service) bool
- func LabelsForActiveMember(deploymentName, role, id string) map[string]string
- func LabelsForDeployment(deploymentName, role string) map[string]string
- func LabelsForExporterService(deploymentName string) map[string]string
- func LabelsForExporterServiceSelector(deploymentName string) map[string]string
- func LabelsForLeaderMember(deploymentName, role, id string) map[string]string
- func LabelsForLocalStorage(localStorageName, role string) map[string]string
- func LabelsForMember(deploymentName, role, id string) map[string]string
- func LifecycleBinary() string
- func LifecycleVolume() core.Volume
- func LifecycleVolumeMount() core.VolumeMount
- func LocalStorageListOpt(localStorageName, role string) meta.ListOptions
- func MasterJWTVolumeMount() core.VolumeMount
- func NewContainer(containerCreator interfaces.ContainerCreator) (core.Container, error)
- func NewLifecycle(t string) (*core.Lifecycle, error)
- func NewLifecycleFinalizers() (*core.Lifecycle, error)
- func NewLifecyclePort() (*core.Lifecycle, error)
- func NewPod(deploymentName, role, id, podName string, podCreator interfaces.PodCreator) core.Pod
- func NewTime(t meta.Time) *meta.Time
- func PatchStorageClassIsDefault(cli storagev1.StorageV1Interface, name string, isDefault bool) error
- func PodStopTime(pod *core.Pod) time.Time
- func RemoveFinalizers(finalizers []string, getFunc func() (meta.Object, error), ...) (int, error)
- func RemoveOwnerRefToObjectIfNeeded(obj meta.Object, ownerRef *meta.OwnerReference) bool
- func RemovePVCFinalizers(ctx context.Context, cachedStatus persistentvolumeclaim.Inspector, ...) (int, error)
- func RemovePodFinalizers(ctx context.Context, cachedStatus pod.Inspector, c podv1.ModInterface, ...) (int, error)
- func RocksdbEncryptionReadOnlyVolumeMount() core.VolumeMount
- func RocksdbEncryptionVolumeMount() core.VolumeMount
- func SetBinaryPath(path string)
- func SetFinalizers(ctx context.Context, pods podv1.Interface, pod *core.Pod, finalizers ...string) error
- func StorageClassIsDefault(sc *storage.StorageClass) bool
- func TlsKeyfileVolumeMount() core.VolumeMount
- func UpdateOwnerRefToObjectIfNeeded(obj meta.Object, ownerRef *meta.OwnerReference) bool
- func ValidateCACertificateSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) error
- func ValidateEncryptionKeyFromSecret(s *core.Secret) error
- func ValidateEncryptionKeySecret(secrets secretv1.Interface, secretName string) error
- func ValidateTokenFromSecret(s *core.Secret) error
- func ValidateTokenSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) error
- func VolumeMountExists(vm []core.VolumeMount, name string) bool
- func WaitForInformers(stop <-chan struct{}, timeout time.Duration, informers ...Informer)
- type APIObject
- type Event
- func NewAccessPackageCreatedEvent(apiObject APIObject, apSecretName string) *Event
- func NewAccessPackageDeletedEvent(apiObject APIObject, apSecretName string) *Event
- func NewCannotChangeStorageClassEvent(apiObject APIObject, memberID, role, subReason string) *Event
- func NewCannotSetArchitectureEvent(apiObject runtime.Object, arch, memberId string) *Event
- func NewCannotShrinkVolumeEvent(apiObject APIObject, pvcname string) *Event
- func NewDowntimeNotAllowedEvent(apiObject APIObject, operation string) *Event
- func NewErrorEvent(reason string, err error, apiObject APIObject) *Event
- func NewImmutableFieldEvent(fieldName string, apiObject APIObject) *Event
- func NewMemberAddEvent(memberName, role string, apiObject APIObject) *Event
- func NewMemberRemoveEvent(memberName, role string, apiObject APIObject) *Event
- func NewOperatorEngineOpsAlertEvent(reason string, apiObject APIObject) *Event
- func NewPVCResizedEvent(apiObject APIObject, pvcname string) *Event
- func NewPlanAbortedEvent(apiObject APIObject, itemType, memberID, role string) *Event
- func NewPlanAppendEvent(apiObject APIObject, itemType, memberID, role, reason string) *Event
- func NewPlanTimeoutEvent(apiObject APIObject, itemType, memberID, role string) *Event
- func NewPodCreatedEvent(podName, role string, apiObject APIObject) *Event
- func NewPodGoneEvent(podName, role string, apiObject APIObject) *Event
- func NewPodsSchedulingFailureEvent(unscheduledPodNames []string, apiObject APIObject) *Event
- func NewPodsSchedulingResolvedEvent(apiObject APIObject) *Event
- func NewSecretsChangedEvent(changedSecretNames []string, apiObject APIObject) *Event
- func NewSecretsRestoredEvent(apiObject APIObject) *Event
- func NewUpgradeNotAllowedEvent(apiObject APIObject, fromVersion, toVersion driver.Version, ...) *Event
- type Informer
- type License
- type LicenseSecret
- type ListAPI
- type ListContinue
- type OptionPair
- type OptionPairs
- func (o *OptionPairs) Add(key string, value interface{})
- func (o *OptionPairs) Addf(key, format string, i ...interface{})
- func (o *OptionPairs) Append(pairs ...OptionPair)
- func (o OptionPairs) AsArgs() []string
- func (o OptionPairs) Copy() OptionPairs
- func (o *OptionPairs) Merge(pairs ...OptionPairs)
- func (o OptionPairs) Sort() OptionPairs
- func (o OptionPairs) Unique() OptionPairs
- type Reconcile
- type ResourceWatcher
Constants ¶
const ( ServerContainerConditionContainersNotReady = "ContainersNotReady" ServerContainerConditionPrefix = "containers with unready status: " )
const ( // LabelKeyArangoDeployment is the key of the label used to store the ArangoDeployment name in LabelKeyArangoDeployment = "arango_deployment" // LabelKeyArangoLocalStorage is the key of the label used to store the ArangoLocalStorage name in LabelKeyArangoLocalStorage = "arango_local_storage" // LabelKeyApp is the key of the label used to store the application name in (fixed to AppName) LabelKeyApp = "app" // LabelKeyRole is the key of the label used to store the role of the resource in LabelKeyRole = "role" // LabelKeyArangoExporter is the key of the label used to indicate that an exporter is present LabelKeyArangoExporter = "arango_exporter" // LabelKeyArangoMember is the key of the label used to store the ArangoDeployment member ID in LabelKeyArangoMember = "deployment.arangodb.com/member" // LabelKeyArangoZone is the key of the label used to store the ArangoDeployment zone ID in LabelKeyArangoZone = "deployment.arangodb.com/zone" // LabelKeyArangoScheduled is the key of the label used to define that member is already scheduled LabelKeyArangoScheduled = "deployment.arangodb.com/scheduled" // LabelKeyArangoTopology is the key of the label used to store the ArangoDeployment topology ID in LabelKeyArangoTopology = "deployment.arangodb.com/topology" // LabelKeyArangoLeader is the key of the label used to store the current leader of a group instances. LabelKeyArangoLeader = "deployment.arangodb.com/leader" // LabelKeyArangoActive is the key of the label used to mark members as active. LabelKeyArangoActive = "deployment.arangodb.com/active" // LabelValueArangoActive is the value of the label used to mark members as active. LabelValueArangoActive = "true" // AppName is the fixed value for the "app" label AppName = "arangodb" )
const (
LifecycleVolumeMountDir = "/lifecycle/tools"
)
Variables ¶
This section is empty.
Functions ¶
func APIList ¶
func APIList[T ListContinue](ctx context.Context, api ListAPI[T], opts meta.ListOptions, parser func(result T, err error) error) error
func AddOwnerRefToObject ¶
func AddOwnerRefToObject(obj meta.Object, ownerRef *meta.OwnerReference)
AddOwnerRefToObject adds given owner reference to given object
func AppendTLSKeyfileSecretPostfix ¶
AppendTLSKeyfileSecretPostfix returns the name of the Secret extended with TLS keyfile postfix.
func ArangodInitContainer ¶
func ArangodInitContainer(name, id, engine, executable, operatorImage string, requireUUID bool, securityContext *core.SecurityContext) core.Container
ArangodInitContainer creates a container configured to initialize a UUID file.
func ArangodVolumeMount ¶
func ArangodVolumeMount() core.VolumeMount
ArangodVolumeMount creates a volume mount structure for arangod.
func ArangodWaiterInitContainer ¶
func ArangodWaiterInitContainer(name, deploymentName, executable, operatorImage string, isSecured bool, securityContext *core.SecurityContext) core.Container
ArangodWaiterInitContainer creates a container configured to wait for specific ArangoDeployment to be ready
func AreContainersReady ¶
func AreContainersReady(pod *core.Pod, coreContainers utils.StringList) bool
AreContainersReady checks whether Pod is considered as ready. Returns true if the PodReady condition on the given pod is set to true, or all provided containers' names are running and are not in the list of failed containers.
func ClientAuthCACertificateVolumeMount ¶
func ClientAuthCACertificateVolumeMount() core.VolumeMount
ClientAuthCACertificateVolumeMount creates a volume mount structure for a client-auth CA certificate (ca.crt).
func ClusterJWTVolumeMount ¶
func ClusterJWTVolumeMount() core.VolumeMount
ClusterJWTVolumeMount creates a volume mount structure for a cluster JWT secret (token).
func ContainerStopTime ¶
func ContainerStopTime(container core.ContainerStatus) time.Time
ContainerStopTime returns time of the Container stop. If container is running, time.Zero is returned
func ContainersRecentStopTime ¶
func ContainersRecentStopTime(containers []core.ContainerStatus) time.Time
ContainersRecentStopTime returns most recent termination time of pods
func ConvertImageID2Image ¶
ConvertImageID2Image converts a ImageID from a ContainerStatus to an Image that can be used in a Container specification.
func CreateAffinity ¶
func CreateAffinity(deploymentName, role string, required bool, affinityWithRole string) *core.Affinity
CreateAffinity creates pod anti-affinity for the given role. role contains the name of the role to configure any-affinity with. affinityWithRole contains the role to configure affinity with.
func CreateAgentLeaderServiceName ¶
CreateAgentLeaderServiceName returns the name of the service used to access a leader agent.
func CreateBasicAuthSecret ¶
func CreateBasicAuthSecret(ctx context.Context, secrets secretv1.ModInterface, secretName, username, password string, ownerRef *meta.OwnerReference) error
CreateBasicAuthSecret creates a secret with given name in given namespace with a given username and password as value.
func CreateCASecret ¶
func CreateCASecret(ctx context.Context, secrets secretv1.ModInterface, secretName string, certificate, key string, ownerRef *meta.OwnerReference) error
CreateCASecret creates a secret used to store a PEM encoded CA certificate & private key.
func CreateDatabaseClientService ¶
func CreateDatabaseClientService(ctx context.Context, svcs servicev1.ModInterface, deployment meta.Object, ports []core.ServicePort, selectors map[string]string, owner meta.OwnerReference) (string, bool, error)
CreateDatabaseClientService prepares and creates a service in k8s, used by database clients within the k8s cluster. If the service already exists, nil is returned. If another error occurs, that error is returned. The returned bool is true if the service is created, or false when the service already existed.
func CreateDatabaseClientServiceDNSName ¶
CreateDatabaseClientServiceDNSName returns the DNS of the database client service.
func CreateDatabaseClientServiceDNSNameWithDomain ¶
CreateDatabaseClientServiceDNSNameWithDomain returns the DNS of the database client service.
func CreateDatabaseClientServiceName ¶
CreateDatabaseClientServiceName returns the name of the service used by database clients for the given deployment name.
func CreateDatabaseExternalAccessServiceName ¶
CreateDatabaseExternalAccessServiceName returns the name of the service used to access the database from output the kubernetes cluster.
func CreateEncryptionKeySecret ¶
func CreateEncryptionKeySecret(secrets secretv1.ModInterface, secretName string, key []byte) error
CreateEncryptionKeySecret creates a secret used to store a RocksDB encryption key.
func CreateEnvFieldPath ¶
func CreateExporterClientServiceName ¶
CreateExporterClientServiceName returns the name of the service used by arangodb-exporter clients for the given deployment name.
func CreateExporterService ¶
func CreateExporterService(ctx context.Context, cachedStatus inspector.Inspector, deployment meta.Object, ports []core.ServicePort, selectors map[string]string, owner meta.OwnerReference) (string, bool, error)
CreateExporterService
func CreateExternalAccessService ¶
func CreateExternalAccessService(ctx context.Context, svcs servicev1.ModInterface, svcName string, serviceType core.ServiceType, ports []core.ServicePort, selectors map[string]string, loadBalancerIP string, loadBalancerSourceRanges []string, owner meta.OwnerReference) (string, bool, error)
CreateExternalAccessService prepares and creates a service in k8s, used to access the database/sync from outside k8s cluster. If the service already exists, nil is returned. If another error occurs, that error is returned. The returned bool is true if the service is created, or false when the service already existed.
func CreateHeadlessService ¶
func CreateHeadlessService(ctx context.Context, svcs servicev1.ModInterface, deployment meta.Object, ports []core.ServicePort, selectors map[string]string, owner meta.OwnerReference) (string, bool, error)
CreateHeadlessService prepares and creates a headless service in k8s, used to provide a stable DNS name for all pods. If the service already exists, nil is returned. If another error occurs, that error is returned. The returned bool is true if the service is created, or false when the service already existed.
func CreateHeadlessServiceName ¶
CreateHeadlessServiceName returns the name of the headless service for the given deployment name.
func CreateJWTFromSecret ¶
func CreateJWTFromSecret(ctx context.Context, cachedSecrets secretv1.ReadInterface, secrets secretv1.ModInterface, tokenSecretName, secretSecretName string, claims map[string]interface{}, ownerRef *meta.OwnerReference) error
CreateJWTFromSecret creates a JWT using the secret stored in secretSecretName and stores the result in a new secret called tokenSecretName
func CreateJWTTokenFromSecret ¶
CreateJWTTokenFromSecret creates a JWT token
func CreatePersistentVolumeClaim ¶
func CreatePersistentVolumeClaim(ctx context.Context, pvcs persistentvolumeclaimv1.ModInterface, pvcName, deploymentName, storageClassName, role string, enforceAntiAffinity bool, resources core.ResourceRequirements, vct *core.PersistentVolumeClaim, finalizers []string, owner meta.OwnerReference) error
CreatePersistentVolumeClaim creates a persistent volume claim with given name and configuration. If the pvc already exists, nil is returned. If another error occurs, that error is returned.
func CreatePod ¶
func CreatePod(ctx context.Context, c podv1.ModInterface, pod *core.Pod, ns string, owner meta.OwnerReference) (string, types.UID, error)
CreatePod adds an owner to the given pod and calls the k8s api-server to created it. If the pod already exists, nil is returned. If another error occurs, that error is returned.
func CreatePodDNSName ¶
CreatePodDNSName returns the DNS of a pod with a given role & id in a given deployment.
func CreatePodDNSNameWithDomain ¶
CreatePodDNSName returns the DNS of a pod with a given role & id in a given deployment.
func CreatePodName ¶
CreatePodName returns the name of the pod for a member with a given id in a deployment with a given name.
func CreateServiceDNSName ¶
CreateServiceDNSName returns the DNS of a service.
func CreateServiceDNSNameWithDomain ¶
CreateServiceDNSNameWithDomain returns the DNS of a service extended with domain.
func CreateServiceURL ¶
func CreateServiceURL(svc core.Service, scheme string, portPredicate func(core.ServicePort) bool, nodeFetcher func() ([]*core.Node, error)) (string, error)
CreateServiceURL creates a URL used to reach the given service.
func CreateSyncMasterClientServiceDNSName ¶
CreateSyncMasterClientServiceDNSName returns the DNS of the syncmaster client service.
func CreateSyncMasterClientServiceDNSNameWithDomain ¶
CreateSyncMasterClientServiceDNSNameWithDomain returns the DNS of the syncmaster client service.
func CreateSyncMasterClientServiceName ¶
CreateSyncMasterClientServiceName returns the name of the service used by syncmaster clients for the given deployment name.
func CreateTLSKeyfileSecret ¶
func CreateTLSKeyfileSecret(ctx context.Context, secrets secretv1.ModInterface, secretName string, keyfile string, ownerRef *meta.OwnerReference) error
CreateTLSKeyfileSecret creates a secret used to store a PEM encoded keyfile in the format ArangoDB accepts it for its `--ssl.keyfile` option.
func CreateTLSKeyfileSecretName ¶
CreateTLSKeyfileSecretName returns the name of the Secret that holds the TLS keyfile for a member with a given id in a deployment with a given name.
func CreateTokenSecret ¶
func CreateTokenSecret(ctx context.Context, secrets secretv1.ModInterface, secretName, token string, ownerRef *meta.OwnerReference) error
CreateTokenSecret creates a secret with given name in given namespace with a given token as value.
func CreateVolumeEmptyDir ¶
func CreateVolumeWithSecret ¶
func DatabaseClientDetails ¶
func DeploymentListOpt ¶
func DeploymentListOpt(deploymentName string) meta.ListOptions
DeploymentListOpt creates a ListOptions matching all labels for the given deployment name.
func EnsureFinalizerAbsent ¶
func EnsureFinalizerPresent ¶
func EnsureFinalizers ¶
func ExporterJWTVolumeMount ¶
func ExporterJWTVolumeMount() core.VolumeMount
func ExporterServiceDetails ¶
func ExporterServiceDetails(deploymentName string) ([]core.ServicePort, map[string]string)
func ExternalAccessDetails ¶
func ExtractPodResourceRequirement ¶
func ExtractPodResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
ExtractPodResourceRequirement filters resource requirements for Pods.
func ExtractStorageResourceRequirement ¶
func ExtractStorageResourceRequirement(resources core.ResourceRequirements) core.ResourceRequirements
ExtractStorageResourceRequirement filters resource requirements for Pods.
func GetAnyContainerByName ¶
GetAnyContainerByName returns the container in the given containers with the given name. Returns false if not found.
func GetAnyContainerStatusByName ¶
func GetAnyContainerStatusByName(containers []core.ContainerStatus, name string) (core.ContainerStatus, bool)
GetAnyContainerStatusByName returns the container status in the given ContainerStatus list with the given name. Returns false if not found.
func GetAnyVolumeByName ¶
GetAnyVolumeByName returns the volume in the given volumes with the given name. Returns false if not found.
func GetAnyVolumeMountByName ¶
func GetAnyVolumeMountByName(volumes []core.VolumeMount, name string) (core.VolumeMount, bool)
GetAnyVolumeMountByName returns the volumemount in the given volumemountss with the given name. Returns false if not found.
func GetArangoDBImageIDFromPod ¶
GetArangoDBImageIDFromPod returns the ArangoDB specific image from a pod
func GetBasicAuthSecret ¶
GetBasicAuthSecret loads a secret with given name in the given namespace and extracts the `username` & `password` field. If the secret does not exists or one of the fields is missing, an error is returned. Returns: username, password, error
func GetCACertficateSecret ¶
func GetCACertficateSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) (string, error)
GetCACertficateSecret loads a secret with given name in the given namespace and extracts the `ca.crt` field. If the secret does not exists the field is missing, an error is returned. Returns: certificate, error
func GetCAFromSecret ¶
func GetCASecret ¶
func GetCASecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string, ownerRef *meta.OwnerReference) (string, string, bool, error)
GetCASecret loads a secret with given name in the given namespace and extracts the `ca.crt` & `ca.key` field. If the secret does not exists or one of the fields is missing, an error is returned. Returns: certificate, private-key, isOwnedByDeployment, error
func GetContainerByName ¶
GetContainerByName returns the container in the given pod with the given name. Returns false if not found.
func GetContainerStatusByName ¶
GetContainerStatusByName returns the container status in the given pod with the given name. Returns false if not found.
func GetFailedContainerNames ¶
func GetFailedContainerNames(containers []core.ContainerStatus) []string
GetFailedContainerNames returns list of failed containers from provided list of statuses.
func GetFinalizers ¶
func GetFinalizers(spec api.ServerGroupSpec, group api.ServerGroup) []string
func GetLifecycleEnv ¶
func GetPodByName ¶
GetPodByName returns pod if it exists among the pods' list Returns false if not found.
func GetPodOwner ¶
func GetPodOwner(kubecli kubernetes.Interface, pod *core.Pod, ns string) (*apps.ReplicaSet, error)
GetPodOwner returns the ReplicaSet that owns the given Pod. If the Pod has no owner of the owner is not a ReplicaSet, nil is returned.
func GetPodSpecChecksum ¶
GetPodSpecChecksum return checksum of requested pod spec based on deployment and group spec
func GetReplicaSetOwner ¶
func GetReplicaSetOwner(kubecli kubernetes.Interface, rSet *apps.ReplicaSet, ns string) (*apps.Deployment, error)
GetReplicaSetOwner returns the Deployment that owns the given ReplicaSet. If the ReplicaSet has no owner of the owner is not a Deployment, nil is returned.
func GetSecretAuthCredentials ¶
GetSecretAuthCredentials returns username and password from the secret
func GetTLSKeyfileSecret ¶
func GetTLSKeyfileSecret(secrets secretv1.ReadInterface, secretName string) (string, error)
GetTLSKeyfileSecret loads a secret used to store a PEM encoded keyfile in the format ArangoDB accepts it for its `--ssl.keyfile` option. Returns: keyfile (pem encoded), error
func GetTokenFromSecret ¶
GetTokenFromSecret loads the token secret from a Secret with given name.
func GetTokenSecret ¶
func GetTokenSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) (string, error)
GetTokenSecret loads the token secret from a Secret with given name.
func HeadlessServiceDetails ¶
func HeadlessServiceDetails(deploymentName string) ([]core.ServicePort, map[string]string)
func InitLifecycleContainer ¶
func InitLifecycleContainer(image string, resources *core.ResourceRequirements, securityContext *core.SecurityContext) (core.Container, error)
InitLifecycleContainer creates an init-container to copy the lifecycle binary to a shared volume.
func IsAnyContainerAlive ¶
func IsAnyContainerAlive(containers []core.ContainerStatus) bool
IsAnyContainerAlive returns true if any of the containers is running
func IsContainerAlive ¶
func IsContainerAlive(container core.ContainerStatus) bool
IsContainerAlive returns true if container is running
func IsContainerFailed ¶
func IsContainerFailed(container *core.ContainerStatus) bool
IsContainerFailed returns true if the arangodb container has terminated wih a non-zero exit code.
func IsContainerRunning ¶
IsContainerRunning returns true if the container of the pod is still running
func IsPersistentVolumeClaimFileSystemResizePending ¶
func IsPersistentVolumeClaimFileSystemResizePending(pvc *core.PersistentVolumeClaim) bool
IsPersistentVolumeClaimFileSystemResizePending returns true if the pvc has FileSystemResizePending set to true
func IsPersistentVolumeClaimMarkedForDeletion ¶
func IsPersistentVolumeClaimMarkedForDeletion(pvc *core.PersistentVolumeClaim) bool
IsPersistentVolumeClaimMarkedForDeletion returns true if the pvc has been marked for deletion.
func IsPodAlive ¶
IsPodAlive returns true if any of the containers within pod is running
func IsPodFailed ¶
func IsPodFailed(pod *core.Pod, coreContainers utils.StringList) bool
IsPodFailed returns true when one of the core containers is terminated wih a non-zero exit code, or the whole pod has been failed.
func IsPodMarkedForDeletion ¶
IsPodMarkedForDeletion returns true if the pod has been marked for deletion.
func IsPodNotScheduledFor ¶
IsPodNotScheduledFor returns true if the pod has not been scheduled for longer than the given duration.
func IsPodReady ¶
IsPodReady returns true if the PodReady condition on the given pod is set to true.
func IsPodScheduled ¶
IsPodScheduled returns true if the pod has been scheduled.
func IsPodServerContainerRunning ¶
IsPodServerContainerRunning returns true if the arangodb container of the pod is still running
func IsPodSucceeded ¶
func IsPodSucceeded(pod *core.Pod, coreContainers utils.StringList) bool
IsPodSucceeded returns true when all core containers are terminated wih a zero exit code, or the whole pod has been succeeded.
func IsPodTerminating ¶
IsPodTerminating returns true if the pod has been marked for deletion but is still running.
func IsResourceRequirementsChanged ¶
func IsResourceRequirementsChanged(wanted, given core.ResourceRequirements) bool
IsResourceRequirementsChanged returns true if the resource requirements have changed.
func IsServiceRotationRequired ¶
func IsServiceRotationRequired(spec api.DeploymentSpec, svc *core.Service) bool
func LabelsForActiveMember ¶
LabelsForActiveMember returns a map of labels, given to active members for given deployment name and member id
func LabelsForDeployment ¶
LabelsForDeployment returns a map of labels, given to all resources for given deployment name
func LabelsForExporterService ¶
LabelsForExporterService returns a map of labels, used to select the all arangodb-exporter containers
func LabelsForExporterServiceSelector ¶
LabelsForExporterServiceSelector returns a map of labels, used to select the all arangodb-exporter containers
func LabelsForLeaderMember ¶
LabelsForLeaderMember returns a map of labels for given deployment name and member id and role and leadership.
func LabelsForLocalStorage ¶
LabelsForLocalStorage returns a map of labels, given to all resources for given local storage name
func LabelsForMember ¶
LabelsForMember returns a map of labels, given to all resources for given deployment name and member id
func LifecycleBinary ¶
func LifecycleBinary() string
func LifecycleVolume ¶
LifecycleVolume creates a volume mount structure for shared lifecycle emptyDir.
func LifecycleVolumeMount ¶
func LifecycleVolumeMount() core.VolumeMount
LifecycleVolumeMount creates a volume mount structure for shared lifecycle emptyDir.
func LocalStorageListOpt ¶
func LocalStorageListOpt(localStorageName, role string) meta.ListOptions
LocalStorageListOpt creates a ListOptions matching all labels for the given local storage name.
func MasterJWTVolumeMount ¶
func MasterJWTVolumeMount() core.VolumeMount
MasterJWTVolumeMount creates a volume mount structure for a master JWT secret (token).
func NewContainer ¶
func NewContainer(containerCreator interfaces.ContainerCreator) (core.Container, error)
NewContainer creates a container for specified creator
func NewLifecycle ¶
NewLifecycle creates a lifecycle structure with preStop handler.
func NewLifecycleFinalizers ¶
NewLifecycleFinalizers creates a lifecycle structure with preStop handler which wait for finalizers to be removed.
func NewLifecyclePort ¶
NewLifecyclePort creates a lifecycle structure with preStop handler which wait for port to be closed.
func NewPod ¶
func NewPod(deploymentName, role, id, podName string, podCreator interfaces.PodCreator) core.Pod
NewPod creates a basic Pod for given settings.
func PatchStorageClassIsDefault ¶
func PatchStorageClassIsDefault(cli storagev1.StorageV1Interface, name string, isDefault bool) error
PatchStorageClassIsDefault changes the default flag of the given storage class.
func PodStopTime ¶
PodStopTime returns time when pod has been stopped
func RemoveFinalizers ¶
func RemoveFinalizers(finalizers []string, getFunc func() (meta.Object, error), updateFunc func(meta.Object) error, ignoreNotFound bool) (int, error)
RemoveFinalizers is a helper used to remove finalizers from an object. The functions tries to get the object using the provided get function, then remove the given finalizers and update the update using the given update function. In case of an update conflict, the functions tries again.
func RemoveOwnerRefToObjectIfNeeded ¶
func RemoveOwnerRefToObjectIfNeeded(obj meta.Object, ownerRef *meta.OwnerReference) bool
RemoveOwnerRefToObjectIfNeeded removes given owner reference to given object if it exists
func RemovePVCFinalizers ¶
func RemovePVCFinalizers(ctx context.Context, cachedStatus persistentvolumeclaim.Inspector, c persistentvolumeclaimv1.ModInterface, p *core.PersistentVolumeClaim, finalizers []string, ignoreNotFound bool) (int, error)
RemovePVCFinalizers removes the given finalizers from the given PVC.
func RemovePodFinalizers ¶
func RemovePodFinalizers(ctx context.Context, cachedStatus pod.Inspector, c podv1.ModInterface, p *core.Pod, finalizers []string, ignoreNotFound bool) (int, error)
RemovePodFinalizers removes the given finalizers from the given pod.
func RocksdbEncryptionReadOnlyVolumeMount ¶
func RocksdbEncryptionReadOnlyVolumeMount() core.VolumeMount
RocksdbEncryptionReadOnlyVolumeMount creates a volume mount structure for a RocksDB encryption key.
func RocksdbEncryptionVolumeMount ¶
func RocksdbEncryptionVolumeMount() core.VolumeMount
RocksdbEncryptionVolumeMount creates a volume mount structure for a RocksDB encryption key.
func SetBinaryPath ¶
func SetBinaryPath(path string)
func SetFinalizers ¶
func StorageClassIsDefault ¶
func StorageClassIsDefault(sc *storage.StorageClass) bool
StorageClassIsDefault returns true if the given storage class is marked default, false otherwise.
func TlsKeyfileVolumeMount ¶
func TlsKeyfileVolumeMount() core.VolumeMount
TlsKeyfileVolumeMount creates a volume mount structure for a TLS keyfile.
func UpdateOwnerRefToObjectIfNeeded ¶
func UpdateOwnerRefToObjectIfNeeded(obj meta.Object, ownerRef *meta.OwnerReference) bool
UpdateOwnerRefToObjectIfNeeded add given owner reference to given object if it does not exist yet
func ValidateCACertificateSecret ¶
func ValidateCACertificateSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) error
ValidateCACertificateSecret checks that a secret with given name in given namespace exists and it contains a 'ca.crt' data field.
func ValidateEncryptionKeySecret ¶
ValidateEncryptionKeySecret checks that a secret with given name in given namespace exists and it contains a 'key' data field of exactly 32 bytes.
func ValidateTokenFromSecret ¶
func ValidateTokenSecret ¶
func ValidateTokenSecret(ctx context.Context, secrets secretv1.ReadInterface, secretName string) error
ValidateTokenSecret checks that a secret with given name in given namespace exists and it contains a 'token' data field.
func VolumeMountExists ¶
func VolumeMountExists(vm []core.VolumeMount, name string) bool
func WaitForInformers ¶
Types ¶
type APIObject ¶
type APIObject interface { runtime.Object meta.Object // AsOwner creates an OwnerReference for the given deployment AsOwner() meta.OwnerReference OwnerOf(in meta.Object) bool }
APIObject helps to abstract an object from our custom API.
type Event ¶
Event is used to create events using an EventRecorder.
func NewAccessPackageCreatedEvent ¶
NewAccessPackageCreatedEvent creates an event indicating that a secret containing an access package has been created.
func NewAccessPackageDeletedEvent ¶
NewAccessPackageDeletedEvent creates an event indicating that a secret containing an access package has been deleted.
func NewCannotChangeStorageClassEvent ¶
NewCannotChangeStorageClassEvent creates an event indicating that an item would need to use a different StorageClass, but this is not possible for the given reason.
func NewCannotSetArchitectureEvent ¶
NewCannotSetArchitectureEvent creates an even of type CannotSetArchitectureEvent.
func NewCannotShrinkVolumeEvent ¶
NewCannotShrinkVolumeEvent creates an event indicating that the user tried to shrink a PVC
func NewDowntimeNotAllowedEvent ¶
NewDowntimeNotAllowedEvent creates an event indicating that an operation cannot be executed because downtime is currently not allowed.
func NewErrorEvent ¶
NewErrorEvent creates an even of type error.
func NewImmutableFieldEvent ¶
NewImmutableFieldEvent creates an event indicating that an attempt was made to change a field that is immutable.
func NewMemberAddEvent ¶
NewMemberAddEvent creates an event indicating that a member was added.
func NewMemberRemoveEvent ¶
NewMemberRemoveEvent creates an event indicating that an existing member was removed.
func NewOperatorEngineOpsAlertEvent ¶
NewOperatorEngineOpsAlertEvent creates an even of type OperatorEngineOpsAlert.
func NewPVCResizedEvent ¶
NewPVCResizedEvent creates an event indicating that a PVC has been resized
func NewPlanAbortedEvent ¶
NewPlanAbortedEvent creates an event indicating that an item on a reconciliation plan wants to abort the entire plan.
func NewPlanAppendEvent ¶
NewPlanAppendEvent creates an event indicating that an item on a reconciliation plan has been added
func NewPlanTimeoutEvent ¶
NewPlanTimeoutEvent creates an event indicating that an item on a reconciliation plan did not finish before its deadline.
func NewPodCreatedEvent ¶
NewPodCreatedEvent creates an event indicating that a pod has been created
func NewPodGoneEvent ¶
NewPodGoneEvent creates an event indicating that a pod is missing
func NewPodsSchedulingFailureEvent ¶
NewPodsSchedulingFailureEvent creates an event indicating that one of more cannot be scheduled.
func NewPodsSchedulingResolvedEvent ¶
NewPodsSchedulingResolvedEvent creates an event indicating that an earlier problem with pod scheduling has been resolved.
func NewSecretsChangedEvent ¶
NewSecretsChangedEvent creates an event indicating that one of more secrets have changed.
func NewSecretsRestoredEvent ¶
NewSecretsRestoredEvent creates an event indicating that all secrets have been restored to their original values.
func NewUpgradeNotAllowedEvent ¶
func NewUpgradeNotAllowedEvent(apiObject APIObject, fromVersion, toVersion driver.Version, fromLicense, toLicense upgraderules.License) *Event
NewUpgradeNotAllowedEvent creates an event indicating that an upgrade (or downgrade) is not allowed.
type LicenseSecret ¶
func GetLicenseFromSecret ¶
func GetLicenseFromSecret(secret secret.Inspector, name string) (LicenseSecret, error)
type ListAPI ¶
type ListAPI[T ListContinue] interface { List(ctx context.Context, opts meta.ListOptions) (T, error) }
type ListContinue ¶
type ListContinue interface {
GetContinue() string
}
type OptionPair ¶
OptionPair key value pair builder
func ExtractStringToOptionPair ¶
func ExtractStringToOptionPair(arg string) OptionPair
ExtractStringToOptionPair extracts command line argument into the OptionPair.
func (OptionPair) CompareTo ¶
func (o OptionPair) CompareTo(other OptionPair) int
CompareTo returns -1 if o < other, 0 if o == other, 1 otherwise
func (OptionPair) String ¶
func (o OptionPair) String() string
type OptionPairs ¶
type OptionPairs []OptionPair
OptionPairs list of pair builder
func CreateOptionPairs ¶
func CreateOptionPairs(lens ...int) OptionPairs
func NewOptionPair ¶
func NewOptionPair(pairs ...OptionPair) OptionPairs
func (*OptionPairs) Add ¶
func (o *OptionPairs) Add(key string, value interface{})
func (*OptionPairs) Addf ¶
func (o *OptionPairs) Addf(key, format string, i ...interface{})
func (*OptionPairs) Append ¶
func (o *OptionPairs) Append(pairs ...OptionPair)
func (OptionPairs) AsArgs ¶
func (o OptionPairs) AsArgs() []string
func (OptionPairs) Copy ¶
func (o OptionPairs) Copy() OptionPairs
func (*OptionPairs) Merge ¶
func (o *OptionPairs) Merge(pairs ...OptionPairs)
func (OptionPairs) Sort ¶
func (o OptionPairs) Sort() OptionPairs
func (OptionPairs) Unique ¶
func (o OptionPairs) Unique() OptionPairs
type Reconcile ¶
type Reconcile interface { Reconcile(ctx context.Context) error Required() IsRequired() bool WithError(err error) error ParallelAll(items int, executor func(id int) error) error Parallel(items, max int, executor func(id int) error) error }
func NewReconcile ¶
type ResourceWatcher ¶
type ResourceWatcher struct {
// contains filtered or unexported fields
}
ResourceWatcher is a helper to watch for events in a specific type of resource. The handler functions are protected from panics.
func NewResourceWatcher ¶
func NewResourceWatcher(getter cache.Getter, resource, namespace string, objType runtime.Object, h cache.ResourceEventHandlerFuncs) *ResourceWatcher
NewResourceWatcher creates a helper that watches for changes in a resource of a specific type. If wraps the given handler functions, such that panics are caught and logged.
func (*ResourceWatcher) Run ¶
func (rw *ResourceWatcher) Run(stopCh <-chan struct{})
Run continues to watch for events on the selected type of resource until the given channel is closed.