kubernetes

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Overview

Package kubernetes ...

Package kubernetes ...

Package kubernetes ...

Package kubernetes ...

Package kubernetes provides functionality for kubernetes.

Package kubernetes ...

Index

Constants

This section is empty.

Variables

View Source
var ErrOperatorNotInstalled = fmt.Errorf("operatorNotInstalled")

ErrOperatorNotInstalled is returned when an operator is not installed.

Functions

func CreateScheme added in v1.7.0

func CreateScheme() *runtime.Scheme

CreateScheme creates a new runtime.Scheme. It registers all necessary types: - standard client-go types - Everest CRDs - OLM CRDs - API extensions

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"

	// OLMNamespace is the namespace where OLM is installed.
	OLMNamespace = "everest-olm"
)

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 Kubernetes

type Kubernetes struct {
	// contains filtered or unexported fields
}

Kubernetes is a client for Kubernetes.

func NewEmpty

func NewEmpty(l *zap.SugaredLogger) *Kubernetes

NewEmpty returns new empty Kubernetes object. useful for testing.

func (*Kubernetes) Accounts added in v1.0.0

func (k *Kubernetes) Accounts() accounts.Interface

Accounts returns an implementation of the accounts interface that manages everest accounts directly via ConfigMaps.

func (*Kubernetes) ApplyManifestFile added in v1.4.0

func (k *Kubernetes) ApplyManifestFile(ctx context.Context, fileBytes []byte, namespace string, ignoreObjects ...ctrlclient.Object) error

ApplyManifestFile accepts manifest file contents, parses into []runtime.Object and applies them against the cluster.

func (*Kubernetes) ApplyObject

func (k *Kubernetes) ApplyObject(obj runtime.Object) error

ApplyObject applies object.

func (*Kubernetes) ApproveInstallPlan added in v0.10.0

func (k *Kubernetes) ApproveInstallPlan(ctx context.Context, key ctrlclient.ObjectKey) (bool, error)

ApproveInstallPlan approves OLM install plan that matches the criteria.

func (*Kubernetes) Config

func (k *Kubernetes) Config() *rest.Config

Config returns *rest.Config.

func (*Kubernetes) CreateBackupStorage

func (k *Kubernetes) CreateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) (*everestv1alpha1.BackupStorage, error)

CreateBackupStorage creates backup storages by provided object.

func (*Kubernetes) CreateConfigMap added in v1.7.0

func (k *Kubernetes) CreateConfigMap(ctx context.Context, config *corev1.ConfigMap) (*corev1.ConfigMap, error)

CreateConfigMap creates k8s configmap.

func (*Kubernetes) CreateDatabaseCluster

func (k *Kubernetes) CreateDatabaseCluster(ctx context.Context, cluster *everestv1alpha1.DatabaseCluster) (*everestv1alpha1.DatabaseCluster, error)

CreateDatabaseCluster creates database cluster.

func (*Kubernetes) CreateDatabaseClusterBackup added in v1.5.0

CreateDatabaseClusterBackup creates database cluster backup.

func (*Kubernetes) CreateDatabaseClusterRestore added in v1.5.0

CreateDatabaseClusterRestore creates database cluster restore.

func (*Kubernetes) CreateLoadBalancerConfig added in v1.9.0

CreateLoadBalancerConfig creates load balancer config.

func (*Kubernetes) CreateMonitoringConfig

CreateMonitoringConfig creates monitoring config.

func (*Kubernetes) CreateNamespace

func (k *Kubernetes) CreateNamespace(ctx context.Context, namespace *corev1.Namespace) (*corev1.Namespace, error)

CreateNamespace creates the given namespace.

func (*Kubernetes) CreatePodSchedulingPolicy added in v1.7.0

CreatePodSchedulingPolicy creates pod scheduling policy.

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) CreateSecret

func (k *Kubernetes) CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)

CreateSecret creates a secret.

func (*Kubernetes) CreateSplitHorizonDNSConfig added in v1.10.0

CreateSplitHorizonDNSConfig creates a SplitHorizonDNSConfig resource in Kubernetes.

func (*Kubernetes) DatabasesExist added in v1.4.0

func (k *Kubernetes) DatabasesExist(ctx context.Context, opts ...ctrlclient.ListOption) (bool, error)

DatabasesExist checks if there are databases that match criteria exist.

func (*Kubernetes) DeleteBackupStorage

func (k *Kubernetes) DeleteBackupStorage(ctx context.Context, obj *everestv1alpha1.BackupStorage) error

DeleteBackupStorage deletes backup storage by provided name and namespace.

func (*Kubernetes) DeleteBackupStorages added in v1.4.0

func (k *Kubernetes) DeleteBackupStorages(ctx context.Context, opts ...ctrlclient.ListOption) error

DeleteBackupStorages deletes all backup storages in provided namespace. This function will wait until all storages are deleted.

func (*Kubernetes) DeleteCRD added in v1.4.0

DeleteCRD deletes a CRD that matches the criteria.

func (*Kubernetes) DeleteCatalogSource added in v1.4.0

func (k *Kubernetes) DeleteCatalogSource(ctx context.Context, obj *olmv1alpha1.CatalogSource) error

DeleteCatalogSource deletes catalog source that matches the criteria.

func (*Kubernetes) DeleteClusterServiceVersion

func (k *Kubernetes) DeleteClusterServiceVersion(ctx context.Context, obj *olmv1alpha1.ClusterServiceVersion) error

