clientset

package
v0.0.0-...-0227cab Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(kubecli client.Client, logger logr.Logger) *clientSet

New returns a new Kubernetes client set.

func NewWithConfig

func NewWithConfig(kubecli client.Client, restConfig *rest.Config, logger logr.Logger) *clientSet

NewWithConfig returns a new Kubernetes client set.

Types

type CertOption

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

func (*CertOption) CreateCertificate

func (c *CertOption) CreateCertificate(ctx context.Context, namespace string, cert *certv1.Certificate) error

func (*CertOption) CreateIfNotExistsCertificate

func (c *CertOption) CreateIfNotExistsCertificate(ctx context.Context, namespace string, cert *certv1.Certificate) error

func (*CertOption) GetCertificate

func (c *CertOption) GetCertificate(ctx context.Context, namespace string, name string) (*certv1.Certificate, error)

type Certificate

type Certificate interface {
	GetCertificate(ctx context.Context, namespace string, name string) (*certv1.Certificate, error)
	CreateCertificate(ctx context.Context, namespace string, cert *certv1.Certificate) error
	CreateIfNotExistsCertificate(ctx context.Context, namespace string, cert *certv1.Certificate) error
}

func NewCert

func NewCert(kubeClient client.Client, logger logr.Logger) Certificate

type ConfigMap

type ConfigMap interface {
	// GetConfigMap get ConfigMap from kubernetes with namespace and name
	GetConfigMap(ctx context.Context, namespace string, name string) (*corev1.ConfigMap, error)
	// CreateConfigMap create the given ConfigMap
	CreateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error
	// UpdateConfigMap update the given ConfigMap
	UpdateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error
	// CreateOrUpdateConfigMap if the ConfigMap Already exists, create it, otherwise update it
	CreateOrUpdateConfigMap(ctx context.Context, namespace string, np *corev1.ConfigMap) error
	// DeleteConfigMap delete ConfigMap from kubernetes with namespace and name
	DeleteConfigMap(ctx context.Context, namespace string, name string) error
	// ListConfigMaps get set of ConfigMaps on a given namespace
	ListConfigMaps(ctx context.Context, namespace string) (*corev1.ConfigMapList, error)
	CreateIfNotExistsConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error
	UpdateIfConfigMapChanged(ctx context.Context, newConfigmap *corev1.ConfigMap) error
}

ConfigMap the client that knows how to interact with kubernetes to manage them

func NewConfigMap

func NewConfigMap(kubeClient client.Client, logger logr.Logger) ConfigMap

NewConfigMap returns a new ConfigMap client.

type ConfigMapOption

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

ConfigMapOption is the configMap client interface implementation that using API calls to kubernetes.

func (*ConfigMapOption) CreateConfigMap

func (p *ConfigMapOption) CreateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error

CreateConfigMap implement the ConfigMap.Interface

func (*ConfigMapOption) CreateIfNotExistsConfigMap

func (p *ConfigMapOption) CreateIfNotExistsConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error

CreateIfNotExistsConfigMap implement the ConfigMap.Interface

func (*ConfigMapOption) CreateOrUpdateConfigMap

func (p *ConfigMapOption) CreateOrUpdateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error

CreateOrUpdateConfigMap implement the ConfigMap.Interface

func (*ConfigMapOption) DeleteConfigMap

func (p *ConfigMapOption) DeleteConfigMap(ctx context.Context, namespace string, name string) error

DeleteConfigMap implement the ConfigMap.Interface

func (*ConfigMapOption) GetConfigMap

func (p *ConfigMapOption) GetConfigMap(ctx context.Context, namespace string, name string) (*corev1.ConfigMap, error)

GetConfigMap implement the ConfigMap.Interface

func (*ConfigMapOption) ListConfigMaps

func (p *ConfigMapOption) ListConfigMaps(ctx context.Context, namespace string) (*corev1.ConfigMapList, error)

ListConfigMaps implement the ConfigMap.Interface

func (*ConfigMapOption) UpdateConfigMap

func (p *ConfigMapOption) UpdateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error

UpdateConfigMap implement the ConfigMap.Interface

func (*ConfigMapOption) UpdateIfConfigMapChanged

func (p *ConfigMapOption) UpdateIfConfigMapChanged(ctx context.Context, newConfigmap *corev1.ConfigMap) error

type CronJob

type CronJob interface {
	GetCronJob(ctx context.Context, namespace, name string) (*v1.CronJob, error)
	ListCronJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.CronJobList, error)
	DeleteCronJob(ctx context.Context, namespace, name string) error
	CreateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error
	UpdateCronJob(ctx context.Context, namespace string, job *v1.CronJob) error
	CreateOrUpdateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error
}

func NewCronJob

func NewCronJob(kubeClient client.Client, logger logr.Logger) CronJob

type CronJobOption

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

func (*CronJobOption) CreateCronJob

func (c *CronJobOption) CreateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error

func (*CronJobOption) CreateOrUpdateCronJob

func (c *CronJobOption) CreateOrUpdateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error

func (*CronJobOption) DeleteCronJob

func (c *CronJobOption) DeleteCronJob(ctx context.Context, namespace, name string) error

func (*CronJobOption) GetCronJob

func (c *CronJobOption) GetCronJob(ctx context.Context, namespace, name string) (*v1.CronJob, error)

func (*CronJobOption) ListCronJobs

func (c *CronJobOption) ListCronJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.CronJobList, error)

