Documentation ¶
Overview ¶
Package kubernetes ...
Package kubernetes ...
Package kubernetes ...
Package kubernetes ...
Package kubernetes ...
Package kubernetes provides functionality for kubernetes.
Package kubernetes ...
Package kubernetes ...
Package kubernetes ...
Package kubernetes ...
Index ¶
- Variables
- func IsContainerInState(containerStatuses []corev1.ContainerStatus, state ContainerState) bool
- func IsNodeInCondition(node corev1.Node, conditionType corev1.NodeConditionType) bool
- type ClusterType
- type ContainerState
- type InstallOperatorRequest
- type Kubernetes
- func (c *Kubernetes) Accounts() accounts.Interface
- func (k *Kubernetes) ApplyManifestFile(files []byte, namespace string) error
- func (k *Kubernetes) ApproveInstallPlan(ctx context.Context, namespace, installPlanName string) (bool, error)
- func (k *Kubernetes) ClusterName() string
- func (k *Kubernetes) Config() *rest.Config
- func (k *Kubernetes) CreateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) error
- func (k *Kubernetes) CreateClusterRole(name string, rules []rbac.PolicyRule) error
- func (k *Kubernetes) CreateClusterRoleBinding(namespace, name, roleName, serviceAccountName string) error
- func (k *Kubernetes) CreateMonitoringConfig(ctx context.Context, storage *everestv1alpha1.MonitoringConfig) error
- func (k *Kubernetes) CreateNamespace(ctx context.Context, namespace *corev1.Namespace) error
- func (k *Kubernetes) CreateRSAKeyPair(ctx context.Context) error
- func (k *Kubernetes) CreateRole(namespace, name string, rules []rbac.PolicyRule) error
- func (k *Kubernetes) CreateRoleBinding(namespace, name, roleName, serviceAccountName string) error
- func (k *Kubernetes) CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)
- func (k *Kubernetes) CreateServiceAccount(name, namespace string) error
- func (k *Kubernetes) CreateServiceAccountToken(serviceAccountName, secretName, namespace string) error
- func (k *Kubernetes) DatabasesExist(ctx context.Context, namespaces ...string) (bool, error)
- func (k *Kubernetes) DeleteAllMonitoringResources(ctx context.Context, namespace string) error
- func (k *Kubernetes) DeleteBackupStorage(ctx context.Context, namespace, name string) error
- func (k *Kubernetes) DeleteBackupStorages(ctx context.Context, namespace string) error
- func (k *Kubernetes) DeleteCRD(ctx context.Context, name string) error
- func (k *Kubernetes) DeleteCatalogSource(ctx context.Context, name, namespace string) error
- func (k *Kubernetes) DeleteClusterServiceVersion(ctx context.Context, key types.NamespacedName) error
- func (k *Kubernetes) DeleteDatabaseCluster(ctx context.Context, namespace, name string) error
- func (k *Kubernetes) DeleteDatabaseClusters(ctx context.Context, namespace string) error
- func (k *Kubernetes) DeleteDeployment(ctx context.Context, name, namespace string) error
- func (k *Kubernetes) DeleteManifestFile(fileBytes []byte, namespace string) error
- func (k *Kubernetes) DeleteMonitoringConfig(ctx context.Context, namespace, name string) error
- func (k *Kubernetes) DeleteMonitoringConfigs(ctx context.Context, namespace string) error
- func (k *Kubernetes) DeleteNamespace(ctx context.Context, name string) error
- func (k *Kubernetes) DeleteSecret(ctx context.Context, namespace, name string) error
- func (k *Kubernetes) DeleteSubscription(ctx context.Context, key types.NamespacedName) error
- func (k *Kubernetes) GenerateKubeConfigWithToken(user string, secret *corev1.Secret) (string, error)
- func (k *Kubernetes) GetAllClusterResources(ctx context.Context, clusterType ClusterType, ...) (uint64, uint64, uint64, error)
- func (k *Kubernetes) GetBackupStorage(ctx context.Context, namespace, name string) (*everestv1alpha1.BackupStorage, error)
- func (k *Kubernetes) GetCatalogSource(ctx context.Context, name, namespace string) (*olmv1alpha1.CatalogSource, error)
- func (k *Kubernetes) GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*olmv1alpha1.ClusterServiceVersion, error)
- func (k *Kubernetes) GetClusterType(ctx context.Context) (ClusterType, error)
- func (k *Kubernetes) GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error)
- func (k *Kubernetes) GetConsumedCPUAndMemory(ctx context.Context, namespace string) (cpuMillis uint64, memoryBytes uint64, err error)
- func (k *Kubernetes) GetConsumedDiskBytes(_ context.Context, clusterType ClusterType, ...) (uint64, error)
- func (k *Kubernetes) GetDBNamespaces(ctx context.Context) ([]string, error)
- func (k *Kubernetes) GetDatabaseCluster(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseCluster, error)
- func (k *Kubernetes) GetDatabaseClusterBackup(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterBackup, error)
- func (k *Kubernetes) GetDatabaseClusterRestore(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterRestore, error)
- func (k *Kubernetes) GetDatabaseEngine(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseEngine, error)
- func (k *Kubernetes) GetDeployment(ctx context.Context, name, namespace string) (*appsv1.Deployment, error)
- func (k *Kubernetes) GetEverestID(ctx context.Context) (string, error)
- func (k *Kubernetes) GetEverestSettings(ctx context.Context) (common.EverestSettings, error)
- func (k *Kubernetes) GetMonitoringConfig(ctx context.Context, namespace, name string) (*everestv1alpha1.MonitoringConfig, error)
- func (k *Kubernetes) GetMonitoringConfigsBySecretName(ctx context.Context, namespace, secretName string) ([]*everestv1alpha1.MonitoringConfig, error)
- func (k *Kubernetes) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
- func (k *Kubernetes) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error)
- func (k *Kubernetes) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error)
- func (k *Kubernetes) GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error)
- func (k *Kubernetes) GetServerVersion() (*version.Info, error)
- func (k *Kubernetes) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error)
- func (k *Kubernetes) GetSubscription(ctx context.Context, name, namespace string) (*olmv1alpha1.Subscription, error)
- func (k *Kubernetes) GetWorkerNodes(ctx context.Context) ([]corev1.Node, error)
- func (k *Kubernetes) IsBackupStorageUsed(ctx context.Context, namespace, name string) (bool, error)
- func (k *Kubernetes) IsMonitoringConfigUsed(ctx context.Context, namespace, name string) (bool, error)
- func (k *Kubernetes) Kubeconfig() string
- func (k *Kubernetes) ListBackupStorages(ctx context.Context, namespace string) (*everestv1alpha1.BackupStorageList, error)
- func (k *Kubernetes) ListCRDs(ctx context.Context) (*apiextv1.CustomResourceDefinitionList, error)
- func (k *Kubernetes) ListClusterServiceVersion(ctx context.Context, namespace string) (*olmv1alpha1.ClusterServiceVersionList, error)
- func (k *Kubernetes) ListDatabaseClusterBackups(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error)
- func (k *Kubernetes) ListDatabaseClusterRestores(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error)
- func (k *Kubernetes) ListDatabaseClusters(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseClusterList, error)
- func (k *Kubernetes) ListDatabaseEngines(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseEngineList, error)
- func (k *Kubernetes) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (k *Kubernetes) ListMonitoringConfigs(ctx context.Context, namespace string) (*everestv1alpha1.MonitoringConfigList, error)
- func (k *Kubernetes) ListNamespaces(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error)
- func (k *Kubernetes) ListSecrets(ctx context.Context, namespace string) (*corev1.SecretList, error)
- func (k *Kubernetes) ListSubscriptions(ctx context.Context, namespace string) (*olmv1alpha1.SubscriptionList, error)
- func (k *Kubernetes) Namespace() string
- func (k *Kubernetes) OperatorInstalledVersion(ctx context.Context, namespace, name string) (*goversion.Version, error)
- func (k *Kubernetes) PatchDatabaseCluster(cluster *everestv1alpha1.DatabaseCluster) error
- func (k *Kubernetes) RestartDeployment(ctx context.Context, name, namespace string) error
- func (k *Kubernetes) SetDatabaseEngineLock(ctx context.Context, namespace, name string, locked bool) error
- func (k *Kubernetes) SetSecret(secret *corev1.Secret) error
- func (k *Kubernetes) UpdateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) error
- func (k *Kubernetes) UpdateDatabaseClusterBackup(ctx context.Context, backup *everestv1alpha1.DatabaseClusterBackup) (*everestv1alpha1.DatabaseClusterBackup, error)
- func (k *Kubernetes) UpdateDatabaseEngine(ctx context.Context, namespace string, engine *everestv1alpha1.DatabaseEngine) (*everestv1alpha1.DatabaseEngine, error)
- func (k *Kubernetes) UpdateDeployment(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func (k *Kubernetes) UpdateEverestSettings(ctx context.Context, settings common.EverestSettings) error
- func (k *Kubernetes) UpdateMonitoringConfig(ctx context.Context, storage *everestv1alpha1.MonitoringConfig) error
- func (k *Kubernetes) UpdateNamespace(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error)
- func (k *Kubernetes) UpdateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)
- func (k *Kubernetes) WaitForRollout(ctx context.Context, name, namespace string) error
- func (k *Kubernetes) WithClient(c client.KubeClientConnector) *Kubernetes
- type KubernetesConnector
- type MockKubernetesConnector
- func (_m *MockKubernetesConnector) Accounts() accounts.Interface
- func (_m *MockKubernetesConnector) ApplyManifestFile(files []byte, namespace string) error
- func (_m *MockKubernetesConnector) ApproveInstallPlan(ctx context.Context, namespace string, installPlanName string) (bool, error)
- func (_m *MockKubernetesConnector) ClusterName() string
- func (_m *MockKubernetesConnector) Config() *rest.Config
- func (_m *MockKubernetesConnector) CreateBackupStorage(ctx context.Context, storage *v1alpha1.BackupStorage) error
- func (_m *MockKubernetesConnector) CreateMonitoringConfig(ctx context.Context, storage *v1alpha1.MonitoringConfig) error
- func (_m *MockKubernetesConnector) CreateNamespace(ctx context.Context, namespace *v1.Namespace) error
- func (_m *MockKubernetesConnector) CreateRSAKeyPair(ctx context.Context) error
- func (_m *MockKubernetesConnector) CreateSecret(ctx context.Context, secret *v1.Secret) (*v1.Secret, error)
- func (_m *MockKubernetesConnector) DeleteBackupStorage(ctx context.Context, namespace string, name string) error
- func (_m *MockKubernetesConnector) DeleteBackupStorages(ctx context.Context, namespace string) error
- func (_m *MockKubernetesConnector) DeleteCRD(ctx context.Context, name string) error
- func (_m *MockKubernetesConnector) DeleteCatalogSource(ctx context.Context, name string, namespace string) error
- func (_m *MockKubernetesConnector) DeleteClusterServiceVersion(ctx context.Context, key types.NamespacedName) error
- func (_m *MockKubernetesConnector) DeleteDeployment(ctx context.Context, name string, namespace string) error
- func (_m *MockKubernetesConnector) DeleteManifestFile(fileBytes []byte, namespace string) error
- func (_m *MockKubernetesConnector) DeleteMonitoringConfig(ctx context.Context, namespace string, name string) error
- func (_m *MockKubernetesConnector) DeleteMonitoringConfigs(ctx context.Context, namespace string) error
- func (_m *MockKubernetesConnector) DeleteNamespace(ctx context.Context, name string) error
- func (_m *MockKubernetesConnector) DeleteSecret(ctx context.Context, namespace string, name string) error
- func (_m *MockKubernetesConnector) DeleteSubscription(ctx context.Context, key types.NamespacedName) error
- func (_m *MockKubernetesConnector) GetBackupStorage(ctx context.Context, namespace string, name string) (*v1alpha1.BackupStorage, error)
- func (_m *MockKubernetesConnector) GetCatalogSource(ctx context.Context, name string, namespace string) (*operatorsv1alpha1.CatalogSource, error)
- func (_m *MockKubernetesConnector) GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*operatorsv1alpha1.ClusterServiceVersion, error)
- func (_m *MockKubernetesConnector) GetClusterType(ctx context.Context) (ClusterType, error)
- func (_m *MockKubernetesConnector) GetConfigMap(ctx context.Context, namespace string, name string) (*v1.ConfigMap, error)
- func (_m *MockKubernetesConnector) GetDBNamespaces(ctx context.Context) ([]string, error)
- func (_m *MockKubernetesConnector) GetDatabaseEngine(ctx context.Context, namespace string, name string) (*v1alpha1.DatabaseEngine, error)
- func (_m *MockKubernetesConnector) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error)
- func (_m *MockKubernetesConnector) GetEverestID(ctx context.Context) (string, error)
- func (_m *MockKubernetesConnector) GetEverestSettings(ctx context.Context) (common.EverestSettings, error)
- func (_m *MockKubernetesConnector) GetMonitoringConfig(ctx context.Context, namespace string, name string) (*v1alpha1.MonitoringConfig, error)
- func (_m *MockKubernetesConnector) GetMonitoringConfigsBySecretName(ctx context.Context, namespace string, secretName string) ([]*v1alpha1.MonitoringConfig, error)
- func (_m *MockKubernetesConnector) GetNamespace(ctx context.Context, name string) (*v1.Namespace, error)
- func (_m *MockKubernetesConnector) GetSecret(ctx context.Context, namespace string, name string) (*v1.Secret, error)
- func (_m *MockKubernetesConnector) GetServerVersion() (*version.Info, error)
- func (_m *MockKubernetesConnector) GetSubscription(ctx context.Context, name string, namespace string) (*operatorsv1alpha1.Subscription, error)
- func (_m *MockKubernetesConnector) IsBackupStorageUsed(ctx context.Context, namespace string, name string) (bool, error)
- func (_m *MockKubernetesConnector) IsMonitoringConfigUsed(ctx context.Context, namespace string, name string) (bool, error)
- func (_m *MockKubernetesConnector) Kubeconfig() string
- func (_m *MockKubernetesConnector) ListBackupStorages(ctx context.Context, namespace string) (*v1alpha1.BackupStorageList, error)
- func (_m *MockKubernetesConnector) ListCRDs(ctx context.Context) (*apiextensionsv1.CustomResourceDefinitionList, error)
- func (_m *MockKubernetesConnector) ListClusterServiceVersion(ctx context.Context, namespace string) (*operatorsv1alpha1.ClusterServiceVersionList, error)
- func (_m *MockKubernetesConnector) ListDatabaseEngines(ctx context.Context, namespace string) (*v1alpha1.DatabaseEngineList, error)
- func (_m *MockKubernetesConnector) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (_m *MockKubernetesConnector) ListMonitoringConfigs(ctx context.Context, namespace string) (*v1alpha1.MonitoringConfigList, error)
- func (_m *MockKubernetesConnector) ListNamespaces(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error)
- func (_m *MockKubernetesConnector) ListSecrets(ctx context.Context, namespace string) (*v1.SecretList, error)
- func (_m *MockKubernetesConnector) ListSubscriptions(ctx context.Context, namespace string) (*operatorsv1alpha1.SubscriptionList, error)
- func (_m *MockKubernetesConnector) Namespace() string
- func (_m *MockKubernetesConnector) OperatorInstalledVersion(ctx context.Context, namespace string, name string) (*go_version.Version, error)
- func (_m *MockKubernetesConnector) RestartDeployment(ctx context.Context, name string, namespace string) error
- func (_m *MockKubernetesConnector) SetDatabaseEngineLock(ctx context.Context, namespace string, name string, locked bool) error
- func (_m *MockKubernetesConnector) SetSecret(secret *v1.Secret) error
- func (_m *MockKubernetesConnector) UpdateBackupStorage(ctx context.Context, storage *v1alpha1.BackupStorage) error
- func (_m *MockKubernetesConnector) UpdateDatabaseEngine(ctx context.Context, namespace string, engine *v1alpha1.DatabaseEngine) (*v1alpha1.DatabaseEngine, error)
- func (_m *MockKubernetesConnector) UpdateDeployment(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func (_m *MockKubernetesConnector) UpdateEverestSettings(ctx context.Context, settings common.EverestSettings) error
- func (_m *MockKubernetesConnector) UpdateMonitoringConfig(ctx context.Context, storage *v1alpha1.MonitoringConfig) error
- func (_m *MockKubernetesConnector) UpdateNamespace(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error)
- func (_m *MockKubernetesConnector) UpdateSecret(ctx context.Context, secret *v1.Secret) (*v1.Secret, error)
- func (_m *MockKubernetesConnector) WaitForRollout(ctx context.Context, name string, namespace string) error
- func (_m *MockKubernetesConnector) WithClient(c client.KubeClientConnector) *Kubernetes
- type NodeFileSystemSummary
- type NodeSummary
- type NodeSummaryNode
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyVersionTag = errors.New("got an empty version tag from Github")
ErrEmptyVersionTag Got an empty version tag from GitHub API.
var ErrOperatorNotInstalled = fmt.Errorf("operatorNotInstalled")
ErrOperatorNotInstalled is returned when an operator is not installed.
Functions ¶
func IsContainerInState ¶
func IsContainerInState(containerStatuses []corev1.ContainerStatus, state ContainerState) bool
IsContainerInState returns true if container is in give state, otherwise false.
func IsNodeInCondition ¶
func IsNodeInCondition(node corev1.Node, conditionType corev1.NodeConditionType) bool
IsNodeInCondition returns true if node's condition given as an argument has status "True". Otherwise it returns false.
Types ¶
type ClusterType ¶
type ClusterType string
ClusterType defines type of cluster.
const ( // ClusterTypeUnknown is for unknown type. ClusterTypeUnknown ClusterType = "unknown" // ClusterTypeMinikube is for minikube. ClusterTypeMinikube ClusterType = "minikube" // ClusterTypeEKS is for EKS. ClusterTypeEKS ClusterType = "eks" // ClusterTypeGKE is for GKE. ClusterTypeGKE ClusterType = "gke" // ClusterTypeOpenShift is for OpenShift. ClusterTypeOpenShift ClusterType = "openshift" // ClusterTypeGeneric is a generic type. ClusterTypeGeneric ClusterType = "generic" // EverestDBNamespacesEnvVar is the name of the environment variable that // contains the list of monitored namespaces. EverestDBNamespacesEnvVar = "DB_NAMESPACES" // OLMNamespace is the namespace where OLM is installed. OLMNamespace = "everest-olm" // APIVersionCoreosV1 constant for some API requests. APIVersionCoreosV1 = "operators.coreos.com/v1" )
type ContainerState ¶
type ContainerState string
ContainerState describes container's state - waiting, running, terminated.
const ( // ContainerStateWaiting represents a state when container requires some // operations being done in order to complete start up. ContainerStateWaiting ContainerState = "waiting" // ContainerStateTerminated indicates that container began execution and // then either ran to completion or failed for some reason. ContainerStateTerminated ContainerState = "terminated" )
type InstallOperatorRequest ¶
type InstallOperatorRequest struct { Namespace string Name string OperatorGroup string CatalogSource string CatalogSourceNamespace string Channel string InstallPlanApproval olmv1alpha1.Approval StartingCSV string TargetNamespaces []string SubscriptionConfig *olmv1alpha1.SubscriptionConfig }
InstallOperatorRequest holds the fields to make an operator install request.
type Kubernetes ¶
type Kubernetes struct {
// contains filtered or unexported fields
}
Kubernetes is a client for Kubernetes.
func New ¶
func New(kubeconfigPath string, l *zap.SugaredLogger) (*Kubernetes, error)
New returns new Kubernetes object.
func NewEmpty ¶
func NewEmpty(l *zap.SugaredLogger) *Kubernetes
NewEmpty returns new Kubernetes object.
func NewInCluster ¶
func NewInCluster(l *zap.SugaredLogger) (*Kubernetes, error)
NewInCluster creates a new kubernetes client using incluster authentication.
func (*Kubernetes) Accounts ¶ added in v1.0.0
func (c *Kubernetes) Accounts() accounts.Interface
Accounts returns a new client for managing everest user accounts.
func (*Kubernetes) ApplyManifestFile ¶
func (k *Kubernetes) ApplyManifestFile(files []byte, namespace string) error
ApplyManifestFile accepts manifest file contents, parses into []runtime.Object and applies them against the cluster.
func (*Kubernetes) ApproveInstallPlan ¶ added in v0.10.0
func (k *Kubernetes) ApproveInstallPlan(ctx context.Context, namespace, installPlanName string) (bool, error)
ApproveInstallPlan approves an install plan.
func (*Kubernetes) ClusterName ¶
func (k *Kubernetes) ClusterName() string
ClusterName returns the name of the k8s cluster.
func (*Kubernetes) CreateBackupStorage ¶
func (k *Kubernetes) CreateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) error
CreateBackupStorage returns backup storages by provided name.
func (*Kubernetes) CreateClusterRole ¶
func (k *Kubernetes) CreateClusterRole(name string, rules []rbac.PolicyRule) error
CreateClusterRole creates a new cluster role.
func (*Kubernetes) CreateClusterRoleBinding ¶
func (k *Kubernetes) CreateClusterRoleBinding(namespace, name, roleName, serviceAccountName string) error
CreateClusterRoleBinding binds a cluster role to a service account.
func (*Kubernetes) CreateMonitoringConfig ¶
func (k *Kubernetes) CreateMonitoringConfig(ctx context.Context, storage *everestv1alpha1.MonitoringConfig) error
CreateMonitoringConfig returns monitoring configs by provided name.
func (*Kubernetes) CreateNamespace ¶
CreateNamespace creates the given namespace.
func (*Kubernetes) CreateRSAKeyPair ¶ added in v1.0.0
func (k *Kubernetes) CreateRSAKeyPair(ctx context.Context) error
CreateRSAKeyPair creates a new RSA key pair and stores it in a secret.
func (*Kubernetes) CreateRole ¶
func (k *Kubernetes) CreateRole(namespace, name string, rules []rbac.PolicyRule) error
CreateRole creates a new role.
func (*Kubernetes) CreateRoleBinding ¶
func (k *Kubernetes) CreateRoleBinding(namespace, name, roleName, serviceAccountName string) error
CreateRoleBinding binds a role to a service account.
func (*Kubernetes) CreateSecret ¶
func (k *Kubernetes) CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)
CreateSecret creates a secret.
func (*Kubernetes) CreateServiceAccount ¶
func (k *Kubernetes) CreateServiceAccount(name, namespace string) error
CreateServiceAccount creates a new service account.
func (*Kubernetes) CreateServiceAccountToken ¶
func (k *Kubernetes) CreateServiceAccountToken(serviceAccountName, secretName, namespace string) error
CreateServiceAccountToken creates a new secret with service account token.
func (*Kubernetes) DatabasesExist ¶
DatabasesExist checks if databases exist in provided at least one of the provided namespaces. If namespaces are not provided, it checks in all namespaces.
func (*Kubernetes) DeleteAllMonitoringResources ¶
func (k *Kubernetes) DeleteAllMonitoringResources(ctx context.Context, namespace string) error
DeleteAllMonitoringResources deletes all resources related to monitoring from k8s cluster. If namespace is empty, a default namespace is used.
func (*Kubernetes) DeleteBackupStorage ¶
func (k *Kubernetes) DeleteBackupStorage(ctx context.Context, namespace, name string) error
DeleteBackupStorage returns backup storages by provided name.
func (*Kubernetes) DeleteBackupStorages ¶
func (k *Kubernetes) DeleteBackupStorages(ctx context.Context, namespace string) error
DeleteBackupStorages deletes all backup storages in provided namespace. This function will wait until all storages are deleted.
func (*Kubernetes) DeleteCRD ¶
func (k *Kubernetes) DeleteCRD( ctx context.Context, name string, ) error
DeleteCRD deletes a CRD by name.
func (*Kubernetes) DeleteCatalogSource ¶
func (k *Kubernetes) DeleteCatalogSource(ctx context.Context, name, namespace string) error
DeleteCatalogSource deletes catalog source.
func (*Kubernetes) DeleteClusterServiceVersion ¶
func (k *Kubernetes) DeleteClusterServiceVersion( ctx context.Context, key types.NamespacedName, ) error
DeleteClusterServiceVersion deletes a ClusterServiceVersion.
func (*Kubernetes) DeleteDatabaseCluster ¶
func (k *Kubernetes) DeleteDatabaseCluster(ctx context.Context, namespace, name string) error
DeleteDatabaseCluster deletes database cluster.
func (*Kubernetes) DeleteDatabaseClusters ¶
func (k *Kubernetes) DeleteDatabaseClusters(ctx context.Context, namespace string) error
DeleteDatabaseClusters deletes all database clusters in provided namespace. This function will wait until all clusters are deleted.
func (*Kubernetes) DeleteDeployment ¶
func (k *Kubernetes) DeleteDeployment(ctx context.Context, name, namespace string) error
DeleteDeployment deletes a deployment by provided name and namespace.
func (*Kubernetes) DeleteManifestFile ¶
func (k *Kubernetes) DeleteManifestFile(fileBytes []byte, namespace string) error
DeleteManifestFile accepts manifest file contents, parses into []runtime.Object and deletes them from the cluster.
func (*Kubernetes) DeleteMonitoringConfig ¶
func (k *Kubernetes) DeleteMonitoringConfig(ctx context.Context, namespace, name string) error
DeleteMonitoringConfig returns monitoring configs by provided name.
func (*Kubernetes) DeleteMonitoringConfigs ¶
func (k *Kubernetes) DeleteMonitoringConfigs(ctx context.Context, namespace string) error
DeleteMonitoringConfigs deletes all monitoring configs in provided namespace. This function will wait until all configs are deleted.
func (*Kubernetes) DeleteNamespace ¶
func (k *Kubernetes) DeleteNamespace(ctx context.Context, name string) error
DeleteNamespace deletes a namespace.
func (*Kubernetes) DeleteSecret ¶
func (k *Kubernetes) DeleteSecret(ctx context.Context, namespace, name string) error
DeleteSecret deletes a secret.
func (*Kubernetes) DeleteSubscription ¶
func (k *Kubernetes) DeleteSubscription( ctx context.Context, key types.NamespacedName, ) error
DeleteSubscription deletes a subscription by namespaced name.
func (*Kubernetes) GenerateKubeConfigWithToken ¶
func (k *Kubernetes) GenerateKubeConfigWithToken(user string, secret *corev1.Secret) (string, error)
GenerateKubeConfigWithToken returns a kubeconfig with the token as provided in the secret.
func (*Kubernetes) GetAllClusterResources ¶
func (k *Kubernetes) GetAllClusterResources( ctx context.Context, clusterType ClusterType, volumes *corev1.PersistentVolumeList, ) (uint64, uint64, uint64, error)
GetAllClusterResources goes through all cluster nodes and sums their allocatable resources.
func (*Kubernetes) GetBackupStorage ¶
func (k *Kubernetes) GetBackupStorage(ctx context.Context, namespace, name string) (*everestv1alpha1.BackupStorage, error)
GetBackupStorage returns backup storages by provided name.
func (*Kubernetes) GetCatalogSource ¶
func (k *Kubernetes) GetCatalogSource(ctx context.Context, name, namespace string) (*olmv1alpha1.CatalogSource, error)
GetCatalogSource returns catalog source.
func (*Kubernetes) GetClusterServiceVersion ¶
func (k *Kubernetes) GetClusterServiceVersion( ctx context.Context, key types.NamespacedName, ) (*olmv1alpha1.ClusterServiceVersion, error)
GetClusterServiceVersion retrieves a ClusterServiceVersion by namespaced name.
func (*Kubernetes) GetClusterType ¶
func (k *Kubernetes) GetClusterType(ctx context.Context) (ClusterType, error)
GetClusterType tries to guess the underlying kubernetes cluster based on storage class.
func (*Kubernetes) GetConfigMap ¶ added in v1.1.0
func (k *Kubernetes) GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error)
GetConfigMap returns k8s configmap by provided name and namespace.
func (*Kubernetes) GetConsumedCPUAndMemory ¶
func (k *Kubernetes) GetConsumedCPUAndMemory(ctx context.Context, namespace string) ( cpuMillis uint64, memoryBytes uint64, err error, )
GetConsumedCPUAndMemory returns consumed CPU and Memory in given namespace. If namespace is empty, it tries to get them from all namespaces.
func (*Kubernetes) GetConsumedDiskBytes ¶
func (k *Kubernetes) GetConsumedDiskBytes( _ context.Context, clusterType ClusterType, volumes *corev1.PersistentVolumeList, ) (uint64, error)
GetConsumedDiskBytes returns consumed bytes. The strategy differs based on k8s cluster type.
func (*Kubernetes) GetDBNamespaces ¶
func (k *Kubernetes) GetDBNamespaces(ctx context.Context) ([]string, error)
GetDBNamespaces returns a list of namespaces that are monitored by the Everest operator.
func (*Kubernetes) GetDatabaseCluster ¶
func (k *Kubernetes) GetDatabaseCluster(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseCluster, error)
GetDatabaseCluster returns database clusters by provided name.
func (*Kubernetes) GetDatabaseClusterBackup ¶
func (k *Kubernetes) GetDatabaseClusterBackup(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterBackup, error)
GetDatabaseClusterBackup returns database cluster backup by name.
func (*Kubernetes) GetDatabaseClusterRestore ¶
func (k *Kubernetes) GetDatabaseClusterRestore(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterRestore, error)
GetDatabaseClusterRestore returns database cluster restore by name.
func (*Kubernetes) GetDatabaseEngine ¶
func (k *Kubernetes) GetDatabaseEngine(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseEngine, error)
GetDatabaseEngine returns database clusters by provided name.
func (*Kubernetes) GetDeployment ¶
func (k *Kubernetes) GetDeployment(ctx context.Context, name, namespace string) (*appsv1.Deployment, error)
GetDeployment returns k8s deployment by provided name and namespace.
func (*Kubernetes) GetEverestID ¶
func (k *Kubernetes) GetEverestID(ctx context.Context) (string, error)
GetEverestID returns the ID of the namespace where everest is deployed.
func (*Kubernetes) GetEverestSettings ¶ added in v1.0.0
func (k *Kubernetes) GetEverestSettings(ctx context.Context) (common.EverestSettings, error)
GetEverestSettings returns Everest settings.
func (*Kubernetes) GetMonitoringConfig ¶
func (k *Kubernetes) GetMonitoringConfig(ctx context.Context, namespace, name string) (*everestv1alpha1.MonitoringConfig, error)
GetMonitoringConfig returns monitoring configs by provided name.
func (*Kubernetes) GetMonitoringConfigsBySecretName ¶
func (k *Kubernetes) GetMonitoringConfigsBySecretName( ctx context.Context, namespace, secretName string, ) ([]*everestv1alpha1.MonitoringConfig, error)
GetMonitoringConfigsBySecretName returns a list of monitoring configs which use the provided secret name.
func (*Kubernetes) GetNamespace ¶
GetNamespace returns a namespace.
func (*Kubernetes) GetPersistentVolumes ¶
func (k *Kubernetes) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error)
GetPersistentVolumes returns list of persistent volumes.
func (*Kubernetes) GetPods ¶
func (k *Kubernetes) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error)
GetPods returns list of pods.
func (*Kubernetes) GetServerVersion ¶
func (k *Kubernetes) GetServerVersion() (*version.Info, error)
GetServerVersion returns server version.
func (*Kubernetes) GetStorageClasses ¶
func (k *Kubernetes) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error)
GetStorageClasses returns list of storage classes.
func (*Kubernetes) GetSubscription ¶
func (k *Kubernetes) GetSubscription(ctx context.Context, name, namespace string) (*olmv1alpha1.Subscription, error)
GetSubscription returns subscription.
func (*Kubernetes) GetWorkerNodes ¶
GetWorkerNodes returns list of cluster workers nodes.
func (*Kubernetes) IsBackupStorageUsed ¶
IsBackupStorageUsed checks if a backup storage in a given namespace is used by any clusters in that namespace.
func (*Kubernetes) IsMonitoringConfigUsed ¶
func (k *Kubernetes) IsMonitoringConfigUsed(ctx context.Context, namespace, name string) (bool, error)
IsMonitoringConfigUsed checks if a monitoring config is used by any database cluster in the provided namespace.
func (*Kubernetes) Kubeconfig ¶
func (k *Kubernetes) Kubeconfig() string
Kubeconfig returns the path to the kubeconfig.
func (*Kubernetes) ListBackupStorages ¶
func (k *Kubernetes) ListBackupStorages(ctx context.Context, namespace string) (*everestv1alpha1.BackupStorageList, error)
ListBackupStorages returns list of managed backup storages.
func (*Kubernetes) ListCRDs ¶
func (k *Kubernetes) ListCRDs( ctx context.Context, ) (*apiextv1.CustomResourceDefinitionList, error)
ListCRDs lists all CRDs.
func (*Kubernetes) ListClusterServiceVersion ¶
func (k *Kubernetes) ListClusterServiceVersion( ctx context.Context, namespace string, ) (*olmv1alpha1.ClusterServiceVersionList, error)
ListClusterServiceVersion list all CSVs for the given namespace.
func (*Kubernetes) ListDatabaseClusterBackups ¶
func (k *Kubernetes) ListDatabaseClusterBackups(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error)
ListDatabaseClusterBackups returns database cluster backups.
func (*Kubernetes) ListDatabaseClusterRestores ¶
func (k *Kubernetes) ListDatabaseClusterRestores(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error)
ListDatabaseClusterRestores returns database cluster restores.
func (*Kubernetes) ListDatabaseClusters ¶
func (k *Kubernetes) ListDatabaseClusters(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseClusterList, error)
ListDatabaseClusters returns list of managed database clusters.
func (*Kubernetes) ListDatabaseEngines ¶
func (k *Kubernetes) ListDatabaseEngines(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseEngineList, error)
ListDatabaseEngines returns list of managed database clusters.
func (*Kubernetes) ListDeployments ¶
func (k *Kubernetes) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
ListDeployments returns a list of deployments in the provided namespace.
func (*Kubernetes) ListMonitoringConfigs ¶
func (k *Kubernetes) ListMonitoringConfigs(ctx context.Context, namespace string) (*everestv1alpha1.MonitoringConfigList, error)
ListMonitoringConfigs returns list of managed monitoring configs.
func (*Kubernetes) ListNamespaces ¶ added in v1.0.0
func (k *Kubernetes) ListNamespaces(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error)
ListNamespaces lists all namespaces.
func (*Kubernetes) ListSecrets ¶
func (k *Kubernetes) ListSecrets(ctx context.Context, namespace string) (*corev1.SecretList, error)
ListSecrets returns secret by name.
func (*Kubernetes) ListSubscriptions ¶
func (k *Kubernetes) ListSubscriptions(ctx context.Context, namespace string) (*olmv1alpha1.SubscriptionList, error)
ListSubscriptions lists subscriptions.
func (*Kubernetes) Namespace ¶
func (k *Kubernetes) Namespace() string
Namespace returns the current namespace.
func (*Kubernetes) OperatorInstalledVersion ¶ added in v0.10.0
func (k *Kubernetes) OperatorInstalledVersion(ctx context.Context, namespace, name string) (*goversion.Version, error)
OperatorInstalledVersion returns the installed version of operator by name.
func (*Kubernetes) PatchDatabaseCluster ¶
func (k *Kubernetes) PatchDatabaseCluster(cluster *everestv1alpha1.DatabaseCluster) error
PatchDatabaseCluster patches CR of managed Database cluster.
func (*Kubernetes) RestartDeployment ¶ added in v1.0.0
func (k *Kubernetes) RestartDeployment(ctx context.Context, name, namespace string) error
RestartDeployment restarts the given deployment.
func (*Kubernetes) SetDatabaseEngineLock ¶ added in v1.0.0
func (k *Kubernetes) SetDatabaseEngineLock(ctx context.Context, namespace, name string, locked bool) error
SetDatabaseEngineLock sets the lock on the database engine. The lock is automatically set to false once everest-operator completes its upgrade.
func (*Kubernetes) SetSecret ¶
func (k *Kubernetes) SetSecret(secret *corev1.Secret) error
SetSecret creates or updates an existing secret.
func (*Kubernetes) UpdateBackupStorage ¶
func (k *Kubernetes) UpdateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) error
UpdateBackupStorage returns backup storages by provided name.
func (*Kubernetes) UpdateDatabaseClusterBackup ¶ added in v0.10.0
func (k *Kubernetes) UpdateDatabaseClusterBackup(ctx context.Context, backup *everestv1alpha1.DatabaseClusterBackup) (*everestv1alpha1.DatabaseClusterBackup, error)
UpdateDatabaseClusterBackup updates database cluster backup.
func (*Kubernetes) UpdateDatabaseEngine ¶ added in v0.10.0
func (k *Kubernetes) UpdateDatabaseEngine(ctx context.Context, namespace string, engine *everestv1alpha1.DatabaseEngine) (*everestv1alpha1.DatabaseEngine, error)
UpdateDatabaseEngine updates the provided database engine.
func (*Kubernetes) UpdateDeployment ¶ added in v1.0.0
func (k *Kubernetes) UpdateDeployment(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
UpdateDeployment updates a deployment and returns the updated object.
func (*Kubernetes) UpdateEverestSettings ¶ added in v1.0.0
func (k *Kubernetes) UpdateEverestSettings(ctx context.Context, settings common.EverestSettings) error
UpdateEverestSettings accepts the full list of Everest settings and updates the settings.
func (*Kubernetes) UpdateMonitoringConfig ¶
func (k *Kubernetes) UpdateMonitoringConfig(ctx context.Context, storage *everestv1alpha1.MonitoringConfig) error
UpdateMonitoringConfig returns monitoring configs by provided name.
func (*Kubernetes) UpdateNamespace ¶ added in v1.0.0
func (k *Kubernetes) UpdateNamespace(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error)
UpdateNamespace updates the given namespace.
func (*Kubernetes) UpdateSecret ¶
func (k *Kubernetes) UpdateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)
UpdateSecret updates a secret.
func (*Kubernetes) WaitForRollout ¶
func (k *Kubernetes) WaitForRollout(ctx context.Context, name, namespace string) error
WaitForRollout waits for rollout of a provided deployment in the provided namespace.
func (*Kubernetes) WithClient ¶ added in v1.0.0
func (k *Kubernetes) WithClient(c client.KubeClientConnector) *Kubernetes
WithClient sets the client connector.
type KubernetesConnector ¶ added in v0.10.0
type KubernetesConnector interface { // Accounts returns a new client for managing everest user accounts. // //nolint:ireturn,stylecheck Accounts() accounts.Interface // ListBackupStorages returns list of managed backup storages. ListBackupStorages(ctx context.Context, namespace string) (*everestv1alpha1.BackupStorageList, error) // GetBackupStorage returns backup storages by provided name. GetBackupStorage(ctx context.Context, namespace, name string) (*everestv1alpha1.BackupStorage, error) // CreateBackupStorage returns backup storages by provided name. CreateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) error // UpdateBackupStorage returns backup storages by provided name. UpdateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) error // DeleteBackupStorage returns backup storages by provided name. DeleteBackupStorage(ctx context.Context, namespace, name string) error // DeleteBackupStorages deletes all backup storages in provided namespace. // This function will wait until all storages are deleted. DeleteBackupStorages(ctx context.Context, namespace string) error // IsBackupStorageUsed checks if a backup storage in a given namespace is used by any clusters // in that namespace. // //nolint:cyclop IsBackupStorageUsed(ctx context.Context, namespace, name string) (bool, error) // GetConfigMap returns k8s configmap by provided name and namespace. GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error) // ListDatabaseEngines returns list of managed database clusters. ListDatabaseEngines(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseEngineList, error) // GetDatabaseEngine returns database clusters by provided name. GetDatabaseEngine(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseEngine, error) // UpdateDatabaseEngine updates the provided database engine. UpdateDatabaseEngine(ctx context.Context, namespace string, engine *everestv1alpha1.DatabaseEngine) (*everestv1alpha1.DatabaseEngine, error) // SetDatabaseEngineLock sets the lock on the database engine. // The lock is automatically set to false once everest-operator completes its upgrade. SetDatabaseEngineLock(ctx context.Context, namespace, name string, locked bool) error // GetDeployment returns k8s deployment by provided name and namespace. GetDeployment(ctx context.Context, name, namespace string) (*appsv1.Deployment, error) // UpdateDeployment updates a deployment and returns the updated object. UpdateDeployment(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.Deployment, error) // ListDeployments returns a list of deployments in the provided namespace. ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error) // DeleteDeployment deletes a deployment by provided name and namespace. DeleteDeployment(ctx context.Context, name, namespace string) error // ApproveInstallPlan approves an install plan. ApproveInstallPlan(ctx context.Context, namespace, installPlanName string) (bool, error) // Kubeconfig returns the path to the kubeconfig. Kubeconfig() string // Config returns *rest.Config. Config() *rest.Config // WithClient sets the client connector. WithClient(c client.KubeClientConnector) *Kubernetes // Namespace returns the current namespace. Namespace() string // ClusterName returns the name of the k8s cluster. ClusterName() string // GetEverestID returns the ID of the namespace where everest is deployed. GetEverestID(ctx context.Context) (string, error) // GetClusterType tries to guess the underlying kubernetes cluster based on storage class. GetClusterType(ctx context.Context) (ClusterType, error) // GetCatalogSource returns catalog source. GetCatalogSource(ctx context.Context, name, namespace string) (*olmv1alpha1.CatalogSource, error) // DeleteCatalogSource deletes catalog source. DeleteCatalogSource(ctx context.Context, name, namespace string) error // GetSubscription returns subscription. GetSubscription(ctx context.Context, name, namespace string) (*olmv1alpha1.Subscription, error) // ListSubscriptions lists subscriptions. ListSubscriptions(ctx context.Context, namespace string) (*olmv1alpha1.SubscriptionList, error) // GetServerVersion returns server version. GetServerVersion() (*version.Info, error) // GetClusterServiceVersion retrieves a ClusterServiceVersion by namespaced name. GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*olmv1alpha1.ClusterServiceVersion, error) // ListClusterServiceVersion list all CSVs for the given namespace. ListClusterServiceVersion(ctx context.Context, namespace string) (*olmv1alpha1.ClusterServiceVersionList, error) // ListCRDs lists all CRDs. ListCRDs(ctx context.Context) (*apiextv1.CustomResourceDefinitionList, error) // DeleteCRD deletes a CRD by name. DeleteCRD(ctx context.Context, name string) error // DeleteClusterServiceVersion deletes a ClusterServiceVersion. DeleteClusterServiceVersion(ctx context.Context, key types.NamespacedName) error // DeleteSubscription deletes a subscription by namespaced name. DeleteSubscription(ctx context.Context, key types.NamespacedName) error // RestartDeployment restarts the given deployment. RestartDeployment(ctx context.Context, name, namespace string) error // ApplyManifestFile accepts manifest file contents, parses into []runtime.Object // and applies them against the cluster. ApplyManifestFile(files []byte, namespace string) error // GetDBNamespaces returns a list of namespaces that are monitored by the Everest operator. GetDBNamespaces(ctx context.Context) ([]string, error) // WaitForRollout waits for rollout of a provided deployment in the provided namespace. WaitForRollout(ctx context.Context, name, namespace string) error // DeleteManifestFile accepts manifest file contents, parses into []runtime.Object // and deletes them from the cluster. DeleteManifestFile(fileBytes []byte, namespace string) error // ListMonitoringConfigs returns list of managed monitoring configs. ListMonitoringConfigs(ctx context.Context, namespace string) (*everestv1alpha1.MonitoringConfigList, error) // GetMonitoringConfig returns monitoring configs by provided name. GetMonitoringConfig(ctx context.Context, namespace, name string) (*everestv1alpha1.MonitoringConfig, error) // CreateMonitoringConfig returns monitoring configs by provided name. CreateMonitoringConfig(ctx context.Context, storage *everestv1alpha1.MonitoringConfig) error // UpdateMonitoringConfig returns monitoring configs by provided name. UpdateMonitoringConfig(ctx context.Context, storage *everestv1alpha1.MonitoringConfig) error // DeleteMonitoringConfig returns monitoring configs by provided name. DeleteMonitoringConfig(ctx context.Context, namespace, name string) error // DeleteMonitoringConfigs deletes all monitoring configs in provided namespace. // This function will wait until all configs are deleted. DeleteMonitoringConfigs(ctx context.Context, namespace string) error // IsMonitoringConfigUsed checks if a monitoring config is used by any database cluster in the provided namespace. IsMonitoringConfigUsed(ctx context.Context, namespace, name string) (bool, error) // GetMonitoringConfigsBySecretName returns a list of monitoring configs which use // the provided secret name. GetMonitoringConfigsBySecretName(ctx context.Context, namespace, secretName string) ([]*everestv1alpha1.MonitoringConfig, error) // CreateNamespace creates the given namespace. CreateNamespace(ctx context.Context, namespace *corev1.Namespace) error // GetNamespace returns a namespace. GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error) // DeleteNamespace deletes a namespace. DeleteNamespace(ctx context.Context, name string) error // ListNamespaces lists all namespaces. ListNamespaces(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error) // UpdateNamespace updates the given namespace. UpdateNamespace(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) // OperatorInstalledVersion returns the installed version of operator by name. OperatorInstalledVersion(ctx context.Context, namespace, name string) (*goversion.Version, error) // CreateRSAKeyPair creates a new RSA key pair and stores it in a secret. CreateRSAKeyPair(ctx context.Context) error // UpdateEverestSettings accepts the full list of Everest settings and updates the settings. UpdateEverestSettings(ctx context.Context, settings common.EverestSettings) error // GetEverestSettings returns Everest settings. GetEverestSettings(ctx context.Context) (common.EverestSettings, error) // ListSecrets returns secret by name. ListSecrets(ctx context.Context, namespace string) (*corev1.SecretList, error) // GetSecret returns a secret by name. GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error) // CreateSecret creates a secret. CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error) // SetSecret creates or updates an existing secret. SetSecret(secret *corev1.Secret) error // UpdateSecret updates a secret. UpdateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error) // DeleteSecret deletes a secret. DeleteSecret(ctx context.Context, namespace, name string) error }
KubernetesConnector ...
type MockKubernetesConnector ¶ added in v0.10.0
MockKubernetesConnector is an autogenerated mock type for the KubernetesConnector type
func NewMockKubernetesConnector ¶ added in v0.10.0
func NewMockKubernetesConnector(t interface { mock.TestingT Cleanup(func()) }, ) *MockKubernetesConnector
NewMockKubernetesConnector creates a new instance of MockKubernetesConnector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockKubernetesConnector) Accounts ¶ added in v1.0.0
func (_m *MockKubernetesConnector) Accounts() accounts.Interface
Accounts provides a mock function with given fields:
func (*MockKubernetesConnector) ApplyManifestFile ¶
func (_m *MockKubernetesConnector) ApplyManifestFile(files []byte, namespace string) error
ApplyManifestFile provides a mock function with given fields: files, namespace
func (*MockKubernetesConnector) ApproveInstallPlan ¶ added in v0.10.0
func (_m *MockKubernetesConnector) ApproveInstallPlan(ctx context.Context, namespace string, installPlanName string) (bool, error)
ApproveInstallPlan provides a mock function with given fields: ctx, namespace, installPlanName
func (*MockKubernetesConnector) ClusterName ¶ added in v0.10.0
func (_m *MockKubernetesConnector) ClusterName() string
ClusterName provides a mock function with given fields:
func (*MockKubernetesConnector) Config ¶ added in v0.10.0
func (_m *MockKubernetesConnector) Config() *rest.Config
Config provides a mock function with given fields:
func (*MockKubernetesConnector) CreateBackupStorage ¶ added in v1.2.0
func (_m *MockKubernetesConnector) CreateBackupStorage(ctx context.Context, storage *v1alpha1.BackupStorage) error
CreateBackupStorage provides a mock function with given fields: ctx, storage
func (*MockKubernetesConnector) CreateMonitoringConfig ¶ added in v1.2.0
func (_m *MockKubernetesConnector) CreateMonitoringConfig(ctx context.Context, storage *v1alpha1.MonitoringConfig) error
CreateMonitoringConfig provides a mock function with given fields: ctx, storage
func (*MockKubernetesConnector) CreateNamespace ¶ added in v0.10.0
func (_m *MockKubernetesConnector) CreateNamespace(ctx context.Context, namespace *v1.Namespace) error
CreateNamespace provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) CreateRSAKeyPair ¶ added in v1.0.0
func (_m *MockKubernetesConnector) CreateRSAKeyPair(ctx context.Context) error
CreateRSAKeyPair provides a mock function with given fields: ctx
func (*MockKubernetesConnector) CreateSecret ¶ added in v1.0.0
func (_m *MockKubernetesConnector) CreateSecret(ctx context.Context, secret *v1.Secret) (*v1.Secret, error)
CreateSecret provides a mock function with given fields: ctx, secret
func (*MockKubernetesConnector) DeleteBackupStorage ¶ added in v1.2.0
func (_m *MockKubernetesConnector) DeleteBackupStorage(ctx context.Context, namespace string, name string) error
DeleteBackupStorage provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) DeleteBackupStorages ¶
func (_m *MockKubernetesConnector) DeleteBackupStorages(ctx context.Context, namespace string) error
DeleteBackupStorages provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) DeleteCRD ¶
func (_m *MockKubernetesConnector) DeleteCRD(ctx context.Context, name string) error
DeleteCRD provides a mock function with given fields: ctx, name
func (*MockKubernetesConnector) DeleteCatalogSource ¶
func (_m *MockKubernetesConnector) DeleteCatalogSource(ctx context.Context, name string, namespace string) error
DeleteCatalogSource provides a mock function with given fields: ctx, name, namespace
func (*MockKubernetesConnector) DeleteClusterServiceVersion ¶ added in v0.10.0
func (_m *MockKubernetesConnector) DeleteClusterServiceVersion(ctx context.Context, key types.NamespacedName) error
DeleteClusterServiceVersion provides a mock function with given fields: ctx, key
func (*MockKubernetesConnector) DeleteDeployment ¶
func (_m *MockKubernetesConnector) DeleteDeployment(ctx context.Context, name string, namespace string) error
DeleteDeployment provides a mock function with given fields: ctx, name, namespace
func (*MockKubernetesConnector) DeleteManifestFile ¶
func (_m *MockKubernetesConnector) DeleteManifestFile(fileBytes []byte, namespace string) error
DeleteManifestFile provides a mock function with given fields: fileBytes, namespace
func (*MockKubernetesConnector) DeleteMonitoringConfig ¶ added in v1.2.0
func (_m *MockKubernetesConnector) DeleteMonitoringConfig(ctx context.Context, namespace string, name string) error
DeleteMonitoringConfig provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) DeleteMonitoringConfigs ¶
func (_m *MockKubernetesConnector) DeleteMonitoringConfigs(ctx context.Context, namespace string) error
DeleteMonitoringConfigs provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) DeleteNamespace ¶ added in v1.0.0
func (_m *MockKubernetesConnector) DeleteNamespace(ctx context.Context, name string) error
DeleteNamespace provides a mock function with given fields: ctx, name
func (*MockKubernetesConnector) DeleteSecret ¶ added in v1.0.0
func (_m *MockKubernetesConnector) DeleteSecret(ctx context.Context, namespace string, name string) error
DeleteSecret provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) DeleteSubscription ¶
func (_m *MockKubernetesConnector) DeleteSubscription(ctx context.Context, key types.NamespacedName) error
DeleteSubscription provides a mock function with given fields: ctx, key
func (*MockKubernetesConnector) GetBackupStorage ¶ added in v1.2.0
func (_m *MockKubernetesConnector) GetBackupStorage(ctx context.Context, namespace string, name string) (*v1alpha1.BackupStorage, error)
GetBackupStorage provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) GetCatalogSource ¶
func (_m *MockKubernetesConnector) GetCatalogSource(ctx context.Context, name string, namespace string) (*operatorsv1alpha1.CatalogSource, error)
GetCatalogSource provides a mock function with given fields: ctx, name, namespace
func (*MockKubernetesConnector) GetClusterServiceVersion ¶ added in v0.10.0
func (_m *MockKubernetesConnector) GetClusterServiceVersion(ctx context.Context, key types.NamespacedName) (*operatorsv1alpha1.ClusterServiceVersion, error)
GetClusterServiceVersion provides a mock function with given fields: ctx, key
func (*MockKubernetesConnector) GetClusterType ¶ added in v0.10.0
func (_m *MockKubernetesConnector) GetClusterType(ctx context.Context) (ClusterType, error)
GetClusterType provides a mock function with given fields: ctx
func (*MockKubernetesConnector) GetConfigMap ¶ added in v1.1.0
func (_m *MockKubernetesConnector) GetConfigMap(ctx context.Context, namespace string, name string) (*v1.ConfigMap, error)
GetConfigMap provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) GetDBNamespaces ¶ added in v0.10.0
func (_m *MockKubernetesConnector) GetDBNamespaces(ctx context.Context) ([]string, error)
GetDBNamespaces provides a mock function with given fields: ctx
func (*MockKubernetesConnector) GetDatabaseEngine ¶
func (_m *MockKubernetesConnector) GetDatabaseEngine(ctx context.Context, namespace string, name string) (*v1alpha1.DatabaseEngine, error)
GetDatabaseEngine provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) GetDeployment ¶ added in v0.10.0
func (_m *MockKubernetesConnector) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error)
GetDeployment provides a mock function with given fields: ctx, name, namespace
func (*MockKubernetesConnector) GetEverestID ¶ added in v0.10.0
func (_m *MockKubernetesConnector) GetEverestID(ctx context.Context) (string, error)
GetEverestID provides a mock function with given fields: ctx
func (*MockKubernetesConnector) GetEverestSettings ¶ added in v1.0.0
func (_m *MockKubernetesConnector) GetEverestSettings(ctx context.Context) (common.EverestSettings, error)
GetEverestSettings provides a mock function with given fields: ctx
func (*MockKubernetesConnector) GetMonitoringConfig ¶ added in v1.2.0
func (_m *MockKubernetesConnector) GetMonitoringConfig(ctx context.Context, namespace string, name string) (*v1alpha1.MonitoringConfig, error)
GetMonitoringConfig provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) GetMonitoringConfigsBySecretName ¶ added in v1.2.0
func (_m *MockKubernetesConnector) GetMonitoringConfigsBySecretName(ctx context.Context, namespace string, secretName string) ([]*v1alpha1.MonitoringConfig, error)
GetMonitoringConfigsBySecretName provides a mock function with given fields: ctx, namespace, secretName
func (*MockKubernetesConnector) GetNamespace ¶ added in v1.0.0
func (_m *MockKubernetesConnector) GetNamespace(ctx context.Context, name string) (*v1.Namespace, error)
GetNamespace provides a mock function with given fields: ctx, name
func (*MockKubernetesConnector) GetSecret ¶ added in v1.0.0
func (_m *MockKubernetesConnector) GetSecret(ctx context.Context, namespace string, name string) (*v1.Secret, error)
GetSecret provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) GetServerVersion ¶ added in v0.10.0
func (_m *MockKubernetesConnector) GetServerVersion() (*version.Info, error)
GetServerVersion provides a mock function with given fields:
func (*MockKubernetesConnector) GetSubscription ¶
func (_m *MockKubernetesConnector) GetSubscription(ctx context.Context, name string, namespace string) (*operatorsv1alpha1.Subscription, error)
GetSubscription provides a mock function with given fields: ctx, name, namespace
func (*MockKubernetesConnector) IsBackupStorageUsed ¶ added in v1.2.0
func (_m *MockKubernetesConnector) IsBackupStorageUsed(ctx context.Context, namespace string, name string) (bool, error)
IsBackupStorageUsed provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) IsMonitoringConfigUsed ¶ added in v1.2.0
func (_m *MockKubernetesConnector) IsMonitoringConfigUsed(ctx context.Context, namespace string, name string) (bool, error)
IsMonitoringConfigUsed provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) Kubeconfig ¶
func (_m *MockKubernetesConnector) Kubeconfig() string
Kubeconfig provides a mock function with given fields:
func (*MockKubernetesConnector) ListBackupStorages ¶ added in v1.2.0
func (_m *MockKubernetesConnector) ListBackupStorages(ctx context.Context, namespace string) (*v1alpha1.BackupStorageList, error)
ListBackupStorages provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) ListCRDs ¶
func (_m *MockKubernetesConnector) ListCRDs(ctx context.Context) (*apiextensionsv1.CustomResourceDefinitionList, error)
ListCRDs provides a mock function with given fields: ctx
func (*MockKubernetesConnector) ListClusterServiceVersion ¶ added in v0.10.0
func (_m *MockKubernetesConnector) ListClusterServiceVersion(ctx context.Context, namespace string) (*operatorsv1alpha1.ClusterServiceVersionList, error)
ListClusterServiceVersion provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) ListDatabaseEngines ¶
func (_m *MockKubernetesConnector) ListDatabaseEngines(ctx context.Context, namespace string) (*v1alpha1.DatabaseEngineList, error)
ListDatabaseEngines provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) ListDeployments ¶
func (_m *MockKubernetesConnector) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
ListDeployments provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) ListMonitoringConfigs ¶ added in v1.2.0
func (_m *MockKubernetesConnector) ListMonitoringConfigs(ctx context.Context, namespace string) (*v1alpha1.MonitoringConfigList, error)
ListMonitoringConfigs provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) ListNamespaces ¶ added in v1.0.0
func (_m *MockKubernetesConnector) ListNamespaces(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error)
ListNamespaces provides a mock function with given fields: ctx, opts
func (*MockKubernetesConnector) ListSecrets ¶ added in v1.0.0
func (_m *MockKubernetesConnector) ListSecrets(ctx context.Context, namespace string) (*v1.SecretList, error)
ListSecrets provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) ListSubscriptions ¶ added in v0.10.0
func (_m *MockKubernetesConnector) ListSubscriptions(ctx context.Context, namespace string) (*operatorsv1alpha1.SubscriptionList, error)
ListSubscriptions provides a mock function with given fields: ctx, namespace
func (*MockKubernetesConnector) Namespace ¶ added in v0.10.0
func (_m *MockKubernetesConnector) Namespace() string
Namespace provides a mock function with given fields:
func (*MockKubernetesConnector) OperatorInstalledVersion ¶ added in v0.10.0
func (_m *MockKubernetesConnector) OperatorInstalledVersion(ctx context.Context, namespace string, name string) (*go_version.Version, error)
OperatorInstalledVersion provides a mock function with given fields: ctx, namespace, name
func (*MockKubernetesConnector) RestartDeployment ¶ added in v1.0.0
func (_m *MockKubernetesConnector) RestartDeployment(ctx context.Context, name string, namespace string) error
RestartDeployment provides a mock function with given fields: ctx, name, namespace
func (*MockKubernetesConnector) SetDatabaseEngineLock ¶
func (_m *MockKubernetesConnector) SetDatabaseEngineLock(ctx context.Context, namespace string, name string, locked bool) error
SetDatabaseEngineLock provides a mock function with given fields: ctx, namespace, name, locked
func (*MockKubernetesConnector) SetSecret ¶ added in v1.0.0
func (_m *MockKubernetesConnector) SetSecret(secret *v1.Secret) error
SetSecret provides a mock function with given fields: secret
func (*MockKubernetesConnector) UpdateBackupStorage ¶ added in v1.2.0
func (_m *MockKubernetesConnector) UpdateBackupStorage(ctx context.Context, storage *v1alpha1.BackupStorage) error
UpdateBackupStorage provides a mock function with given fields: ctx, storage
func (*MockKubernetesConnector) UpdateDatabaseEngine ¶
func (_m *MockKubernetesConnector) UpdateDatabaseEngine(ctx context.Context, namespace string, engine *v1alpha1.DatabaseEngine) (*v1alpha1.DatabaseEngine, error)
UpdateDatabaseEngine provides a mock function with given fields: ctx, namespace, engine
func (*MockKubernetesConnector) UpdateDeployment ¶ added in v1.0.0
func (_m *MockKubernetesConnector) UpdateDeployment(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
UpdateDeployment provides a mock function with given fields: ctx, deployment
func (*MockKubernetesConnector) UpdateEverestSettings ¶ added in v1.0.0
func (_m *MockKubernetesConnector) UpdateEverestSettings(ctx context.Context, settings common.EverestSettings) error
UpdateEverestSettings provides a mock function with given fields: ctx, settings
func (*MockKubernetesConnector) UpdateMonitoringConfig ¶ added in v1.2.0
func (_m *MockKubernetesConnector) UpdateMonitoringConfig(ctx context.Context, storage *v1alpha1.MonitoringConfig) error
UpdateMonitoringConfig provides a mock function with given fields: ctx, storage
func (*MockKubernetesConnector) UpdateNamespace ¶ added in v1.0.0
func (_m *MockKubernetesConnector) UpdateNamespace(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error)
UpdateNamespace provides a mock function with given fields: ctx, namespace, opts
func (*MockKubernetesConnector) UpdateSecret ¶ added in v1.0.0
func (_m *MockKubernetesConnector) UpdateSecret(ctx context.Context, secret *v1.Secret) (*v1.Secret, error)
UpdateSecret provides a mock function with given fields: ctx, secret
func (*MockKubernetesConnector) WaitForRollout ¶ added in v0.10.0
func (_m *MockKubernetesConnector) WaitForRollout(ctx context.Context, name string, namespace string) error
WaitForRollout provides a mock function with given fields: ctx, name, namespace
func (*MockKubernetesConnector) WithClient ¶ added in v1.0.0
func (_m *MockKubernetesConnector) WithClient(c client.KubeClientConnector) *Kubernetes
WithClient provides a mock function with given fields: c
type NodeFileSystemSummary ¶
type NodeFileSystemSummary struct {
UsedBytes uint64 `json:"usedBytes,omitempty"`
}
NodeFileSystemSummary holds a summary of Node's filesystem.
type NodeSummary ¶
type NodeSummary struct {
Node NodeSummaryNode `json:"node,omitempty"`
}
NodeSummary holds summary of the Node. One gets this by requesting Kubernetes API endpoint: /v1/nodes/<node-name>/proxy/stats/summary.
type NodeSummaryNode ¶
type NodeSummaryNode struct {
FileSystem NodeFileSystemSummary `json:"fs,omitempty"`
}
NodeSummaryNode holds information about Node inside Node's summary.
Source Files ¶
- accounts.go
- backup_storage.go
- configmap.go
- container.go
- database_cluster.go
- database_cluster_backup.go
- database_cluster_restore.go
- database_engine.go
- deployment.go
- gen.go
- install_plan.go
- jwt.go
- kubeconfig.go
- kubernetes.go
- kubernetes_interface.go
- mock_kubernetes_connector.go
- monitoring.go
- monitoring_config.go
- namespace.go
- node.go
- oidc.go
- operator.go
- pod.go
- resources.go
- role.go
- secret.go
- service_account.go
- storage.go
Directories ¶
Path | Synopsis |
---|---|
Package client ...
|
Package client ... |
accounts
Package accounts provides functionality for managing Everest user accounts
|
Package accounts provides functionality for managing Everest user accounts |
customresources
Package customresources provides methods to work with custom everest k8s resources.
|
Package customresources provides methods to work with custom everest k8s resources. |
database
Package database TODO
|
Package database TODO |
Package informer provides generic utilities to work with Kubernetes informers.
|
Package informer provides generic utilities to work with Kubernetes informers. |