DeleteClusterServiceVersion deletes a ClusterServiceVersion that matches the criteria.

func (*Kubernetes) DeleteClusterServiceVersions added in v1.7.0

func (k *Kubernetes) DeleteClusterServiceVersions(ctx context.Context, opts ...ctrlclient.ListOption) error

DeleteClusterServiceVersions deletes all ClusterServiceVersion that match the criteria. This function will wait until all ClusterServiceVersion are deleted.

func (*Kubernetes) DeleteDatabaseCluster

func (k *Kubernetes) DeleteDatabaseCluster(ctx context.Context, obj *everestv1alpha1.DatabaseCluster) error

DeleteDatabaseCluster deletes database cluster that matches the criteria.

func (*Kubernetes) DeleteDatabaseClusterBackup added in v1.5.0

func (k *Kubernetes) DeleteDatabaseClusterBackup(ctx context.Context, obj *everestv1alpha1.DatabaseClusterBackup) error

DeleteDatabaseClusterBackup deletes database cluster backup that matches the criteria.

func (*Kubernetes) DeleteDatabaseClusterRestore added in v1.5.0

func (k *Kubernetes) DeleteDatabaseClusterRestore(ctx context.Context, obj *everestv1alpha1.DatabaseClusterRestore) error

DeleteDatabaseClusterRestore deletes database cluster restore that matches the criteria.

func (*Kubernetes) DeleteDatabaseClusters added in v1.4.0

func (k *Kubernetes) DeleteDatabaseClusters(ctx context.Context, opts ...ctrlclient.ListOption) error

DeleteDatabaseClusters deletes all database clusters that match the criteria. This function will wait until all clusters are deleted.

func (*Kubernetes) DeleteDeployment added in v1.4.0

func (k *Kubernetes) DeleteDeployment(ctx context.Context, obj *appsv1.Deployment) error

DeleteDeployment deletes a deployment that matches the criteria.

func (*Kubernetes) DeleteLoadBalancerConfig added in v1.9.0

func (k *Kubernetes) DeleteLoadBalancerConfig(ctx context.Context, obj *everestv1alpha1.LoadBalancerConfig) error

DeleteLoadBalancerConfig deletes load balancer config that matches the criteria.

func (*Kubernetes) DeleteMonitoringConfig

func (k *Kubernetes) DeleteMonitoringConfig(ctx context.Context, obj *everestv1alpha1.MonitoringConfig) error

DeleteMonitoringConfig deletes monitoring config that matches the criteria.

func (*Kubernetes) DeleteMonitoringConfigs added in v1.4.0

func (k *Kubernetes) DeleteMonitoringConfigs(ctx context.Context, opts ...ctrlclient.ListOption) error

DeleteMonitoringConfigs deletes monitoring configs that matches the criteria. This function will wait until all configs are deleted.

func (*Kubernetes) DeleteNamespace

func (k *Kubernetes) DeleteNamespace(ctx context.Context, obj *corev1.Namespace) error

DeleteNamespace deletes a namespace that matches the criteria.

func (*Kubernetes) DeletePodSchedulingPolicy added in v1.7.0

func (k *Kubernetes) DeletePodSchedulingPolicy(ctx context.Context, obj *everestv1alpha1.PodSchedulingPolicy) error

DeletePodSchedulingPolicy deletes pod scheduling policy that matches the criteria.

func (*Kubernetes) DeleteSecret

func (k *Kubernetes) DeleteSecret(ctx context.Context, obj *corev1.Secret) error

DeleteSecret deletes a secret that matches the criteria.

func (*Kubernetes) DeleteSplitHorizonDNSConfig added in v1.10.0

func (k *Kubernetes) DeleteSplitHorizonDNSConfig(ctx context.Context, shdc *enginefeaturesv1alpha1.SplitHorizonDNSConfig) error

DeleteSplitHorizonDNSConfig deletes a SplitHorizonDNSConfig resource in Kubernetes.

func (*Kubernetes) DeleteSubscription added in v1.4.0

func (k *Kubernetes) DeleteSubscription(ctx context.Context, obj *olmv1alpha1.Subscription) error

DeleteSubscription deletes OLM subscription that matches the criteria.

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

GetBackupStorage returns backup storages(full object) by provided name and namespace.

func (*Kubernetes) GetBackupStorageMeta added in v1.8.0

func (k *Kubernetes) GetBackupStorageMeta(ctx context.Context, key ctrlclient.ObjectKey) (*metav1.PartialObjectMetadata, error)

GetBackupStorageMeta returns backup storages(metadata only) by provided name and namespace.

func (*Kubernetes) GetCatalogSource added in v1.4.0

func (k *Kubernetes) GetCatalogSource(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.CatalogSource, error)

GetCatalogSource returns catalog source that matches the criteria.

func (*Kubernetes) GetClusterServiceVersion

func (k *Kubernetes) GetClusterServiceVersion(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.ClusterServiceVersion, error)

GetClusterServiceVersion retrieves a ClusterServiceVersion that matches the criteria.

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, key ctrlclient.ObjectKey) (*corev1.ConfigMap, error)

GetConfigMap returns k8s configmap that matches the criteria.

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, opts ...ctrlclient.ListOption) (*corev1.NamespaceList, error)

GetDBNamespaces returns a list of DB namespaces that managed by the Everest and match the criteria.

func (*Kubernetes) GetDatabaseCluster

func (k *Kubernetes) GetDatabaseCluster(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.DatabaseCluster, error)

