Documentation ¶
Index ¶
- func New(kubecli client.Client, logger logr.Logger) *clientSet
- func NewWithConfig(kubecli client.Client, restConfig *rest.Config, logger logr.Logger) *clientSet
- type CertOption
- func (c *CertOption) CreateCertificate(ctx context.Context, namespace string, cert *certv1.Certificate) error
- func (c *CertOption) CreateIfNotExistsCertificate(ctx context.Context, namespace string, cert *certv1.Certificate) error
- func (c *CertOption) GetCertificate(ctx context.Context, namespace string, name string) (*certv1.Certificate, error)
- type Certificate
- type ClientSet
- type ConfigMap
- type ConfigMapOption
- func (p *ConfigMapOption) CreateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error
- func (p *ConfigMapOption) CreateIfNotExistsConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error
- func (p *ConfigMapOption) CreateOrUpdateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error
- func (p *ConfigMapOption) DeleteConfigMap(ctx context.Context, namespace string, name string) error
- func (p *ConfigMapOption) GetConfigMap(ctx context.Context, namespace string, name string) (*corev1.ConfigMap, error)
- func (p *ConfigMapOption) ListConfigMaps(ctx context.Context, namespace string) (*corev1.ConfigMapList, error)
- func (p *ConfigMapOption) UpdateConfigMap(ctx context.Context, namespace string, configMap *corev1.ConfigMap) error
- func (p *ConfigMapOption) UpdateIfConfigMapChanged(ctx context.Context, newConfigmap *corev1.ConfigMap) error
- type CronJob
- type CronJobOption
- func (c *CronJobOption) CreateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error
- func (c *CronJobOption) CreateOrUpdateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error
- func (c *CronJobOption) DeleteCronJob(ctx context.Context, namespace, name string) error
- func (c *CronJobOption) GetCronJob(ctx context.Context, namespace, name string) (*v1.CronJob, error)
- func (c *CronJobOption) ListCronJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.CronJobList, error)
- func (c *CronJobOption) UpdateCronJob(ctx context.Context, namespace string, cronjob *v1.CronJob) error
- type Deployment
- type DeploymentOption
- func (d *DeploymentOption) CreateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
- func (d *DeploymentOption) CreateIfNotExistsDeployment(ctx context.Context, namespace string, deploy *appsv1.Deployment) error
- func (d *DeploymentOption) CreateOrUpdateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
- func (d *DeploymentOption) DeleteDeployment(ctx context.Context, namespace string, name string) error
- func (d *DeploymentOption) GetDeployment(ctx context.Context, namespace string, name string) (*appsv1.Deployment, error)
- func (d *DeploymentOption) GetDeploymentPods(ctx context.Context, namespace string, name string) (*corev1.PodList, error)
- func (d *DeploymentOption) ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (d *DeploymentOption) RestartDeployment(ctx context.Context, namespace string, name string) (*appsv1.Deployment, error)
- func (d *DeploymentOption) UpdateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment) error
- type DistributedRedisCluster
- type DistributedRedisClusterOption
- func (r *DistributedRedisClusterOption) GetDistributedRedisCluster(ctx context.Context, namespace, name string) (*clusterv1.DistributedRedisCluster, error)
- func (r *DistributedRedisClusterOption) UpdateDistributedRedisCluster(ctx context.Context, inst *clusterv1.DistributedRedisCluster) error
- func (r *DistributedRedisClusterOption) UpdateDistributedRedisClusterStatus(ctx context.Context, inst *clusterv1.DistributedRedisCluster) error
- type Job
- type JobOption
- func (c *JobOption) CreateIfNotExistsJob(ctx context.Context, namespace string, job *v1.Job) error
- func (c *JobOption) CreateJob(ctx context.Context, namespace string, job *v1.Job) error
- func (c *JobOption) CreateOrUpdateJob(ctx context.Context, namespace string, job *v1.Job) error
- func (c *JobOption) DeleteJob(ctx context.Context, namespace string, name string) error
- func (c *JobOption) GetJob(ctx context.Context, namespace string, name string) (*v1.Job, error)
- func (c *JobOption) ListJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.JobList, error)
- func (c *JobOption) ListJobsByLabel(ctx context.Context, namespace string, label_map map[string]string) (*v1.JobList, error)
- func (c *JobOption) UpdateJob(ctx context.Context, namespace string, job *v1.Job) error
- type Namespaces
- type NamespacesOption
- type Node
- type NodeOption
- type PVC
- type PVCService
- func (p *PVCService) CreatePVC(ctx context.Context, namespace string, pvc *corev1.PersistentVolumeClaim) error
- func (p *PVCService) GetPVC(ctx context.Context, namespace string, name string) (*corev1.PersistentVolumeClaim, error)
- func (p *PVCService) ListPvcByLabel(ctx context.Context, namespace string, label_map map[string]string) (*corev1.PersistentVolumeClaimList, error)
- type Pod
- type PodDisruptionBudget
- type PodDisruptionBudgetOption
- func (p *PodDisruptionBudgetOption) CreateIfNotExistsPodDisruptionBudget(ctx context.Context, namespace string, ...) error
- func (p *PodDisruptionBudgetOption) CreateOrUpdatePodDisruptionBudget(ctx context.Context, namespace string, ...) error
- func (p *PodDisruptionBudgetOption) CreatePodDisruptionBudget(ctx context.Context, namespace string, ...) error
- func (p *PodDisruptionBudgetOption) DeletePodDisruptionBudget(ctx context.Context, namespace string, name string) error
- func (p *PodDisruptionBudgetOption) GetPodDisruptionBudget(ctx context.Context, namespace string, name string) (*policyv1.PodDisruptionBudget, error)
- func (p *PodDisruptionBudgetOption) UpdateIfSelectorChangedPodDisruptionaBudget(ctx context.Context, namespace string, ...) error
- func (p *PodDisruptionBudgetOption) UpdatePodDisruptionBudget(ctx context.Context, namespace string, ...) error
- type PodOption
- func (p *PodOption) CreateOrUpdatePod(ctx context.Context, namespace string, pod *corev1.Pod) error
- func (p *PodOption) CreatePod(ctx context.Context, namespace string, pod *corev1.Pod) error
- func (p *PodOption) DeletePod(ctx context.Context, namespace string, name string, ...) error
- func (p *PodOption) Exec(ctx context.Context, namespace, name, containerName string, cmd []string) (io.Reader, io.Reader, error)
- func (p *PodOption) GetPod(ctx context.Context, namespace string, name string) (*corev1.Pod, error)
- func (p *PodOption) ListPodByLabels(ctx context.Context, namespace string, label_map map[string]string) (*corev1.PodList, error)
- func (p *PodOption) ListPods(ctx context.Context, namespace string) (*corev1.PodList, error)
- func (p *PodOption) PatchPodLabel(ctx context.Context, pod *corev1.Pod, labelkey string, labelValue string) error
- func (p *PodOption) UpdatePod(ctx context.Context, namespace string, pod *corev1.Pod) error
- type RBAC
- type RBACOption
- func (s *RBACOption) CreateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error
- func (s *RBACOption) CreateClusterRoleBinding(ctx context.Context, rb *rbacv1.ClusterRoleBinding) error
- func (s *RBACOption) CreateOrUpdateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error
- func (s *RBACOption) CreateOrUpdateClusterRoleBinding(ctx context.Context, rb *rbacv1.ClusterRoleBinding) error
- func (s *RBACOption) CreateOrUpdateRole(ctx context.Context, namespace string, role *rbacv1.Role) error
- func (s *RBACOption) CreateOrUpdateRoleBinding(ctx context.Context, namespace string, rb *rbacv1.RoleBinding) error
- func (s *RBACOption) CreateRole(ctx context.Context, namespace string, role *rbacv1.Role) error
- func (s *RBACOption) CreateRoleBinding(ctx context.Context, namespace string, rb *rbacv1.RoleBinding) error
- func (s *RBACOption) GetClusterRole(ctx context.Context, name string) (*rbacv1.ClusterRole, error)
- func (s *RBACOption) GetClusterRoleBinding(ctx context.Context, name string) (*rbacv1.ClusterRoleBinding, error)
- func (s *RBACOption) GetRole(ctx context.Context, namespace string, name string) (*rbacv1.Role, error)
- func (s *RBACOption) GetRoleBinding(ctx context.Context, namespace string, name string) (*rbacv1.RoleBinding, error)
- func (s *RBACOption) UpdateClusterRole(ctx context.Context, role *rbacv1.ClusterRole) error
- func (s *RBACOption) UpdateClusterRoleBinding(ctx context.Context, role *rbacv1.ClusterRoleBinding) error
- func (s *RBACOption) UpdateRole(ctx context.Context, namespace string, role *rbacv1.Role) error
- type RedisFailover
- type RedisFailoverService
- func (r *RedisFailoverService) DeleteRedisFailover(ctx context.Context, namespace string, name string) error
- func (r *RedisFailoverService) GetRedisFailover(ctx context.Context, namespace, name string) (*databasesv1.RedisFailover, error)
- func (r *RedisFailoverService) ListRedisFailovers(ctx context.Context, namespace string, opts client.ListOptions) (*databasesv1.RedisFailoverList, error)
- func (r *RedisFailoverService) UpdateRedisFailover(ctx context.Context, inst *databasesv1.RedisFailover) error
- func (r *RedisFailoverService) UpdateRedisFailoverStatus(ctx context.Context, inst *databasesv1.RedisFailover) error
- type RedisSentinel
- type RedisSentinelService
- func (r *RedisSentinelService) DeleteRedisSentinel(ctx context.Context, namespace string, name string) error
- func (r *RedisSentinelService) GetRedisSentinel(ctx context.Context, namespace, name string) (*databasesv1.RedisSentinel, error)
- func (r *RedisSentinelService) ListRedisSentinels(ctx context.Context, namespace string, opts client.ListOptions) (*databasesv1.RedisSentinelList, error)
- func (r *RedisSentinelService) UpdateRedisSentinel(ctx context.Context, inst *databasesv1.RedisSentinel) error
- func (r *RedisSentinelService) UpdateRedisSentinelStatus(ctx context.Context, inst *databasesv1.RedisSentinel) error
- type RedisUser
- type RedisUserOption
- func (r *RedisUserOption) CreateIfNotExistsRedisUser(ctx context.Context, ru *redisv1.RedisUser) error
- func (r *RedisUserOption) CreateOrUpdateRedisUser(ctx context.Context, ru *redisv1.RedisUser) error
- func (r *RedisUserOption) CreateRedisUser(ctx context.Context, ru *redisv1.RedisUser) error
- func (r *RedisUserOption) DeleteRedisUser(ctx context.Context, namespace string, name string) error
- func (r *RedisUserOption) GetRedisUser(ctx context.Context, namespace, name string) (*redisv1.RedisUser, error)
- func (r *RedisUserOption) ListRedisUsers(ctx context.Context, namespace string, opts client.ListOptions) (*redisv1.RedisUserList, error)
- func (r *RedisUserOption) UpdateRedisUser(ctx context.Context, ru *redisv1.RedisUser) error
- type Secret
- type SecretOption
- func (s *SecretOption) CreateIfNotExistsSecret(ctx context.Context, namespace string, secret *v1.Secret) error
- func (s *SecretOption) CreateOrUpdateSecret(ctx context.Context, namespace string, secret *v1.Secret) error
- func (s *SecretOption) CreateSecret(ctx context.Context, namespace string, secret *v1.Secret) error
- func (s *SecretOption) DeleteSecret(ctx context.Context, namespace string, name string) error
- func (s *SecretOption) GetSecret(ctx context.Context, namespace string, name string) (*v1.Secret, error)
- func (s *SecretOption) ListSecret(ctx context.Context, namespace string) (*v1.SecretList, error)
- func (s *SecretOption) UpdateSecret(ctx context.Context, namespace string, secret *v1.Secret) error
- type Service
- type ServiceAccount
- type ServiceAccountOption
- func (s *ServiceAccountOption) CreateOrUpdateServiceAccount(ctx context.Context, namespace string, sa *corev1.ServiceAccount) error
- func (s *ServiceAccountOption) CreateServiceAccount(ctx context.Context, namespace string, sa *corev1.ServiceAccount) error
- func (s *ServiceAccountOption) GetServiceAccount(ctx context.Context, namespace string, name string) (*corev1.ServiceAccount, error)
- type ServiceMonitor
- type ServiceMonitorOption
- func (s *ServiceMonitorOption) CreateOrUpdateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.ServiceMonitor) error
- func (s *ServiceMonitorOption) CreateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.ServiceMonitor) error
- func (s *ServiceMonitorOption) GetServiceMonitor(ctx context.Context, namespace string, name string) (*monitoring.ServiceMonitor, error)
- func (s *ServiceMonitorOption) UpdateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.ServiceMonitor) error
- type ServiceOption
- func (s *ServiceOption) CreateIfNotExistsService(ctx context.Context, namespace string, service *corev1.Service) error
- func (s *ServiceOption) CreateOrUpdateIfServiceChanged(ctx context.Context, namespace string, service *corev1.Service) error
- func (s *ServiceOption) CreateOrUpdateService(ctx context.Context, namespace string, service *corev1.Service) error
- func (s *ServiceOption) CreateService(ctx context.Context, namespace string, service *corev1.Service) error
- func (s *ServiceOption) DeleteService(ctx context.Context, namespace string, name string) error
- func (s *ServiceOption) GetService(ctx context.Context, namespace string, name string) (*corev1.Service, error)
- func (s *ServiceOption) GetServiceByLabels(ctx context.Context, namespace string, labelsMap map[string]string) (*corev1.ServiceList, error)
- func (s *ServiceOption) ListServices(ctx context.Context, namespace string) (*corev1.ServiceList, error)
- func (s *ServiceOption) UpdateIfSelectorChangedService(ctx context.Context, namespace string, service *corev1.Service) error
- func (s *ServiceOption) UpdateService(ctx context.Context, namespace string, service *corev1.Service) error
- type StatefulSet
- type StatefulSetOption
- func (s *StatefulSetOption) CreateIfNotExistsStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error
- func (s *StatefulSetOption) CreateOrUpdateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error
- func (s *StatefulSetOption) CreateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error
- func (s *StatefulSetOption) DeleteStatefulSet(ctx context.Context, namespace string, name string, ...) error
- func (s *StatefulSetOption) GetStatefulSet(ctx context.Context, namespace string, name string) (*appsv1.StatefulSet, error)
- func (s *StatefulSetOption) GetStatefulSetPods(ctx context.Context, namespace string, name string) (*corev1.PodList, error)
- func (s *StatefulSetOption) GetStatefulSetPodsByLabels(ctx context.Context, namespace string, labels map[string]string) (*corev1.PodList, error)
- func (s *StatefulSetOption) ListStatefulSetByLabels(ctx context.Context, namespace string, labels map[string]string) (*appsv1.StatefulSetList, error)
- func (s *StatefulSetOption) ListStatefulSets(ctx context.Context, namespace string) (*appsv1.StatefulSetList, error)
- func (s *StatefulSetOption) UpdateStatefulSet(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 }
type ClientSet ¶
type ClientSet interface { Certificate ConfigMap CronJob Deployment Job Namespaces Pod PodDisruptionBudget PVC RBAC Secret Service ServiceAccount StatefulSet ServiceMonitor RedisFailover RedisSentinel DistributedRedisCluster Node RedisUser Client() client.Client }
Service is the kubernetes service entrypoint.
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
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 ¶
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 ¶
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 }
type CronJobOption ¶
type CronJobOption struct {
// contains filtered or unexported fields
}
func (*CronJobOption) CreateCronJob ¶
func (*CronJobOption) CreateOrUpdateCronJob ¶
func (*CronJobOption) DeleteCronJob ¶
func (c *CronJobOption) DeleteCronJob(ctx context.Context, namespace, name string) error
func (*CronJobOption) GetCronJob ¶
func (*CronJobOption) ListCronJobs ¶
func (c *CronJobOption) ListCronJobs(ctx context.Context, namespace string, cl client.ListOptions) (*v1.CronJobList, error)
func (*CronJobOption) UpdateCronJob ¶
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) // UpdateRedisFailover update the redisfailover on a cluster. UpdateDistributedRedisCluster(ctx context.Context, inst *clusterv1.DistributedRedisCluster) error // UpdateRedisFailoverStatus UpdateDistributedRedisClusterStatus(ctx context.Context, inst *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)
func (*DistributedRedisClusterOption) UpdateDistributedRedisCluster ¶
func (r *DistributedRedisClusterOption) UpdateDistributedRedisCluster(ctx context.Context, inst *clusterv1.DistributedRedisCluster) error
UpdateRedisFailover
func (*DistributedRedisClusterOption) UpdateDistributedRedisClusterStatus ¶
func (r *DistributedRedisClusterOption) UpdateDistributedRedisClusterStatus(ctx context.Context, inst *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) }
type JobOption ¶
type JobOption struct {
// contains filtered or unexported fields
}
func (*JobOption) CreateIfNotExistsJob ¶
func (*JobOption) CreateOrUpdateJob ¶
func (*JobOption) ListJobsByLabel ¶
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
type NamespacesOption ¶
type NamespacesOption struct {
// contains filtered or unexported fields
}
NameSpacesOption is the NameSpaces client implementation using API calls to kubernetes.
func NewNamespaces ¶
func NewNamespaces(kubeClient client.Client, logger logr.Logger) *NamespacesOption
NewNameSpaces returns a new Namespaces client.
func (*NamespacesOption) GetNamespace ¶
func (n *NamespacesOption) GetNamespace(ctx context.Context, namespace string) (*corev1.Namespace, error)
GetNameSpace implement the Namespaces.Interface
type Node ¶
type NodeOption ¶
type NodeOption struct {
// contains filtered or unexported fields
}
func (*NodeOption) ListNodesByLabels ¶
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, opts ...client.DeleteOption) 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
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 ¶
CreateOrUpdatePod implement the Pod.Interface
func (*PodOption) DeletePod ¶
func (p *PodOption) DeletePod(ctx context.Context, namespace string, name string, opts ...client.DeleteOption) 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) ListPodByLabels ¶
func (*PodOption) PatchPodLabel ¶
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 }
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 (*RBACOption) CreateOrUpdateRoleBinding ¶
func (s *RBACOption) CreateOrUpdateRoleBinding(ctx context.Context, namespace string, rb *rbacv1.RoleBinding) error
func (*RBACOption) CreateRole ¶
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) 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 ¶
type RedisFailover ¶
type RedisFailover interface { // ListRedisFailovers lists the redisfailovers on a cluster. ListRedisFailovers(ctx context.Context, namespace string, opts client.ListOptions) (*databasesv1.RedisFailoverList, error) // GetRedisFailover get the redisfailover on a cluster. GetRedisFailover(ctx context.Context, namespace, name string) (*databasesv1.RedisFailover, error) // UpdateRedisFailover update the redisfailover on a cluster. UpdateRedisFailover(ctx context.Context, inst *databasesv1.RedisFailover) error // UpdateRedisFailoverStatus UpdateRedisFailoverStatus(ctx context.Context, inst *databasesv1.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 (*RedisFailoverService) GetRedisFailover ¶
func (r *RedisFailoverService) GetRedisFailover(ctx context.Context, namespace, name string) (*databasesv1.RedisFailover, error)
GetRedisFailover satisfies redisfailover.Service interface.
func (*RedisFailoverService) ListRedisFailovers ¶
func (r *RedisFailoverService) ListRedisFailovers(ctx context.Context, namespace string, opts client.ListOptions) (*databasesv1.RedisFailoverList, error)
ListRedisFailovers satisfies redisfailover.Service interface.
func (*RedisFailoverService) UpdateRedisFailover ¶
func (r *RedisFailoverService) UpdateRedisFailover(ctx context.Context, inst *databasesv1.RedisFailover) error
UpdateRedisFailover
func (*RedisFailoverService) UpdateRedisFailoverStatus ¶
func (r *RedisFailoverService) UpdateRedisFailoverStatus(ctx context.Context, inst *databasesv1.RedisFailover) error
type RedisSentinel ¶
type RedisSentinel interface { // ListRedisSentinels lists the redisfailovers on a cluster. ListRedisSentinels(ctx context.Context, namespace string, opts client.ListOptions) (*databasesv1.RedisSentinelList, error) // GetRedisSentinel get the redisfailover on a cluster. GetRedisSentinel(ctx context.Context, namespace, name string) (*databasesv1.RedisSentinel, error) // UpdateRedisSentinel update the redisfailover on a cluster. UpdateRedisSentinel(ctx context.Context, sen *databasesv1.RedisSentinel) error // UpdateRedisSentinelStatus UpdateRedisSentinelStatus(ctx context.Context, inst *databasesv1.RedisSentinel) error }
RedisSentinel the sen service that knows how to interact with k8s to get them
type RedisSentinelService ¶
type RedisSentinelService struct {
// contains filtered or unexported fields
}
RedisSentinelService is the RedisSentinel service implementation using API calls to kubernetes.
func NewRedisSentinelService ¶
func NewRedisSentinelService(client client.Client, logger logr.Logger) *RedisSentinelService
NewRedisSentinelService returns a new Workspace KubeService.
func (*RedisSentinelService) DeleteRedisSentinel ¶
func (*RedisSentinelService) GetRedisSentinel ¶
func (r *RedisSentinelService) GetRedisSentinel(ctx context.Context, namespace, name string) (*databasesv1.RedisSentinel, error)
GetRedisSentinel satisfies redisfailover.Service interface.
func (*RedisSentinelService) ListRedisSentinels ¶
func (r *RedisSentinelService) ListRedisSentinels(ctx context.Context, namespace string, opts client.ListOptions) (*databasesv1.RedisSentinelList, error)
ListRedisSentinels satisfies redisfailover.Service interface.
func (*RedisSentinelService) UpdateRedisSentinel ¶
func (r *RedisSentinelService) UpdateRedisSentinel(ctx context.Context, inst *databasesv1.RedisSentinel) error
UpdateRedisSentinel
func (*RedisSentinelService) UpdateRedisSentinelStatus ¶
func (r *RedisSentinelService) UpdateRedisSentinelStatus(ctx context.Context, inst *databasesv1.RedisSentinel) error
type RedisUser ¶
type RedisUser interface { // ListRedisUsers lists the redisusers on a cluster. ListRedisUsers(ctx context.Context, namespace string, opts client.ListOptions) (*redisv1.RedisUserList, error) // GetRedisUser get the redisuser on a cluster. GetRedisUser(ctx context.Context, namespace, name string) (*redisv1.RedisUser, error) // UpdateRedisUser update the redisuser on a cluster. UpdateRedisUser(ctx context.Context, ru *redisv1.RedisUser) error // Create CreateRedisUser(ctx context.Context, ru *redisv1.RedisUser) error //create if not exites CreateIfNotExistsRedisUser(ctx context.Context, ru *redisv1.RedisUser) error //create or update CreateOrUpdateRedisUser(ctx context.Context, ru *redisv1.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 (*RedisUserOption) CreateOrUpdateRedisUser ¶
func (*RedisUserOption) CreateRedisUser ¶
func (*RedisUserOption) DeleteRedisUser ¶
func (*RedisUserOption) GetRedisUser ¶
func (*RedisUserOption) ListRedisUsers ¶
func (r *RedisUserOption) ListRedisUsers(ctx context.Context, namespace string, opts client.ListOptions) (*redisv1.RedisUserList, error)
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 }
type SecretOption ¶
type SecretOption struct {
// contains filtered or unexported fields
}
func (*SecretOption) CreateIfNotExistsSecret ¶
func (*SecretOption) CreateOrUpdateSecret ¶
func (*SecretOption) CreateSecret ¶
func (*SecretOption) DeleteSecret ¶
func (*SecretOption) ListSecret ¶
func (s *SecretOption) ListSecret(ctx context.Context, namespace string) (*v1.SecretList, error)
func (*SecretOption) UpdateSecret ¶
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 CreateOrUpdateIfServiceChanged(ctx context.Context, namespace string, service *corev1.Service) error }
Service the client that knows how to interact with kubernetes to manage them
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) (*monitoring.ServiceMonitor, error) CreateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.ServiceMonitor) error CreateOrUpdateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.ServiceMonitor) error UpdateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.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 *monitoring.ServiceMonitor) error
func (*ServiceMonitorOption) CreateServiceMonitor ¶
func (s *ServiceMonitorOption) CreateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.ServiceMonitor) error
func (*ServiceMonitorOption) GetServiceMonitor ¶
func (s *ServiceMonitorOption) GetServiceMonitor(ctx context.Context, namespace string, name string) (*monitoring.ServiceMonitor, error)
func (*ServiceMonitorOption) UpdateServiceMonitor ¶
func (s *ServiceMonitorOption) UpdateServiceMonitor(ctx context.Context, namespace string, sm *monitoring.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) CreateOrUpdateIfServiceChanged ¶
func (s *ServiceOption) CreateOrUpdateIfServiceChanged(ctx context.Context, namespace string, service *corev1.Service) error
CreateOrUpdateIfServiceChanged 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 ¶
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 (*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, opts ...client.DeleteOption) 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, opts ...client.DeleteOption) 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