func (*CronJobOption) UpdateCronJob

func (c *CronJobOption) UpdateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error

type Deployment

type Deployment interface {
	// GetDeployment get deployment from kubernetes with namespace and name
	GetDeployment(ctx context.Context, namespace, name string) (*appsv1.Deployment, error)
	// GetDeploymentPods will retrieve the pods managed by a given deployment
	GetDeploymentPods(ctx context.Context, namespace, name string) (*corev1.PodList, error)
	// CreateDeployment will create the given deployment
	CreateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
	// UpdateDeployment will update the given deployment
	UpdateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
	// CreateOrUpdateDeployment will update the given deployment or create it if does not exist
	CreateOrUpdateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
	// DeleteDeployment will delete the given deployment
	DeleteDeployment(ctx context.Context, namespace string, name string) error
	// ListDeployments get set of deployment on a given namespace
	ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
	// RestartDeployment
	RestartDeployment(ctx context.Context, namespace, name string) (*appsv1.Deployment, error)

	CreateIfNotExistsDeployment(ctx context.Context, namespace string, deploy *appsv1.Deployment) error
}

Deployment the client that knows how to interact with kubernetes to manage them

func NewDeployment

func NewDeployment(kubeClient client.Client, logger logr.Logger) Deployment

NewDeployment returns a new Deployment client.

type DeploymentOption

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

DeploymentOption is the deployment client interface implementation that using API calls to kubernetes.

func (*DeploymentOption) CreateDeployment

func (d *DeploymentOption) CreateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error

CreateDeployment implement the Deployment.Interface

func (*DeploymentOption) CreateIfNotExistsDeployment

func (d *DeploymentOption) CreateIfNotExistsDeployment(ctx context.Context, namespace string, deploy *appsv1.Deployment) error

func (*DeploymentOption) CreateOrUpdateDeployment

func (d *DeploymentOption) CreateOrUpdateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error

CreateOrUpdateDeployment implement the Deployment.Interface

func (*DeploymentOption) DeleteDeployment

func (d *DeploymentOption) DeleteDeployment(ctx context.Context, namespace string, name string) error

DeleteDeployment implement the Deployment.Interface

func (*DeploymentOption) GetDeployment

func (d *DeploymentOption) GetDeployment(ctx context.Context, namespace string, name string) (*appsv1.Deployment, error)

GetDeployment implement the Deployment.Interface

func (*DeploymentOption) GetDeploymentPods

func (d *DeploymentOption) GetDeploymentPods(ctx context.Context, namespace string, name string) (*corev1.PodList, error)

GetDeploymentPods implement the Deployment.Interface

func (*DeploymentOption) ListDeployments

func (d *DeploymentOption) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)

ListDeployments implement the Deployment.Interface

func (*DeploymentOption) RestartDeployment

func (d *DeploymentOption) RestartDeployment(ctx context.Context, namespace string, name string) (*appsv1.Deployment, error)

func (*DeploymentOption) UpdateDeployment

func (d *DeploymentOption) UpdateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error

UpdateDeployment implement the Deployment.Interface

type DistributedRedisCluster

type DistributedRedisCluster interface {
	GetDistributedRedisCluster(ctx context.Context, namespace, name string) (*clusterv1.DistributedRedisCluster, error)
}

func NewDistributedRedisCluster

func NewDistributedRedisCluster(kubeClient client.Client, logger logr.Logger) DistributedRedisCluster

type DistributedRedisClusterOption

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

func (*DistributedRedisClusterOption) GetDistributedRedisCluster

func (r *DistributedRedisClusterOption) GetDistributedRedisCluster(ctx context.Context, namespace, name string) (*clusterv1.DistributedRedisCluster, error)

type Job

type Job interface {
	GetJob(ctx context.Context, namespace, name string) (*v1.Job, error)
	ListJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.JobList, error)
	DeleteJob(ctx context.Context, namespace, name string) error
	CreateJob(ctx context.Context, namespace string, job *v1.Job) error
	UpdateJob(ctx context.Context, namespace string, job *v1.Job) error
	CreateOrUpdateJob(ctx context.Context, namespace string, job *v1.Job) error
	CreateIfNotExistsJob(ctx context.Context, namespace string, job *v1.Job) error
	ListJobsByLabel(ctx context.Context, namespace string, label_map map[string]string) (*v1.JobList, error)
}

func NewJob

func NewJob(kubeClient client.Client, logger logr.Logger) Job

type JobOption

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

func (*JobOption) CreateIfNotExistsJob

func (c *JobOption) CreateIfNotExistsJob(ctx context.Context, namespace string, job *v1.Job) error

func (*JobOption) CreateJob

func (c *JobOption) CreateJob(ctx context.Context, namespace string, job *v1.Job) error

func (*JobOption) CreateOrUpdateJob

func (c *JobOption) CreateOrUpdateJob(ctx context.Context, namespace string, job *v1.Job) error

func (*JobOption) DeleteJob

func (c *JobOption) DeleteJob(ctx context.Context, namespace string, name string) error

func (*JobOption) GetJob

func (c *JobOption) GetJob(ctx context.Context, namespace string, name string) (*v1.Job, error)

func (*JobOption) ListJobs

func (c *JobOption) ListJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.JobList, error)

func (*JobOption) ListJobsByLabel

func (c *JobOption) ListJobsByLabel(ctx context.Context, namespace string, label_map map[string]string) (*v1.JobList, error)

func (*JobOption) UpdateJob