GetDatabaseCluster returns database cluster that matches the criteria.

func (*Kubernetes) GetDatabaseClusterBackup

func (k *Kubernetes) GetDatabaseClusterBackup(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.DatabaseClusterBackup, error)

GetDatabaseClusterBackup returns database cluster backup that matches the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) GetDatabaseClusterRestore

func (k *Kubernetes) GetDatabaseClusterRestore(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.DatabaseClusterRestore, error)

GetDatabaseClusterRestore returns database cluster restore that matches the criteria.

func (*Kubernetes) GetDatabaseEngine

GetDatabaseEngine returns database engine that matches the criteria.

func (*Kubernetes) GetDeployment

func (k *Kubernetes) GetDeployment(ctx context.Context, key ctrlclient.ObjectKey) (*appsv1.Deployment, error)

GetDeployment returns k8s deployment that matches the criteria.

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) GetInstallPlan added in v1.7.0

func (k *Kubernetes) GetInstallPlan(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.InstallPlan, error)

GetInstallPlan retrieves an OLM install plan that matches the criteria.

func (*Kubernetes) GetInstalledOperatorVersion added in v1.7.0

func (k *Kubernetes) GetInstalledOperatorVersion(ctx context.Context, key ctrlclient.ObjectKey) (*goversion.Version, error)

GetInstalledOperatorVersion returns the version of installed operator that matches the criteria.

func (*Kubernetes) GetLoadBalancerConfig added in v1.9.0

func (k *Kubernetes) GetLoadBalancerConfig(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.LoadBalancerConfig, error)

GetLoadBalancerConfig returns load balancer config(full object) that matches the criteria.

func (*Kubernetes) GetMonitoringConfig

func (k *Kubernetes) GetMonitoringConfig(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.MonitoringConfig, error)

GetMonitoringConfig returns monitoring config(full object) that matches the criteria.

func (*Kubernetes) GetMonitoringConfigMeta added in v1.8.0

func (k *Kubernetes) GetMonitoringConfigMeta(ctx context.Context, key ctrlclient.ObjectKey) (*metav1.PartialObjectMetadata, error)

GetMonitoringConfigMeta returns monitoring config(metadata only) that matches the criteria.

func (*Kubernetes) GetNamespace

func (k *Kubernetes) GetNamespace(ctx context.Context, key ctrlclient.ObjectKey) (*corev1.Namespace, error)

GetNamespace returns a namespace that matches the criteria.

func (*Kubernetes) GetPodSchedulingPolicy added in v1.7.0

func (k *Kubernetes) GetPodSchedulingPolicy(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.PodSchedulingPolicy, error)

GetPodSchedulingPolicy returns pod scheduling policy(full object) that matches the criteria.

func (*Kubernetes) GetPodSchedulingPolicyMeta added in v1.8.0

func (k *Kubernetes) GetPodSchedulingPolicyMeta(ctx context.Context, key ctrlclient.ObjectKey) (*metav1.PartialObjectMetadata, error)

GetPodSchedulingPolicyMeta returns pod scheduling policy(metadata only) that matches the criteria.

func (*Kubernetes) GetSecret

func (k *Kubernetes) GetSecret(ctx context.Context, key ctrlclient.ObjectKey) (*corev1.Secret, error)

GetSecret returns a secret that matches the criteria.

func (*Kubernetes) GetService added in v1.7.0

func (k *Kubernetes) GetService(ctx context.Context, key ctrlclient.ObjectKey) (*corev1.Service, error)

GetService returns service that matches the criteria.

func (*Kubernetes) GetSplitHorizonDNSConfig added in v1.10.0

GetSplitHorizonDNSConfig retrieves a SplitHorizonDNSConfig resource from Kubernetes by its namespaced name.

func (*Kubernetes) GetSubscription added in v1.4.0

func (k *Kubernetes) GetSubscription(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.Subscription, error)

GetSubscription returns OLM subscription that matches the criteria.

func (*Kubernetes) Kubeconfig added in v1.4.0

func (k *Kubernetes) Kubeconfig() string

Kubeconfig returns the path to the kubeconfig. This value is available only if the client was created with New() function.

func (*Kubernetes) ListBackupStorages

func (k *Kubernetes) ListBackupStorages(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.BackupStorageList, error)

ListBackupStorages returns list of managed backup storages in a given namespace. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListCRDs added in v1.4.0

ListCRDs lists all CRDs that match the criteria.

func (*Kubernetes) ListClusterServiceVersion

func (k *Kubernetes) ListClusterServiceVersion(ctx context.Context, opts ...ctrlclient.ListOption) (*olmv1alpha1.ClusterServiceVersionList, error)

ListClusterServiceVersion list all CSVs that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListDataImportJobs added in v1.8.0

func (k *Kubernetes) ListDataImportJobs(ctx context.Context, namespace, dbName string, opts ...ctrlclient.ListOption) (*everestv1alpha1.DataImportJobList, error)

ListDataImportJobs lists all DataImportJobs for the specified database cluster.

func (*Kubernetes) ListDataImporters added in v1.8.0

func (k *Kubernetes) ListDataImporters(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DataImporterList, error)

ListDataImporters lists all DataImporters in the cluster.

func (*Kubernetes) ListDatabaseClusterBackups

func (k *Kubernetes) ListDatabaseClusterBackups(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseClusterBackupList, error)

ListDatabaseClusterBackups returns database cluster backups that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListDatabaseClusterRestores

