Documentation ¶
Index ¶
- Constants
- func AddTolerationIfNotFound(source []v1.Toleration, toAdd v1.Toleration) []v1.Toleration
- func ConvertImageID2Image(imageID string) string
- func CreateArangoSyncPod(kubecli kubernetes.Interface, developmentMode bool, deployment APIObject, ...) error
- func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deployment APIObject, ...) error
- func CreateCASecret(secrets SecretInterface, secretName string, certificate, key string, ...) error
- func CreateDatabaseClientService(svcs ServiceInterface, deployment metav1.Object, single bool, ...) (string, bool, error)
- func CreateDatabaseClientServiceDNSName(deployment metav1.Object) string
- func CreateDatabaseClientServiceName(deploymentName string) string
- func CreateDatabaseExternalAccessServiceName(deploymentName string) string
- func CreateEncryptionKeySecret(secrets SecretInterface, secretName string, key []byte) error
- func CreateExternalAccessService(svcs ServiceInterface, svcName, role string, deployment metav1.Object, ...) (string, bool, error)
- func CreateHeadlessService(svcs ServiceInterface, deployment metav1.Object, owner metav1.OwnerReference) (string, bool, error)
- func CreateHeadlessServiceName(deploymentName string) string
- func CreatePersistentVolumeClaim(pvcs PersistentVolumeClaimInterface, ...) error
- func CreatePersistentVolumeClaimName(deploymentName, role, id string) string
- func CreatePodDNSName(deployment metav1.Object, role, id string) string
- func CreatePodHostName(deploymentName, role, id string) string
- func CreatePodName(deploymentName, role, id, suffix string) string
- func CreateServiceURL(svc v1.Service, scheme string, portPredicate func(v1.ServicePort) bool, ...) (string, error)
- func CreateSyncMasterClientServiceDNSName(deployment metav1.Object) string
- func CreateSyncMasterClientServiceName(deploymentName string) string
- func CreateTLSKeyfileSecret(secrets SecretInterface, secretName string, keyfile string, ...) error
- func CreateTLSKeyfileSecretName(deploymentName, role, id string) string
- func CreateTokenSecret(secrets SecretInterface, secretName, token string, ...) error
- func DeploymentListOpt(deploymentName string) metav1.ListOptions
- func GetBasicAuthSecret(secrets SecretInterface, secretName string) (string, string, error)
- func GetCACertficateSecret(secrets SecretInterface, secretName string) (string, error)
- func GetCASecret(secrets SecretInterface, secretName string, ownerRef *metav1.OwnerReference) (string, string, bool, error)
- func GetContainerByName(p *v1.Pod, name string) (v1.Container, bool)
- func GetPodOwner(kubecli kubernetes.Interface, pod *v1.Pod, ns string) (*v1beta2.ReplicaSet, error)
- func GetReplicaSetOwner(kubecli kubernetes.Interface, rSet *v1beta2.ReplicaSet, ns string) (*v1beta2.Deployment, error)
- func GetTLSKeyfileSecret(secrets SecretInterface, secretName string) (string, error)
- func GetTokenSecret(secrets SecretInterface, secretName string) (string, error)
- func InClusterConfig() (*rest.Config, error)
- func IsAlreadyExists(err error) bool
- func IsArangoDBImageIDAndVersionPod(p v1.Pod) bool
- func IsConflict(err error) bool
- func IsNotFound(err error) bool
- func IsPersistentVolumeClaimMarkedForDeletion(pvc *v1.PersistentVolumeClaim) bool
- func IsPodFailed(pod *v1.Pod) bool
- func IsPodMarkedForDeletion(pod *v1.Pod) bool
- func IsPodNotScheduledFor(pod *v1.Pod, timeout time.Duration) bool
- func IsPodReady(pod *v1.Pod) bool
- func IsPodScheduled(pod *v1.Pod) bool
- func IsPodSucceeded(pod *v1.Pod) bool
- func IsPodTerminating(pod *v1.Pod) bool
- func LabelsForDeployment(deploymentName, role string) map[string]string
- func LabelsForLocalStorage(localStorageName, role string) map[string]string
- func LocalStorageListOpt(localStorageName, role string) metav1.ListOptions
- func NewKubeClient() (kubernetes.Interface, error)
- func NewKubeExtClient() (apiextensionsclient.Interface, error)
- func NewNoExecuteToleration(key string, duration TolerationDuration) v1.Toleration
- func PatchStorageClassIsDefault(cli storagev1.StorageV1Interface, name string, isDefault bool) error
- func RemoveFinalizers(log zerolog.Logger, finalizers []string, getFunc func() (metav1.Object, error), ...) error
- func RemovePVCFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1.PersistentVolumeClaim, ...) error
- func RemovePodFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1.Pod, ...) error
- func StorageClassIsDefault(sc *v1.StorageClass) bool
- func ValidateCACertificateSecret(secrets SecretInterface, secretName string) error
- func ValidateEncryptionKeySecret(secrets SecretInterface, secretName string) error
- func ValidateOptionalResourceName(name string) error
- func ValidateResourceName(name string) error
- func ValidateTokenSecret(secrets SecretInterface, secretName string) error
- type APIObject
- type EnvValue
- 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 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 NewPlanAbortedEvent(apiObject APIObject, itemType, memberID, role 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 HTTPProbeConfig
- type PersistentVolumeClaimInterface
- type ResourceWatcher
- type SecretInterface
- type ServiceInterface
- type TolerationDuration
Constants ¶
const ( // Arango constants ArangoPort = 8529 ArangoSyncMasterPort = 8629 ArangoSyncWorkerPort = 8729 // K8s constants ClusterIPNone = "None" TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints" TopologyKeyHostname = "kubernetes.io/hostname" // Internal constants ImageIDAndVersionRole = "id" // Role use by identification pods )
const ( InitDataContainerName = "init-data" InitLifecycleContainerName = "init-lifecycle" ServerContainerName = "server" ArangodVolumeMountDir = "/data" RocksDBEncryptionVolumeMountDir = "/secrets/rocksdb/encryption" TLSKeyfileVolumeMountDir = "/secrets/tls" LifecycleVolumeMountDir = "/lifecycle/tools" ClientAuthCAVolumeMountDir = "/secrets/client-auth/ca" ClusterJWTSecretVolumeMountDir = "/secrets/cluster/jwt" MasterJWTSecretVolumeMountDir = "/secrets/master/jwt" )
const ( TolerationKeyNodeNotReady = "node.kubernetes.io/not-ready" TolerationKeyNodeAlphaUnreachable = "node.alpha.kubernetes.io/unreachable" TolerationKeyNodeUnreachable = "node.kubernetes.io/unreachable" )
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" // AppName is the fixed value for the "app" label AppName = "arangodb" )
Variables ¶
This section is empty.
Functions ¶
func AddTolerationIfNotFound ¶
func AddTolerationIfNotFound(source []v1.Toleration, toAdd v1.Toleration) []v1.Toleration
AddTolerationIfNotFound adds the given tolerations, if no such toleration has been set in the given source.
func ConvertImageID2Image ¶
ConvertImageID2Image converts a ImageID from a ContainerStatus to an Image that can be used in a Container specification.
func CreateArangoSyncPod ¶
func CreateArangoSyncPod(kubecli kubernetes.Interface, developmentMode bool, deployment APIObject, role, id, podName, image, lifecycleImage string, imagePullPolicy v1.PullPolicy, terminationGracePeriod time.Duration, args []string, env map[string]EnvValue, livenessProbe *HTTPProbeConfig, tolerations []v1.Toleration, serviceAccountName string, tlsKeyfileSecretName, clientAuthCASecretName, masterJWTSecretName, clusterJWTSecretName, affinityWithRole string) error
CreateArangoSyncPod creates a Pod that runs `arangosync`. If the pod already exists, nil is returned. If another error occurs, that error is returned.
func CreateArangodPod ¶
func CreateArangodPod(kubecli kubernetes.Interface, developmentMode bool, deployment APIObject, role, id, podName, pvcName, image, lifecycleImage, alpineImage string, imagePullPolicy v1.PullPolicy, engine string, requireUUID bool, terminationGracePeriod time.Duration, args []string, env map[string]EnvValue, finalizers []string, livenessProbe *HTTPProbeConfig, readinessProbe *HTTPProbeConfig, tolerations []v1.Toleration, serviceAccountName string, tlsKeyfileSecretName, rocksdbEncryptionSecretName string) error
CreateArangodPod creates a Pod that runs `arangod`. If the pod already exists, nil is returned. If another error occurs, that error is returned.
func CreateCASecret ¶
func CreateCASecret(secrets SecretInterface, secretName string, certificate, key string, ownerRef *metav1.OwnerReference) error
CreateCASecret creates a secret used to store a PEM encoded CA certificate & private key.
func CreateDatabaseClientService ¶
func CreateDatabaseClientService(svcs ServiceInterface, deployment metav1.Object, single bool, owner metav1.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 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 SecretInterface, secretName string, key []byte) error
CreateEncryptionKeySecret creates a secret used to store a RocksDB encryption key.
func CreateExternalAccessService ¶
func CreateExternalAccessService(svcs ServiceInterface, svcName, role string, deployment metav1.Object, serviceType v1.ServiceType, port, nodePort int, loadBalancerIP string, owner metav1.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(svcs ServiceInterface, deployment metav1.Object, owner metav1.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 CreatePersistentVolumeClaim ¶
func CreatePersistentVolumeClaim(pvcs PersistentVolumeClaimInterface, pvcName, deploymentName, ns, storageClassName, role string, enforceAntiAffinity bool, resources v1.ResourceRequirements, finalizers []string, owner metav1.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 CreatePersistentVolumeClaimName ¶
CreatePersistentVolumeClaimName returns the name of the persistent volume claim for a member with a given id in a deployment with a given name.
func CreatePodDNSName ¶
CreatePodDNSName returns the DNS of a pod with a given role & id in a given deployment.
func CreatePodHostName ¶
CreatePodHostName returns the hostname of the pod for a member with a given id in a deployment with a given name.
func CreatePodName ¶
CreatePodName returns the name of the pod for a member with a given id in a deployment with a given name.
func CreateServiceURL ¶
func CreateServiceURL(svc v1.Service, scheme string, portPredicate func(v1.ServicePort) bool, nodeFetcher func() (v1.NodeList, 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 CreateSyncMasterClientServiceName ¶
CreateSyncMasterClientServiceName returns the name of the service used by syncmaster clients for the given deployment name.
func CreateTLSKeyfileSecret ¶
func CreateTLSKeyfileSecret(secrets SecretInterface, secretName string, keyfile string, ownerRef *metav1.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(secrets SecretInterface, secretName, token string, ownerRef *metav1.OwnerReference) error
CreateTokenSecret creates a secret with given name in given namespace with a given token as value.
func DeploymentListOpt ¶
func DeploymentListOpt(deploymentName string) metav1.ListOptions
DeploymentListOpt creates a ListOptions matching all labels for the given deployment name.
func GetBasicAuthSecret ¶
func GetBasicAuthSecret(secrets SecretInterface, secretName string) (string, string, error)
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(secrets SecretInterface, 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 GetCASecret ¶
func GetCASecret(secrets SecretInterface, secretName string, ownerRef *metav1.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 GetPodOwner ¶
func GetPodOwner(kubecli kubernetes.Interface, pod *v1.Pod, ns string) (*v1beta2.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 GetReplicaSetOwner ¶
func GetReplicaSetOwner(kubecli kubernetes.Interface, rSet *v1beta2.ReplicaSet, ns string) (*v1beta2.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 GetTLSKeyfileSecret ¶
func GetTLSKeyfileSecret(secrets SecretInterface, 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 GetTokenSecret ¶
func GetTokenSecret(secrets SecretInterface, secretName string) (string, error)
GetTokenSecret loads the token secret from a Secret with given name.
func InClusterConfig ¶
InClusterConfig loads the environment into a rest config.
func IsAlreadyExists ¶
IsAlreadyExists returns true if the given error is or is caused by a kubernetes AlreadyExistsError,
func IsArangoDBImageIDAndVersionPod ¶
IsArangoDBImageIDAndVersionPod returns true if the given pod is used for fetching image ID and ArangoDB version of an image
func IsConflict ¶
IsConflict returns true if the given error is or is caused by a kubernetes ConflictError,
func IsNotFound ¶
IsNotFound returns true if the given error is or is caused by a kubernetes NotFoundError,
func IsPersistentVolumeClaimMarkedForDeletion ¶
func IsPersistentVolumeClaimMarkedForDeletion(pvc *v1.PersistentVolumeClaim) bool
IsPersistentVolumeClaimMarkedForDeletion returns true if the pod has been marked for deletion.
func IsPodFailed ¶
IsPodFailed returns true if all containers of the pod have terminated and at least one of them wih a non-zero exit code.
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 IsPodSucceeded ¶
IsPodSucceeded returns true if all containers of the pod have terminated with exit code 0.
func IsPodTerminating ¶
IsPodTerminating returns true if the pod has been marked for deletion but is still running.
func LabelsForDeployment ¶
LabelsForDeployment returns a map of labels, given to all resources for given deployment name
func LabelsForLocalStorage ¶
LabelsForLocalStorage returns a map of labels, given to all resources for given local storage name
func LocalStorageListOpt ¶
func LocalStorageListOpt(localStorageName, role string) metav1.ListOptions
LocalStorageListOpt creates a ListOptions matching all labels for the given local storage name.
func NewKubeClient ¶
func NewKubeClient() (kubernetes.Interface, error)
NewKubeClient creates a new k8s client
func NewKubeExtClient ¶
func NewKubeExtClient() (apiextensionsclient.Interface, error)
NewKubeExtClient creates a new k8s api extensions client
func NewNoExecuteToleration ¶
func NewNoExecuteToleration(key string, duration TolerationDuration) v1.Toleration
NewNoExecuteToleration is a helper to create a Toleration with Key=key, Operator='Exists' Effect='NoExecute', TolerationSeconds=tolerationDuration.Seconds().
func PatchStorageClassIsDefault ¶
func PatchStorageClassIsDefault(cli storagev1.StorageV1Interface, name string, isDefault bool) error
PatchStorageClassIsDefault changes the default flag of the given storage class.
func RemoveFinalizers ¶
func RemoveFinalizers(log zerolog.Logger, finalizers []string, getFunc func() (metav1.Object, error), updateFunc func(metav1.Object) error, ignoreNotFound bool) 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 RemovePVCFinalizers ¶
func RemovePVCFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1.PersistentVolumeClaim, finalizers []string, ignoreNotFound bool) error
RemovePVCFinalizers removes the given finalizers from the given PVC.
func RemovePodFinalizers ¶
func RemovePodFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1.Pod, finalizers []string, ignoreNotFound bool) error
RemovePodFinalizers removes the given finalizers from the given pod.
func StorageClassIsDefault ¶
func StorageClassIsDefault(sc *v1.StorageClass) bool
StorageClassIsDefault returns true if the given storage class is marked default, false otherwise.
func ValidateCACertificateSecret ¶
func ValidateCACertificateSecret(secrets SecretInterface, 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 ¶
func ValidateEncryptionKeySecret(secrets SecretInterface, secretName string) error
ValidateEncryptionKeySecret checks that a secret with given name in given namespace exists and it contains a 'key' data field of exactly 32 bytes.
func ValidateOptionalResourceName ¶
ValidateOptionalResourceName validates a kubernetes resource name. If not empty and not valid, an error is returned.
func ValidateResourceName ¶
ValidateResourceName validates a kubernetes resource name. If not valid, an error is returned. See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
func ValidateTokenSecret ¶
func ValidateTokenSecret(secrets SecretInterface, secretName string) error
ValidateTokenSecret checks that a secret with given name in given namespace exists and it contains a 'token' data field.
Types ¶
type APIObject ¶
type APIObject interface { runtime.Object metav1.Object // AsOwner creates an OwnerReference for the given deployment AsOwner() metav1.OwnerReference }
APIObject helps to abstract an object from our custom API.
type EnvValue ¶
type EnvValue struct { Value string // If set, the environment value gets this value SecretName string // If set, the environment value gets its value from a secret with this name SecretKey string // Key inside secret to fill into the envvar. Only relevant is SecretName is set. }
EnvValue is a helper structure for environment variable sources.
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 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 NewPlanAbortedEvent ¶
NewPlanAbortedEvent creates an event indicating that an item on a reconciliation plan wants to abort the entire plan.
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 HTTPProbeConfig ¶
type HTTPProbeConfig struct { // Local path to GET LocalPath string // `e.g. /_api/version` // Secure connection? Secure bool // Value for an Authorization header (can be empty) Authorization string // Port to inspect (defaults to ArangoPort) Port int // Number of seconds after the container has started before liveness probes are initiated (defaults to 30) InitialDelaySeconds int32 // Number of seconds after which the probe times out (defaults to 2). TimeoutSeconds int32 // How often (in seconds) to perform the probe (defaults to 10). PeriodSeconds int32 // Minimum consecutive successes for the probe to be considered successful after having failed (defaults to 1). SuccessThreshold int32 // Minimum consecutive failures for the probe to be considered failed after having succeeded (defaults to 3). FailureThreshold int32 }
HTTPProbeConfig contains settings for creating a liveness/readiness probe.
func (HTTPProbeConfig) Create ¶
func (config HTTPProbeConfig) Create() *v1.Probe
Create creates a probe from given config
type PersistentVolumeClaimInterface ¶
type PersistentVolumeClaimInterface interface { Create(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) Get(name string, options metav1.GetOptions) (*v1.PersistentVolumeClaim, error) }
PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources.
func NewPersistentVolumeClaimCache ¶
func NewPersistentVolumeClaimCache(cli corev1.PersistentVolumeClaimInterface) PersistentVolumeClaimInterface
NewPersistentVolumeClaimCache creates a cached version of the given PersistentVolumeClaimInterface.
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(log zerolog.Logger, 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.
type SecretInterface ¶
type SecretInterface interface { Create(*v1.Secret) (*v1.Secret, error) Get(name string, options metav1.GetOptions) (*v1.Secret, error) }
SecretInterface has methods to work with Secret resources.
func NewSecretCache ¶
func NewSecretCache(cli corev1.SecretInterface) SecretInterface
NewSecretCache creates a cached version of the given SecretInterface.
type ServiceInterface ¶
type ServiceInterface interface { Create(*v1.Service) (*v1.Service, error) Delete(name string, options *metav1.DeleteOptions) error Get(name string, options metav1.GetOptions) (*v1.Service, error) }
ServiceInterface has methods to work with Service resources.
func NewServiceCache ¶
func NewServiceCache(cli corev1.ServiceInterface) ServiceInterface
NewServiceCache creates a cached version of the given ServiceInterface.
type TolerationDuration ¶
TolerationDuration is a duration spec for tolerations.