func (c *JobOption) UpdateJob(ctx context.Context, namespace string, job *v1.Job) error

type NameSpaces

type NameSpaces interface {
	// GetNameSpace get namespace info form kubernetes
	GetNameSpace(ctx context.Context, namespace string) (*corev1.Namespace, error)
}

NameSpaces the client that knows how to interact with kubernetes to manage them

func NewNameSpaces

func NewNameSpaces(logger logr.Logger) NameSpaces

NewNameSpaces returns a new NameSpaces client.

type NameSpacesOption

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

NameSpacesOption is the NameSpaces client implementation using API calls to kubernetes.

func (*NameSpacesOption) GetNameSpace

func (n *NameSpacesOption) GetNameSpace(ctx context.Context, namespace string) (*corev1.Namespace, error)

GetNameSpace implement the NameSpaces.Interface

type Node

type Node interface {
	ListNodesByLabels(ctx context.Context, label_map map[string]string) (*corev1.NodeList, error)
	GetNode(ctx context.Context, name string) (*corev1.Node, error)
}

func NewNode

func NewNode(kubeClient client.Client, logger logr.Logger) Node

type NodeOption

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

func (*NodeOption) GetNode

func (p *NodeOption) GetNode(ctx context.Context, name string) (*corev1.Node, error)

func (*NodeOption) ListNodesByLabels

func (p *NodeOption) ListNodesByLabels(ctx context.Context, label_map map[string]string) (*corev1.NodeList, error)

type PVC

type PVC interface {
	GetPVC(ctx context.Context, namespace string, name string) (*corev1.PersistentVolumeClaim, error)
	CreatePVC(ctx context.Context, namespace string, pvc *corev1.PersistentVolumeClaim) error
	ListPvcByLabel(ctx context.Context, namespace string, label_map map[string]string) (*corev1.PersistentVolumeClaimList, error)
}

PVC the ServiceAccount service that knows how to interact with k8s to manage them

type PVCService

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

PVCService is the pvc service implementation using API calls to kubernetes.

func NewPVCService

func NewPVCService(kubeClient client.Client, logger logr.Logger) *PVCService

NewPVCService returns a new PVC KubeService.

func (*PVCService) CreatePVC

func (p *PVCService) CreatePVC(ctx context.Context, namespace string, pvc *corev1.PersistentVolumeClaim) error

func (*PVCService) GetPVC

func (p *PVCService) GetPVC(ctx context.Context, namespace string, name string) (*corev1.PersistentVolumeClaim, error)

func (*PVCService) ListPvcByLabel

func (p *PVCService) ListPvcByLabel(ctx context.Context, namespace string, label_map map[string]string) (*corev1.PersistentVolumeClaimList, error)

type Pod

type Pod interface {
	// GetPod get pod from kubernetes with namespace and name
	GetPod(ctx context.Context, namespace string, name string) (*corev1.Pod, error)
	// CreatePod will create the given pod
	CreatePod(ctx context.Context, namespace string, pod *corev1.Pod) error
	// UpdatePod will update the given pod
	UpdatePod(ctx context.Context, namespace string, pod *corev1.Pod) error
	// CreateOrUpdatePod will update the given pod or create it if does not exist
	CreateOrUpdatePod(ctx context.Context, namespace string, pod *corev1.Pod) error
	// DeletePod will delete the given pod
	DeletePod(ctx context.Context, namespace string, name string, force ...bool) error
	// ListPodByLabels
	ListPodByLabels(ctx context.Context, namespace string, label_map map[string]string) (*corev1.PodList, error)
	// ListPods get set of pod on a given namespace
	ListPods(ctx context.Context, namespace string) (*corev1.PodList, error)
	// PatchPodLabel
	PatchPodLabel(ctx context.Context, pod *corev1.Pod, labelkey string, labelValue string) error
	// Exec exec command remotely
	Exec(ctx context.Context, namespace, name, containerName string, cmd []string) (io.Reader, io.Reader, error)
}

Pod the client that knows how to interact with kubernetes to manage them

func NewPod

func NewPod(kubeClient client.Client, restConfig *rest.Config, logger logr.Logger) Pod

NewPod returns a new Pod client.

type PodDisruptionBudget

type PodDisruptionBudget interface {
	// GetPodDisruptionBudget get podDisruptionBudget from kubernetes with namespace and name
	GetPodDisruptionBudget(ctx context.Context, namespace string, name string) (*policyv1.PodDisruptionBudget, error)
	// CreatePodDisruptionBudget will create the given podDisruptionBudget
	CreatePodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error
	// UpdatePodDisruptionBudget will update the given podDisruptionBudget
	UpdatePodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error
	// CreateOrUpdatePodDisruptionBudget will update the given podDisruptionBudget or create it if does not exist
	CreateOrUpdatePodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error
	// DeletePodDisruptionBudget will delete the given podDisruptionBudget
	DeletePodDisruptionBudget(ctx context.Context, namespace string, name string) error
	CreateIfNotExistsPodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error
}

PodDisruptionBudget the client that knows how to interact with kubernetes to manage them

func NewPodDisruptionBudget

func NewPodDisruptionBudget(kubeClient client.Client, logger logr.Logger) PodDisruptionBudget

NewPodDisruptionBudget returns a new PodDisruptionBudget client.

type PodDisruptionBudgetOption

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

PodDisruptionBudgetOption is the podDisruptionBudget client implementation using API calls to kubernetes.