func (k *Kubernetes) ListDatabaseClusterRestores(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseClusterRestoreList, error)

ListDatabaseClusterRestores returns database cluster restores that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListDatabaseClusters

func (k *Kubernetes) ListDatabaseClusters(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseClusterList, error)

ListDatabaseClusters returns list of managed database clusters that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListDatabaseEngines

func (k *Kubernetes) ListDatabaseEngines(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseEngineList, error)

ListDatabaseEngines returns list of managed database engines that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListDeployments added in v1.4.0

func (k *Kubernetes) ListDeployments(ctx context.Context, opts ...ctrlclient.ListOption) (*appsv1.DeploymentList, error)

ListDeployments returns a list of deployments that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListInstalledOperators added in v1.7.0

func (k *Kubernetes) ListInstalledOperators(ctx context.Context, opts ...ctrlclient.ListOption) (*olmv1alpha1.SubscriptionList, error)

ListInstalledOperators returns the list of installed operators that match the criteria.

func (*Kubernetes) ListLoadBalancerConfigs added in v1.9.0

func (k *Kubernetes) ListLoadBalancerConfigs(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.LoadBalancerConfigList, error)

ListLoadBalancerConfigs returns a list of load balancer config that matches the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListMonitoringConfigs

func (k *Kubernetes) ListMonitoringConfigs(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.MonitoringConfigList, error)

ListMonitoringConfigs returns list of managed monitoring configs that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListNamespaces added in v1.0.0

func (k *Kubernetes) ListNamespaces(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.NamespaceList, error)

ListNamespaces lists all namespaces that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListPersistentVolumes added in v1.7.0

func (k *Kubernetes) ListPersistentVolumes(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.PersistentVolumeList, error)

ListPersistentVolumes returns list of persistent volumes that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListPodSchedulingPolicies added in v1.7.0

func (k *Kubernetes) ListPodSchedulingPolicies(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.PodSchedulingPolicyList, error)

ListPodSchedulingPolicies returns a list of pod scheduling policy that matches the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListPods added in v1.7.0

func (k *Kubernetes) ListPods(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.PodList, error)

ListPods returns list of pods that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListSecrets

func (k *Kubernetes) ListSecrets(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.SecretList, error)

ListSecrets returns list of secrets that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListSplitHorizonDNSConfigs added in v1.10.0

func (k *Kubernetes) ListSplitHorizonDNSConfigs(ctx context.Context, opts ...ctrlclient.ListOption) (*enginefeaturesv1alpha1.SplitHorizonDNSConfigList, error)

ListSplitHorizonDNSConfigs lists all SplitHorizonDNSConfig resources in Kubernetes that match the provided options.

func (*Kubernetes) ListStorageClasses added in v1.7.0

func (k *Kubernetes) ListStorageClasses(ctx context.Context, opts ...ctrlclient.ListOption) (*storagev1.StorageClassList, error)

ListStorageClasses returns list of storage classes that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListSubscriptions

func (k *Kubernetes) ListSubscriptions(ctx context.Context, opts ...ctrlclient.ListOption) (*olmv1alpha1.SubscriptionList, error)

ListSubscriptions lists OLM subscriptions that match the criteria. This method returns a list of full objects (meta and spec).

func (*Kubernetes) ListWorkerNodes added in v1.7.0

func (k *Kubernetes) ListWorkerNodes(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.NodeList, error)

ListWorkerNodes returns list of cluster workers nodes. This method returns a list of full objects (meta and spec). It filters out nodes with the following taints: - node.cloudprovider.kubernetes.io/uninitialized=NoSchedule - node.kubernetes.io/unschedulable=NoSchedule - node-role.kubernetes.io/master=NoSchedule

func (*Kubernetes) Namespace

func (k *Kubernetes) Namespace() string

Namespace returns the Everest system namespace.

func (*Kubernetes) RestartDeployment added in v1.0.0

func (k *Kubernetes) RestartDeployment(ctx context.Context, key ctrlclient.ObjectKey) error

RestartDeployment restarts deployment that matches the criteria.

func (*Kubernetes) SetDatabaseEngineLock added in v1.0.0

func (k *Kubernetes) SetDatabaseEngineLock(ctx context.Context, key ctrlclient.ObjectKey, locked bool) error

SetDatabaseEngineLock sets the lock on the database engine that matches the criteria. The lock is automatically set to false once everest-operator completes its upgrade.

func (*Kubernetes) UpdateBackupStorage

func (k *Kubernetes) UpdateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) (*everestv1alpha1.BackupStorage, error)

UpdateBackupStorage updates backup storages by provided new object.

func (*Kubernetes) UpdateConfigMap added in v1.7.0

func (k *Kubernetes) UpdateConfigMap(ctx context.Context, config *corev1.ConfigMap) (*corev1.ConfigMap, error)

UpdateConfigMap updates k8s configmap.

func (*Kubernetes) UpdateDatabaseCluster added in v1.5.0

func (k *Kubernetes) UpdateDatabaseCluster(ctx context.Context, cluster *everestv1alpha1.DatabaseCluster) (*everestv1alpha1.DatabaseCluster, error)

UpdateDatabaseCluster updates database cluster.

func (*Kubernetes) UpdateDatabaseClusterBackup added in v0.10.0

UpdateDatabaseClusterBackup updates database cluster backup.

func (*Kubernetes) UpdateDatabaseClusterRestore added in v1.5.0

UpdateDatabaseClusterRestore updates database cluster restore.

func (*Kubernetes) UpdateDatabaseEngine added in v0.10.0

func (k *Kubernetes) UpdateDatabaseEngine(ctx context.Context, 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) UpdateInstallPlan added in v1.7.0

func (k *Kubernetes) UpdateInstallPlan(ctx context.Context, installPlan *olmv1alpha1.InstallPlan) (*olmv1alpha1.InstallPlan, error)

UpdateInstallPlan updates OLM install plan.

func (*Kubernetes) UpdateLoadBalancerConfig added in v1.9.0

UpdateLoadBalancerConfig updates load balancer config.

func (*Kubernetes) UpdateMonitoringConfig

UpdateMonitoringConfig updates monitoring config.

func (*Kubernetes) UpdateNamespace added in v1.0.0

func (k *Kubernetes) UpdateNamespace(ctx context.Context, namespace *corev1.Namespace) (*corev1.Namespace, error)

UpdateNamespace updates the given namespace.

func (*Kubernetes) UpdatePodSchedulingPolicy added in v1.7.0

UpdatePodSchedulingPolicy updates pod scheduling policy.

func (*Kubernetes) UpdateSecret

func (k *Kubernetes) UpdateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)

UpdateSecret updates a secret.

func (*Kubernetes) UpdateSplitHorizonDNSConfig added in v1.10.0

UpdateSplitHorizonDNSConfig updates an existing SplitHorizonDNSConfig resource in Kubernetes.

func (*Kubernetes) WaitForRollout

func (k *Kubernetes) WaitForRollout(ctx context.Context, key ctrlclient.ObjectKey) error

WaitForRollout waits for rollout of deployment that matches the criteria.

func (*Kubernetes) WithKubernetesClient added in v1.7.0

func (k *Kubernetes) WithKubernetesClient(c ctrlclient.Client) *Kubernetes

WithKubernetesClient sets the k8s client.

type KubernetesConnector added in v0.10.0