func (*PodDisruptionBudgetOption) CreateIfNotExistsPodDisruptionBudget

func (p *PodDisruptionBudgetOption) CreateIfNotExistsPodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error

CreateIfNotExistsPodDisruptionBudget implement the PodDisruptionBudget.Interface

func (*PodDisruptionBudgetOption) CreateOrUpdatePodDisruptionBudget

func (p *PodDisruptionBudgetOption) CreateOrUpdatePodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error

CreateOrUpdatePodDisruptionBudget implement the PodDisruptionBudget.Interface

func (*PodDisruptionBudgetOption) CreatePodDisruptionBudget

func (p *PodDisruptionBudgetOption) CreatePodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error

CreatePodDisruptionBudget implement the PodDisruptionBudget.Interface

func (*PodDisruptionBudgetOption) DeletePodDisruptionBudget

func (p *PodDisruptionBudgetOption) DeletePodDisruptionBudget(ctx context.Context, namespace string, name string) error

DeletePodDisruptionBudget implement the PodDisruptionBudget.Interface

func (*PodDisruptionBudgetOption) GetPodDisruptionBudget

func (p *PodDisruptionBudgetOption) GetPodDisruptionBudget(ctx context.Context, namespace string, name string) (*policyv1.PodDisruptionBudget, error)

GetPodDisruptionBudget implement the PodDisruptionBudget.Interface

func (*PodDisruptionBudgetOption) UpdateIfSelectorChangedPodDisruptionaBudget

func (p *PodDisruptionBudgetOption) UpdateIfSelectorChangedPodDisruptionaBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error

func (*PodDisruptionBudgetOption) UpdatePodDisruptionBudget

func (p *PodDisruptionBudgetOption) UpdatePodDisruptionBudget(ctx context.Context, namespace string, podDisruptionBudget *policyv1.PodDisruptionBudget) error

UpdatePodDisruptionBudget implement the PodDisruptionBudget.Interface

type PodOption

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

PodOption is the pod client interface implementation using API calls to kubernetes.

func (*PodOption) CreateOrUpdatePod

func (p *PodOption) CreateOrUpdatePod(ctx context.Context, namespace string, pod *corev1.Pod) error

CreateOrUpdatePod implement the Pod.Interface

func (*PodOption) CreatePod

func (p *PodOption) CreatePod(ctx context.Context, namespace string, pod *corev1.Pod) error

CreatePod implement the Pod.Interface

func (*PodOption) DeletePod

func (p *PodOption) DeletePod(ctx context.Context, namespace string, name string, force ...bool) error

DeletePod implement the Pod.Interface

func (*PodOption) Exec

func (p *PodOption) Exec(ctx context.Context, namespace, name, containerName string, cmd []string) (io.Reader, io.Reader, error)

Exec

func (*PodOption) GetPod

func (p *PodOption) GetPod(ctx context.Context, namespace string, name string) (*corev1.Pod, error)

GetPod implement the Pod.Interface

func (*PodOption) ListPodByLabels

func (p *PodOption) ListPodByLabels(ctx context.Context, namespace string, label_map map[string]string) (*corev1.PodList, error)

func (*PodOption) ListPods

func (p *PodOption) ListPods(ctx context.Context, namespace string) (*corev1.PodList, error)

ListPods implement the Pod.Interface

func (*PodOption) PatchPodLabel

func (p *PodOption) PatchPodLabel(ctx context.Context, pod *corev1.Pod, labelkey string, labelValue string) error

func (*PodOption) UpdatePod

func (p *PodOption) UpdatePod(ctx context.Context, namespace string, pod *corev1.Pod) error

UpdatePod implement the Pod.Interface

type RBAC

type RBAC interface {
	GetRoleBinding(ctx context.Context, namespace string, name string) (*rbacv1.RoleBinding, error)
	CreateRoleBinding(ctx context.Context, namespace string, rb *rbacv1.RoleBinding) error
	CreateOrUpdateRoleBinding(ctx context.Context, namespace string, rb *rbacv1.RoleBinding) error
	GetRole(ctx context.Context, namespace string, name string) (*rbacv1.Role, error)
	CreateRole(ctx context.Context, namespace string, role *rbacv1.Role) error
	UpdateRole(ctx context.Context, namespace string, role *rbacv1.Role) error
	CreateOrUpdateRole(ctx context.Context, namespace string, role *rbacv1.Role) error
	GetClusterRole(ctx context.Context, name string) (*rbacv1.ClusterRole, error)
	CreateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error
	CreateOrUpdateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error
	UpdateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error
	CreateClusterRoleBinding(ctx context.Context, rb *rbacv1.ClusterRoleBinding) error
	GetClusterRoleBinding(ctx context.Context, name string) (*rbacv1.ClusterRoleBinding, error)
	UpdateClusterRoleBinding(ctx context.Context, role *rbacv1.ClusterRoleBinding) error
	CreateOrUpdateClusterRoleBinding(ctx context.Context, rb *rbacv1.ClusterRoleBinding) error
}

func NewRBAC

func NewRBAC(kubeClient client.Client, logger logr.Logger) RBAC

type RBACOption

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

func (*RBACOption) CreateClusterRole

func (s *RBACOption) CreateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error

func (*RBACOption) CreateClusterRoleBinding

func (s *RBACOption) CreateClusterRoleBinding(ctx context.Context, rb *rbacv1.ClusterRoleBinding) error

func (*RBACOption) CreateOrUpdateClusterRole

func (s *RBACOption) CreateOrUpdateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error

func (*RBACOption) CreateOrUpdateClusterRoleBinding

func (s *RBACOption) CreateOrUpdateClusterRoleBinding(ctx context.Context, rb *rbacv1.ClusterRoleBinding) error

func (*RBACOption) CreateOrUpdateRole

func (s *RBACOption) CreateOrUpdateRole(ctx context.Context, namespace string, role *rbacv1.Role) error

func (*RBACOption) CreateOrUpdateRoleBinding

func (s *RBACOption) CreateOrUpdateRoleBinding(ctx context.Context, namespace string, rb *rbacv1.RoleBinding) error

func (*RBACOption) CreateRole

func (s *RBACOption) CreateRole(ctx context.Context, namespace string, role *rbacv1.Role) error

func (*RBACOption) CreateRoleBinding

func (s *RBACOption) CreateRoleBinding(ctx context.Context, namespace string, rb *rbacv1.RoleBinding) error

func (*RBACOption) GetClusterRole

func (s *RBACOption) GetClusterRole(ctx context.Context, name string) (*rbacv1.ClusterRole, error)

func (*RBACOption) GetClusterRoleBinding

func (s *RBACOption) GetClusterRoleBinding(ctx context.Context, name string) (*rbacv1.ClusterRoleBinding, error)

func (*RBACOption) GetRole

func (s *RBACOption) GetRole(ctx context.Context, namespace string, name string) (*rbacv1.Role, error)

func (*RBACOption) GetRoleBinding

func (s *RBACOption) GetRoleBinding(ctx context.Context, namespace string, name string) (*rbacv1.RoleBinding, error)

func (*RBACOption) UpdateClusterRole

func (s *RBACOption) UpdateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error

func (*RBACOption) UpdateClusterRoleBinding

func (s *RBACOption) UpdateClusterRoleBinding(ctx context.Context, role *rbacv1.ClusterRoleBinding) error

func (*RBACOption) UpdateRole

func (s *RBACOption) UpdateRole(ctx context.Context, namespace string, role *rbacv1.Role) error

type RedisBackup

type RedisBackup interface {
	GetRedisBackup(ctx context.Context, namespace string, name string) (*redisbackup.RedisBackup, error)
	ListRedisBackups(ctx context.Context, namespace string, listOps client.ListOptions) (*redisbackup.RedisBackupList, error)
	UpdateRedisBackup(ctx context.Context, backup *redisbackup.RedisBackup) error
	UpdateRedisBackupStatus(ctx context.Context, backup *redisbackup.RedisBackup) error
	DeleteRedisBackup(ctx context.Context, namespace string, name string) error
}

func NewRedisBackup

func NewRedisBackup(kubeClient client.Client, logger logr.Logger) RedisBackup

type RedisBackupOption

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

func (*RedisBackupOption) DeleteRedisBackup

func (r *RedisBackupOption) DeleteRedisBackup(ctx context.Context, namespace string, name string) error

func (*RedisBackupOption) GetRedisBackup

func (r *RedisBackupOption) GetRedisBackup(ctx context.Context, namespace string, name string) (*redisbackup.RedisBackup, error)

func (*RedisBackupOption) ListRedisBackups

func (r *RedisBackupOption) ListRedisBackups(ctx context.Context, namespace string, listOps client.ListOptions) (*redisbackup.RedisBackupList, error)

func (*RedisBackupOption) UpdateRedisBackup

func (r *RedisBackupOption) UpdateRedisBackup(ctx context.Context, backup *redisbackup.RedisBackup) error

func (*RedisBackupOption) UpdateRedisBackupStatus

func (r *RedisBackupOption) UpdateRedisBackupStatus(ctx context.Context, backup *redisbackup.RedisBackup) error

UpdateRedisBackup update redisbackup.Service interface.

type RedisClusterBackup

type RedisClusterBackup interface {
	GetRedisClusterBackup(ctx context.Context, namespace string, name string) (*redisbackup.RedisClusterBackup, error)
	ListRedisClusterBackups(ctx context.Context, namespace string, listOps client.ListOptions) (*redisbackup.RedisClusterBackupList, error)
	UpdateRedisClusterBackup(ctx context.Context, backup *redisbackup.RedisClusterBackup) error
	UpdateRedisClusterBackupStatus(ctx context.Context, backup *redisbackup.RedisClusterBackup) error
	DeleteRedisClusterBackup(ctx context.Context, namespace string, name string) error
}

func NewRedisClusterBackup

func NewRedisClusterBackup(kubeClient client.Client, logger logr.Logger) RedisClusterBackup

type RedisClusterBackupOption

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

func (*RedisClusterBackupOption) DeleteRedisClusterBackup

func (r *RedisClusterBackupOption) DeleteRedisClusterBackup(ctx context.Context, namespace string, name string) error

func (*RedisClusterBackupOption) GetRedisClusterBackup

func (r *RedisClusterBackupOption) GetRedisClusterBackup(ctx context.Context, namespace string, name string) (*redisbackup.RedisClusterBackup, error)

func (*RedisClusterBackupOption) ListRedisClusterBackups

func (r *RedisClusterBackupOption) ListRedisClusterBackups(ctx context.Context, namespace string, listOps client.ListOptions) (*redisbackup.RedisClusterBackupList, error)

func (*RedisClusterBackupOption) UpdateRedisClusterBackup

func (r *RedisClusterBackupOption) UpdateRedisClusterBackup(ctx context.Context, backup *redisbackup.RedisClusterBackup) error

func (*RedisClusterBackupOption) UpdateRedisClusterBackupStatus

func (r *RedisClusterBackupOption) UpdateRedisClusterBackupStatus(ctx context.Context, backup *redisbackup.RedisClusterBackup) error

UpdateRedisClusterBackup update redisbackup.Service interface.

type RedisFailover

type RedisFailover interface {
	// ListRedisFailovers lists the redisfailovers on a cluster.
	ListRedisFailovers(ctx context.Context, namespace string, opts client.ListOptions) (*redisfailoverv1.RedisFailoverList, error)
	// GetRedisFailover get the redisfailover on a cluster.
	GetRedisFailover(ctx context.Context, namespace, name string) (*redisfailoverv1.RedisFailover, error)
	// UpdateRedisFailover update the redisfailover on a cluster.
	UpdateRedisFailover(ctx context.Context, rf *redisfailoverv1.RedisFailover) error
}

RedisFailover the RF service that knows how to interact with k8s to get them

type RedisFailoverService

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

RedisFailoverService is the RedisFailover service implementation using API calls to kubernetes.

func NewRedisFailoverService

func NewRedisFailoverService(client client.Client, logger logr.Logger) *RedisFailoverService

NewRedisFailoverService returns a new Workspace KubeService.

func (*RedisFailoverService) DeleteRedisFailover

func (r *RedisFailoverService) DeleteRedisFailover(ctx context.Context, namespace string, name string) error

func (*RedisFailoverService) GetRedisFailover

func (r *RedisFailoverService) GetRedisFailover(ctx context.Context, namespace, name string) (*redisfailoverv1.RedisFailover, error)

GetRedisFailover satisfies redisfailover.Service interface.

func (*RedisFailoverService) ListRedisFailovers

func (r *RedisFailoverService) ListRedisFailovers(ctx context.Context, namespace string, opts client.ListOptions) (*redisfailoverv1.RedisFailoverList, error)

ListRedisFailovers satisfies redisfailover.Service interface.

func (*RedisFailoverService) UpdateRedisFailover

func (r *RedisFailoverService) UpdateRedisFailover(ctx context.Context, n *redisfailoverv1.RedisFailover) error

UpdateRedisFailover

type RedisUser

type RedisUser interface {
	// ListRedisUsers lists the redisusers on a cluster.
	ListRedisUsers(ctx context.Context, namespace string, opts client.ListOptions) (*redismiddlewarealaudaiov1.RedisUserList, error)
	// GetRedisUser get the redisuser on a cluster.
	GetRedisUser(ctx context.Context, namespace, name string) (*redismiddlewarealaudaiov1.RedisUser, error)
	// UpdateRedisUser update the redisuser on a cluster.
	UpdateRedisUser(ctx context.Context, ru *redismiddlewarealaudaiov1.RedisUser) error
	// Create
	CreateRedisUser(ctx context.Context, ru *redismiddlewarealaudaiov1.RedisUser) error
	//create if not exites
	CreateIfNotExistsRedisUser(ctx context.Context, ru *redismiddlewarealaudaiov1.RedisUser) error

	//create or update
	CreateOrUpdateRedisUser(ctx context.Context, ru *redismiddlewarealaudaiov1.RedisUser) error
}

type RedisUserOption

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

func NewRedisUserService

func NewRedisUserService(client client.Client, logger logr.Logger) *RedisUserOption

func (*RedisUserOption) CreateIfNotExistsRedisUser

func (r *RedisUserOption) CreateIfNotExistsRedisUser(ctx context.Context, ru *redismiddlewarealaudaiov1.RedisUser) error

func (*RedisUserOption) CreateOrUpdateRedisUser

func (r *RedisUserOption) CreateOrUpdateRedisUser(ctx context.Context, ru *redismiddlewarealaudaiov1.RedisUser) error

func (*RedisUserOption) CreateRedisUser

func (*RedisUserOption) DeleteRedisUser

func (r *RedisUserOption) DeleteRedisUser(ctx context.Context, namespace string, name string) error

func (*RedisUserOption) GetRedisUser

func (r *RedisUserOption) GetRedisUser(ctx context.Context, namespace, name string) (*redismiddlewarealaudaiov1.RedisUser, error)

func (*RedisUserOption) ListRedisUsers

func (*RedisUserOption) UpdateRedisUser

type Secret

type Secret interface {
	GetSecret(ctx context.Context, namespace string, name string) (*v1.Secret, error)
	CreateSecret(ctx context.Context, namespace string, secret *v1.Secret) error
	UpdateSecret(ctx context.Context, namespace string, secret *v1.Secret) error
	CreateOrUpdateSecret(ctx context.Context, namespace string, secret *v1.Secret) error
	DeleteSecret(ctx context.Context, namespace string, name string) error
	ListSecret(ctx context.Context, namespace string) (*v1.SecretList, error)
	CreateIfNotExistsSecret(ctx context.Context, namespace string, secret *v1.Secret) error
}

func NewSecret

func NewSecret(kubeClient client.Client, logger logr.Logger) Secret

type SecretOption

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

func (*SecretOption) CreateIfNotExistsSecret

func (s *SecretOption) CreateIfNotExistsSecret(ctx context.Context, namespace string, secret *v1.Secret) error

func (*SecretOption) CreateOrUpdateSecret

func (s *SecretOption) CreateOrUpdateSecret(ctx context.Context, namespace string, secret *v1.Secret) error

func (*SecretOption) CreateSecret

func (s *SecretOption) CreateSecret(ctx context.Context, namespace string, secret *v1.Secret) error

func (*SecretOption) DeleteSecret

func (s *SecretOption) DeleteSecret(ctx context.Context, namespace string, name string) error

func (*SecretOption) GetSecret

func (s *SecretOption) GetSecret(ctx context.Context, namespace string, name string) (*v1.Secret, error)

func (*SecretOption) ListSecret

func (s *SecretOption) ListSecret(ctx context.Context, namespace string) (*v1.SecretList, error)

func (*SecretOption) UpdateSecret

func (s *SecretOption) UpdateSecret(ctx context.Context, namespace string, secret *v1.Secret) error

type Service

type Service interface {
	// GetService get service from kubernetes with namespace and name
	GetService(ctx context.Context, namespace string, name string) (*corev1.Service, error)
	// CreateService will create the given service
	CreateService(ctx context.Context, namespace string, service *corev1.Service) error
	//CreateIfNotExistsService create service if it does not exist
	CreateIfNotExistsService(ctx context.Context, namespace string, service *corev1.Service) error
	// UpdateService will update the given service
	UpdateService(ctx context.Context, namespace string, service *corev1.Service) error
	// CreateOrUpdateService will update the given service or create it if does not exist
	CreateOrUpdateService(ctx context.Context, namespace string, service *corev1.Service) error
	// DeleteService will delete the given service
	DeleteService(ctx context.Context, namespace string, name string) error
	// ListServices get set of service on a given namespace
	ListServices(ctx context.Context, namespace string) (*corev1.ServiceList, error)
	GetServiceByLabels(ctx context.Context, namespace string, labelsMap map[string]string) (*corev1.ServiceList, error)
	UpdateIfSelectorChangedService(ctx context.Context, namespace string, service *corev1.Service) error
}

Service the client that knows how to interact with kubernetes to manage them

func NewService

func NewService(kubeClient client.Client, logger logr.Logger) Service

NewService returns a new Service client.

type ServiceAccount

type ServiceAccount interface {
	GetServiceAccount(ctx context.Context, namespace string, name string) (*corev1.ServiceAccount, error)
	CreateServiceAccount(ctx context.Context, namespace string, sa *corev1.ServiceAccount) error
	CreateOrUpdateServiceAccount(ctx context.Context, namespace string, sa *corev1.ServiceAccount) error
}

func NewServiceAccount

func NewServiceAccount(kubeClient client.Client, logger logr.Logger) ServiceAccount

type ServiceAccountOption

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

func (*ServiceAccountOption) CreateOrUpdateServiceAccount

func (s *ServiceAccountOption) CreateOrUpdateServiceAccount(ctx context.Context, namespace string, sa *corev1.ServiceAccount) error

func (*ServiceAccountOption) CreateServiceAccount

func (s *ServiceAccountOption) CreateServiceAccount(ctx context.Context, namespace string, sa *corev1.ServiceAccount) error

func (*ServiceAccountOption) GetServiceAccount

func (s *ServiceAccountOption) GetServiceAccount(ctx context.Context, namespace string, name string) (*corev1.ServiceAccount, error)

type ServiceMonitor

type ServiceMonitor interface {
	GetServiceMonitor(ctx context.Context, namespace string, name string) (*v1.ServiceMonitor, error)
	CreateServiceMonitor(ctx context.Context, namespace string, sm *v1.ServiceMonitor) error
	CreateOrUpdateServiceMonitor(ctx context.Context, namespace string, sm *v1.ServiceMonitor) error
	UpdateServiceMonitor(ctx context.Context, namespace string, sm *v1.ServiceMonitor) error
}

func NewServiceMonitor

func NewServiceMonitor(kubeClient client.Client, logger logr.Logger) ServiceMonitor

type ServiceMonitorOption

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

func (*ServiceMonitorOption) CreateOrUpdateServiceMonitor

func (s *ServiceMonitorOption) CreateOrUpdateServiceMonitor(ctx context.Context, namespace string, sm *v1.ServiceMonitor) error

func (*ServiceMonitorOption) CreateServiceMonitor

func (s *ServiceMonitorOption) CreateServiceMonitor(ctx context.Context, namespace string, sm *v1.ServiceMonitor) error

func (*ServiceMonitorOption) GetServiceMonitor

func (s *ServiceMonitorOption) GetServiceMonitor(ctx context.Context, namespace string, name string) (*v1.ServiceMonitor, error)

func (*ServiceMonitorOption) UpdateServiceMonitor

func (s *ServiceMonitorOption) UpdateServiceMonitor(ctx context.Context, namespace string, sm *v1.ServiceMonitor) error

type ServiceOption

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

ServiceOption is the service client implementation using API calls to kubernetes.

func (*ServiceOption) CreateIfNotExistsService

func (s *ServiceOption) CreateIfNotExistsService(ctx context.Context, namespace string, service *corev1.Service) error

CreateIfNotExistsService implement the Service.Interface

func (*ServiceOption) CreateOrUpdateService

func (s *ServiceOption) CreateOrUpdateService(ctx context.Context, namespace string, service *corev1.Service) error

CreateOrUpdateService implement the Service.Interface

func (*ServiceOption) CreateService

func (s *ServiceOption) CreateService(ctx context.Context, namespace string, service *corev1.Service) error

CreateService implement the Service.Interface

func (*ServiceOption) DeleteService

func (s *ServiceOption) DeleteService(ctx context.Context, namespace string, name string) error

DeleteService implement the Service.Interface

func (*ServiceOption) GetService

func (s *ServiceOption) GetService(ctx context.Context, namespace string, name string) (*corev1.Service, error)

GetService implement the Service.Interface

func (*ServiceOption) GetServiceByLabels

func (s *ServiceOption) GetServiceByLabels(ctx context.Context, namespace string, labelsMap map[string]string) (*corev1.ServiceList, error)

func (*ServiceOption) ListServices

func (s *ServiceOption) ListServices(ctx context.Context, namespace string) (*corev1.ServiceList, error)

ListServices implement the Service.Interface

func (*ServiceOption) UpdateIfSelectorChangedService

func (s *ServiceOption) UpdateIfSelectorChangedService(ctx context.Context, namespace string, service *corev1.Service) error

func (*ServiceOption) UpdateService

func (s *ServiceOption) UpdateService(ctx context.Context, namespace string, service *corev1.Service) error

UpdateService implement the Service.Interface

type StatefulSet

type StatefulSet interface {
	// GetStatefulSet get StatefulSet from kubernetes with namespace and name
	GetStatefulSet(ctx context.Context, namespace, name string) (*appsv1.StatefulSet, error)
	// GetStatefulSetPods will retrieve the pods managed by a given StatefulSet
	GetStatefulSetPods(ctx context.Context, namespace string, name string) (*corev1.PodList, error)
	// GetStatefulSetPodsByLabels
	GetStatefulSetPodsByLabels(ctx context.Context, namespace string, labels map[string]string) (*corev1.PodList, error)
	// CreateStatefulSet will create the given StatefulSet
	CreateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error
	// UpdateStatefulSet will update the given StatefulSet
	UpdateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error
	// CreateOrUpdateStatefulSet will update the given StatefulSet or create it if does not exist
	CreateOrUpdateStatefulSet(ctx context.Context, namespace string, StatefulSet *appsv1.StatefulSet) error
	// DeleteStatefulSet will delete the given StatefulSet
	DeleteStatefulSet(ctx context.Context, namespace string, name string, force ...bool) error
	// ListStatefulSets get set of StatefulSet on a given namespace
	ListStatefulSets(ctx context.Context, namespace string) (*appsv1.StatefulSetList, error)
	// ListStatefulsetByLabels
	ListStatefulSetByLabels(ctx context.Context, namespace string, labels map[string]string) (*appsv1.StatefulSetList, error)
	// CreateIfNotExistsStatefulSet
	CreateIfNotExistsStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error
}

StatefulSet the StatefulSet client that knows how to interact with kubernetes to manage them

func NewStatefulSet

func NewStatefulSet(kubeClient client.Client, logger logr.Logger) StatefulSet

NewStatefulSet returns a new StatefulSet client.

type StatefulSetOption

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

StatefulSetOption is the StatefulSet client implementation using API calls to kubernetes.

func (*StatefulSetOption) CreateIfNotExistsStatefulSet

func (s *StatefulSetOption) CreateIfNotExistsStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error

CreateIfNotExistsStatefulSet implement the StatefulSet.Interface

func (*StatefulSetOption) CreateOrUpdateStatefulSet

func (s *StatefulSetOption) CreateOrUpdateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error

CreateOrUpdateStatefulSet implement the StatefulSet.Interface

func (*StatefulSetOption) CreateStatefulSet

func (s *StatefulSetOption) CreateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error

CreateStatefulSet implement the StatefulSet.Interface

func (*StatefulSetOption) DeleteStatefulSet

func (s *StatefulSetOption) DeleteStatefulSet(ctx context.Context, namespace string, name string, force ...bool) error

DeleteStatefulSet implement the StatefulSet.Interface

func (*StatefulSetOption) GetStatefulSet

func (s *StatefulSetOption) GetStatefulSet(ctx context.Context, namespace string, name string) (*appsv1.StatefulSet, error)

GetStatefulSet implement the StatefulSet.Interface

func (*StatefulSetOption) GetStatefulSetPods

func (s *StatefulSetOption) GetStatefulSetPods(ctx context.Context, namespace string, name string) (*corev1.PodList, error)

GetStatefulSetPods implement the StatefulSet.Interface

func (*StatefulSetOption) GetStatefulSetPodsByLabels

func (s *StatefulSetOption) GetStatefulSetPodsByLabels(ctx context.Context, namespace string, labels map[string]string) (*corev1.PodList, error)

GetStatefulSetPodsByLabels implement the IStatefulSetControl.Interface.

func (*StatefulSetOption) ListStatefulSetByLabels

func (s *StatefulSetOption) ListStatefulSetByLabels(ctx context.Context, namespace string, labels map[string]string) (*appsv1.StatefulSetList, error)

ListStatefulSetByLabels

func (*StatefulSetOption) ListStatefulSets

func (s *StatefulSetOption) ListStatefulSets(ctx context.Context, namespace string) (*appsv1.StatefulSetList, error)

ListStatefulSets implement the StatefulSet.Interface

func (*StatefulSetOption) UpdateStatefulSet

func (s *StatefulSetOption) UpdateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error

UpdateStatefulSet implement the StatefulSet.Interface

Jump to

Keyboard shortcuts

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