type KubernetesConnector interface {
	// Accounts returns an implementation of the accounts interface that
	// manages everest accounts directly via ConfigMaps.
	Accounts() accounts.Interface
	// ListBackupStorages returns list of managed backup storages in a given namespace.
	// This method returns a list of full objects (meta and spec).
	ListBackupStorages(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.BackupStorageList, error)
	// GetBackupStorage returns backup storages(full object) by provided name and namespace.
	GetBackupStorage(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.BackupStorage, error)
	// GetBackupStorageMeta returns backup storages(metadata only) by provided name and namespace.
	GetBackupStorageMeta(ctx context.Context, key ctrlclient.ObjectKey) (*metav1.PartialObjectMetadata, error)
	// CreateBackupStorage creates backup storages by provided object.
	CreateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) (*everestv1alpha1.BackupStorage, error)
	// UpdateBackupStorage updates backup storages by provided new object.
	UpdateBackupStorage(ctx context.Context, storage *everestv1alpha1.BackupStorage) (*everestv1alpha1.BackupStorage, error)
	// DeleteBackupStorage deletes backup storage by provided name and namespace.
	DeleteBackupStorage(ctx context.Context, obj *everestv1alpha1.BackupStorage) error
	// DeleteBackupStorages deletes all backup storages in provided namespace.
	// This function will wait until all storages are deleted.
	DeleteBackupStorages(ctx context.Context, opts ...ctrlclient.ListOption) error
	// GetCatalogSource returns catalog source that matches the criteria.
	GetCatalogSource(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.CatalogSource, error)
	// DeleteCatalogSource deletes catalog source that matches the criteria.
	DeleteCatalogSource(ctx context.Context, obj *olmv1alpha1.CatalogSource) error
	// GetConfigMap returns k8s configmap that matches the criteria.
	GetConfigMap(ctx context.Context, key ctrlclient.ObjectKey) (*corev1.ConfigMap, error)
	// CreateConfigMap creates k8s configmap.
	CreateConfigMap(ctx context.Context, config *corev1.ConfigMap) (*corev1.ConfigMap, error)
	// UpdateConfigMap updates k8s configmap.
	UpdateConfigMap(ctx context.Context, config *corev1.ConfigMap) (*corev1.ConfigMap, error)
	// GetClusterServiceVersion retrieves a ClusterServiceVersion that matches the criteria.
	GetClusterServiceVersion(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.ClusterServiceVersion, error)
	// ListClusterServiceVersion list all CSVs that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListClusterServiceVersion(ctx context.Context, opts ...ctrlclient.ListOption) (*olmv1alpha1.ClusterServiceVersionList, error)
	// DeleteClusterServiceVersion deletes a ClusterServiceVersion that matches the criteria.
	DeleteClusterServiceVersion(ctx context.Context, obj *olmv1alpha1.ClusterServiceVersion) error
	// DeleteClusterServiceVersions deletes all ClusterServiceVersion that match the criteria.
	// This function will wait until all ClusterServiceVersion are deleted.
	DeleteClusterServiceVersions(ctx context.Context, opts ...ctrlclient.ListOption) error
	// ListCRDs lists all CRDs that match the criteria.
	ListCRDs(ctx context.Context, opts ...ctrlclient.ListOption) (*apiextv1.CustomResourceDefinitionList, error)
	// DeleteCRD deletes a CRD that matches the criteria.
	DeleteCRD(ctx context.Context, obj *apiextv1.CustomResourceDefinition) error
	// ListDatabaseClusters returns list of managed database clusters that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListDatabaseClusters(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseClusterList, error)
	// GetDatabaseCluster returns database cluster that matches the criteria.
	GetDatabaseCluster(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.DatabaseCluster, error)
	// DeleteDatabaseCluster deletes database cluster that matches the criteria.
	DeleteDatabaseCluster(ctx context.Context, obj *everestv1alpha1.DatabaseCluster) error
	// CreateDatabaseCluster creates database cluster.
	CreateDatabaseCluster(ctx context.Context, cluster *everestv1alpha1.DatabaseCluster) (*everestv1alpha1.DatabaseCluster, error)
	// UpdateDatabaseCluster updates database cluster.
	UpdateDatabaseCluster(ctx context.Context, cluster *everestv1alpha1.DatabaseCluster) (*everestv1alpha1.DatabaseCluster, error)
	// DeleteDatabaseClusters deletes all database clusters that match the criteria.
	// This function will wait until all clusters are deleted.
	DeleteDatabaseClusters(ctx context.Context, opts ...ctrlclient.ListOption) error
	// DatabasesExist checks if there are databases that match criteria exist.
	DatabasesExist(ctx context.Context, opts ...ctrlclient.ListOption) (bool, error)
	// GetDatabaseClusterBackup returns database cluster backup that matches the criteria.
	// This method returns a list of full objects (meta and spec).
	GetDatabaseClusterBackup(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.DatabaseClusterBackup, error)
	// ListDatabaseClusterBackups returns database cluster backups that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListDatabaseClusterBackups(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseClusterBackupList, error)
	// UpdateDatabaseClusterBackup updates database cluster backup.
	UpdateDatabaseClusterBackup(ctx context.Context, backup *everestv1alpha1.DatabaseClusterBackup) (*everestv1alpha1.DatabaseClusterBackup, error)
	// DeleteDatabaseClusterBackup deletes database cluster backup that matches the criteria.
	DeleteDatabaseClusterBackup(ctx context.Context, obj *everestv1alpha1.DatabaseClusterBackup) error
	// CreateDatabaseClusterBackup creates database cluster backup.
	CreateDatabaseClusterBackup(ctx context.Context, backup *everestv1alpha1.DatabaseClusterBackup) (*everestv1alpha1.DatabaseClusterBackup, error)
	// GetDatabaseClusterRestore returns database cluster restore that matches the criteria.
	GetDatabaseClusterRestore(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.DatabaseClusterRestore, error)
	// ListDatabaseClusterRestores returns database cluster restores that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListDatabaseClusterRestores(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseClusterRestoreList, error)
	// UpdateDatabaseClusterRestore updates database cluster restore.
	UpdateDatabaseClusterRestore(ctx context.Context, restore *everestv1alpha1.DatabaseClusterRestore) (*everestv1alpha1.DatabaseClusterRestore, error)
	// DeleteDatabaseClusterRestore deletes database cluster restore that matches the criteria.
	DeleteDatabaseClusterRestore(ctx context.Context, obj *everestv1alpha1.DatabaseClusterRestore) error
	// CreateDatabaseClusterRestore creates database cluster restore.
	CreateDatabaseClusterRestore(ctx context.Context, restore *everestv1alpha1.DatabaseClusterRestore) (*everestv1alpha1.DatabaseClusterRestore, error)
	// ListDatabaseEngines returns list of managed database engines that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListDatabaseEngines(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DatabaseEngineList, error)
	// GetDatabaseEngine returns database engine that matches the criteria.
	GetDatabaseEngine(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.DatabaseEngine, error)
	// UpdateDatabaseEngine updates the provided database engine.
	UpdateDatabaseEngine(ctx context.Context, engine *everestv1alpha1.DatabaseEngine) (*everestv1alpha1.DatabaseEngine, error)
	// SetDatabaseEngineLock sets the lock on the database engine that matches the criteria.
	// The lock is automatically set to false once everest-operator completes its upgrade.
	SetDatabaseEngineLock(ctx context.Context, key ctrlclient.ObjectKey, locked bool) error
	// ListDataImporters lists all DataImporters in the cluster.
	ListDataImporters(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.DataImporterList, error)
	// ListDataImportJobs lists all DataImportJobs for the specified database cluster.
	ListDataImportJobs(ctx context.Context, namespace, dbName string, opts ...ctrlclient.ListOption) (*everestv1alpha1.DataImportJobList, error)
	// GetDeployment returns k8s deployment that matches the criteria.
	GetDeployment(ctx context.Context, key ctrlclient.ObjectKey) (*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 that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListDeployments(ctx context.Context, opts ...ctrlclient.ListOption) (*appsv1.DeploymentList, error)
	// DeleteDeployment deletes a deployment that matches the criteria.
	DeleteDeployment(ctx context.Context, obj *appsv1.Deployment) error
	// RestartDeployment restarts deployment that matches the criteria.
	RestartDeployment(ctx context.Context, key ctrlclient.ObjectKey) error
	// WaitForRollout waits for rollout of deployment that matches the criteria.
	WaitForRollout(ctx context.Context, key ctrlclient.ObjectKey) error
	// GetInstallPlan retrieves an OLM install plan that matches the criteria.
	GetInstallPlan(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.InstallPlan, error)
	// UpdateInstallPlan updates OLM install plan.
	UpdateInstallPlan(ctx context.Context, installPlan *olmv1alpha1.InstallPlan) (*olmv1alpha1.InstallPlan, error)
	// ApproveInstallPlan approves OLM install plan that matches the criteria.
	ApproveInstallPlan(ctx context.Context, key ctrlclient.ObjectKey) (bool, error)
	// Kubeconfig returns the path to the kubeconfig.
	// This value is available only if the client was created with New() function.
	Kubeconfig() string
	// Config returns *rest.Config.
	Config() *rest.Config
	// WithKubernetesClient sets the k8s client.
	WithKubernetesClient(c ctrlclient.Client) *Kubernetes
	// Namespace returns the Everest system namespace.
	Namespace() 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)
	// ListMonitoringConfigs returns list of managed monitoring configs that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListMonitoringConfigs(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.MonitoringConfigList, error)
	// GetMonitoringConfig returns monitoring config(full object) that matches the criteria.
	GetMonitoringConfig(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.MonitoringConfig, error)
	// GetMonitoringConfigMeta returns monitoring config(metadata only) that matches the criteria.
	GetMonitoringConfigMeta(ctx context.Context, key ctrlclient.ObjectKey) (*metav1.PartialObjectMetadata, error)
	// CreateMonitoringConfig creates monitoring config.
	CreateMonitoringConfig(ctx context.Context, config *everestv1alpha1.MonitoringConfig) (*everestv1alpha1.MonitoringConfig, error)
	// UpdateMonitoringConfig updates monitoring config.
	UpdateMonitoringConfig(ctx context.Context, config *everestv1alpha1.MonitoringConfig) (*everestv1alpha1.MonitoringConfig, error)
	// DeleteMonitoringConfig deletes monitoring config that matches the criteria.
	DeleteMonitoringConfig(ctx context.Context, obj *everestv1alpha1.MonitoringConfig) error
	// DeleteMonitoringConfigs deletes monitoring configs that matches the criteria.
	// This function will wait until all configs are deleted.
	DeleteMonitoringConfigs(ctx context.Context, opts ...ctrlclient.ListOption) error
	// CreateNamespace creates the given namespace.
	CreateNamespace(ctx context.Context, namespace *corev1.Namespace) (*corev1.Namespace, error)
	// GetNamespace returns a namespace that matches the criteria.
	GetNamespace(ctx context.Context, key ctrlclient.ObjectKey) (*corev1.Namespace, error)
	// GetDBNamespaces returns a list of DB namespaces that managed by the Everest and match the criteria.
	GetDBNamespaces(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.NamespaceList, error)
	// DeleteNamespace deletes a namespace that matches the criteria.
	DeleteNamespace(ctx context.Context, obj *corev1.Namespace) error
	// ListNamespaces lists all namespaces that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListNamespaces(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.NamespaceList, error)
	// UpdateNamespace updates the given namespace.
	UpdateNamespace(ctx context.Context, namespace *corev1.Namespace) (*corev1.Namespace, error)
	// ApplyManifestFile accepts manifest file contents, parses into []runtime.Object
	// and applies them against the cluster.
	ApplyManifestFile(ctx context.Context, fileBytes []byte, namespace string, ignoreObjects ...ctrlclient.Object) error
	// ApplyObject applies object.
	ApplyObject(obj runtime.Object) error
	// GetInstalledOperatorVersion returns the version of installed operator that matches the criteria.
	GetInstalledOperatorVersion(ctx context.Context, key ctrlclient.ObjectKey) (*goversion.Version, error)
	// ListInstalledOperators returns the list of installed operators that match the criteria.
	ListInstalledOperators(ctx context.Context, opts ...ctrlclient.ListOption) (*olmv1alpha1.SubscriptionList, 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)
	// ListPodSchedulingPolicies returns a list of pod scheduling policy that matches the criteria.
	// This method returns a list of full objects (meta and spec).
	ListPodSchedulingPolicies(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.PodSchedulingPolicyList, error)
	// GetPodSchedulingPolicy returns pod scheduling policy(full object) that matches the criteria.
	GetPodSchedulingPolicy(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.PodSchedulingPolicy, error)
	// GetPodSchedulingPolicyMeta returns pod scheduling policy(metadata only) that matches the criteria.
	GetPodSchedulingPolicyMeta(ctx context.Context, key ctrlclient.ObjectKey) (*metav1.PartialObjectMetadata, error)
	// DeletePodSchedulingPolicy deletes pod scheduling policy that matches the criteria.
	DeletePodSchedulingPolicy(ctx context.Context, obj *everestv1alpha1.PodSchedulingPolicy) error
	// CreatePodSchedulingPolicy creates pod scheduling policy.
	CreatePodSchedulingPolicy(ctx context.Context, psp *everestv1alpha1.PodSchedulingPolicy) (*everestv1alpha1.PodSchedulingPolicy, error)
	// UpdatePodSchedulingPolicy updates pod scheduling policy.
	UpdatePodSchedulingPolicy(ctx context.Context, psp *everestv1alpha1.PodSchedulingPolicy) (*everestv1alpha1.PodSchedulingPolicy, error)
	// ListLoadBalancerConfigs returns a list of load balancer config that matches the criteria.
	// This method returns a list of full objects (meta and spec).
	ListLoadBalancerConfigs(ctx context.Context, opts ...ctrlclient.ListOption) (*everestv1alpha1.LoadBalancerConfigList, error)
	// GetLoadBalancerConfig returns load balancer config(full object) that matches the criteria.
	GetLoadBalancerConfig(ctx context.Context, key ctrlclient.ObjectKey) (*everestv1alpha1.LoadBalancerConfig, error)
	// DeleteLoadBalancerConfig deletes load balancer config that matches the criteria.
	DeleteLoadBalancerConfig(ctx context.Context, obj *everestv1alpha1.LoadBalancerConfig) error
	// CreateLoadBalancerConfig creates load balancer config.
	CreateLoadBalancerConfig(ctx context.Context, lbc *everestv1alpha1.LoadBalancerConfig) (*everestv1alpha1.LoadBalancerConfig, error)
	// UpdateLoadBalancerConfig updates load balancer config.
	UpdateLoadBalancerConfig(ctx context.Context, lbc *everestv1alpha1.LoadBalancerConfig) (*everestv1alpha1.LoadBalancerConfig, error)
	// GetAllClusterResources goes through all cluster nodes and sums their allocatable resources.
	GetAllClusterResources(ctx context.Context, clusterType ClusterType, volumes *corev1.PersistentVolumeList) (uint64, uint64, uint64, error)
	// GetConsumedCPUAndMemory returns consumed CPU and Memory in given namespace. If namespace
	// is empty, it tries to get them from all namespaces.
	GetConsumedCPUAndMemory(ctx context.Context, namespace string) (cpuMillis uint64, memoryBytes uint64, err error)
	// GetConsumedDiskBytes returns consumed bytes. The strategy differs based on k8s cluster type.
	GetConsumedDiskBytes(_ context.Context, clusterType ClusterType, volumes *corev1.PersistentVolumeList) (uint64, error)
	// ListSecrets returns list of secrets that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListSecrets(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.SecretList, error)
	// GetSecret returns a secret that matches the criteria.
	GetSecret(ctx context.Context, key ctrlclient.ObjectKey) (*corev1.Secret, error)
	// CreateSecret creates a secret.
	CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)
	// UpdateSecret updates a secret.
	UpdateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)
	// DeleteSecret deletes a secret that matches the criteria.
	DeleteSecret(ctx context.Context, obj *corev1.Secret) error
	// GetService returns service that matches the criteria.
	GetService(ctx context.Context, key ctrlclient.ObjectKey) (*corev1.Service, error)
	// ListPersistentVolumes returns list of persistent volumes that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListPersistentVolumes(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.PersistentVolumeList, error)
	// ListStorageClasses returns list of storage classes that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListStorageClasses(ctx context.Context, opts ...ctrlclient.ListOption) (*storagev1.StorageClassList, error)
	// CreateSplitHorizonDNSConfig creates a SplitHorizonDNSConfig resource in Kubernetes.
	CreateSplitHorizonDNSConfig(ctx context.Context, shdc *enginefeaturesv1alpha1.SplitHorizonDNSConfig) (*enginefeaturesv1alpha1.SplitHorizonDNSConfig, error)
	// UpdateSplitHorizonDNSConfig updates an existing SplitHorizonDNSConfig resource in Kubernetes.
	UpdateSplitHorizonDNSConfig(ctx context.Context, shdc *enginefeaturesv1alpha1.SplitHorizonDNSConfig) (*enginefeaturesv1alpha1.SplitHorizonDNSConfig, error)
	// ListSplitHorizonDNSConfigs lists all SplitHorizonDNSConfig resources in Kubernetes that match the provided options.
	ListSplitHorizonDNSConfigs(ctx context.Context, opts ...ctrlclient.ListOption) (*enginefeaturesv1alpha1.SplitHorizonDNSConfigList, error)
	// DeleteSplitHorizonDNSConfig deletes a SplitHorizonDNSConfig resource in Kubernetes.
	DeleteSplitHorizonDNSConfig(ctx context.Context, shdc *enginefeaturesv1alpha1.SplitHorizonDNSConfig) error
	// GetSplitHorizonDNSConfig retrieves a SplitHorizonDNSConfig resource from Kubernetes by its namespaced name.
	GetSplitHorizonDNSConfig(ctx context.Context, key ctrlclient.ObjectKey) (*enginefeaturesv1alpha1.SplitHorizonDNSConfig, error)
	// GetSubscription returns OLM subscription that matches the criteria.
	GetSubscription(ctx context.Context, key ctrlclient.ObjectKey) (*olmv1alpha1.Subscription, error)
	// ListSubscriptions lists OLM subscriptions that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListSubscriptions(ctx context.Context, opts ...ctrlclient.ListOption) (*olmv1alpha1.SubscriptionList, error)
	// DeleteSubscription deletes OLM subscription that matches the criteria.
	DeleteSubscription(ctx context.Context, obj *olmv1alpha1.Subscription) error
	// ListPods returns list of pods that match the criteria.
	// This method returns a list of full objects (meta and spec).
	ListPods(ctx context.Context, opts ...ctrlclient.ListOption) (*corev1.PodList, error)
}

KubernetesConnector ...

func New

func New(kubeconfigPath string, l *zap.SugaredLogger) (KubernetesConnector, error)

New returns new Kubernetes object based on provided kubeconfig.

func NewInCluster

func NewInCluster(l *zap.SugaredLogger, ctx context.Context, cacheOptions *cache.Options) (KubernetesConnector, error)

NewInCluster creates a new kubernetes client using incluster authentication.

Directories

Path Synopsis
Package informer provides generic utilities to work with Kubernetes informers.
Package informer provides generic utilities to work with Kubernetes informers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL