services

package
v0.0.0-...-5457273 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterService

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

func NewClusterService

func NewClusterService(clientset *kubernetes.Clientset) *ClusterService

func (*ClusterService) DeleteNode

func (s *ClusterService) DeleteNode(nodeName string) error

DeleteNode deletes a node from the cluster

func (*ClusterService) GetClusterInfo

func (s *ClusterService) GetClusterInfo() (*k8s.ClusterInfo, error)

GetClusterInfo retrieves general information about the Kubernetes cluster

func (*ClusterService) GetNode

func (s *ClusterService) GetNode(nodeName string) (*k8s.NodeInfo, error)

GetNode retrieves detailed information of a specific node

func (*ClusterService) ListNodes

func (s *ClusterService) ListNodes() ([]k8s.NodeInfo, error)

ListNodes lists all nodes in the cluster

type ConfigMapService

type ConfigMapService struct {
	K8sClient *client.Client
}

func NewConfigMapService

func NewConfigMapService(k8sClient *client.Client) *ConfigMapService

func (*ConfigMapService) CreateConfigMap

func (s *ConfigMapService) CreateConfigMap(namespace string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)

func (*ConfigMapService) DeleteConfigMap

func (s *ConfigMapService) DeleteConfigMap(namespace, name string) error

func (*ConfigMapService) GetConfigMap

func (s *ConfigMapService) GetConfigMap(namespace, name string) (*v1.ConfigMap, error)

func (*ConfigMapService) UpdateConfigMap

func (s *ConfigMapService) UpdateConfigMap(namespace string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)

type DaemonSetService

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

DaemonSetService 提供对 Kubernetes DaemonSet 资源的操作

func NewDaemonSetService

func NewDaemonSetService(client *client.Client) *DaemonSetService

NewDaemonSetService 创建一个新的 DaemonSetService 实例

func (*DaemonSetService) CreateDaemonSet

func (s *DaemonSetService) CreateDaemonSet(namespace string, daemonSet *appsv1.DaemonSet) (*k8s.DaemonSetModel, error)

CreateDaemonSet 创建一个新的 DaemonSet

func (*DaemonSetService) DeleteDaemonSet

func (s *DaemonSetService) DeleteDaemonSet(namespace, name string) error

DeleteDaemonSet 删除指定命名空间中的指定 DaemonSet

func (*DaemonSetService) GetDaemonSet

func (s *DaemonSetService) GetDaemonSet(namespace, name string) (*k8s.DaemonSetModel, error)

GetDaemonSet 获取指定命名空间中指定 DaemonSet 的详细信息

func (*DaemonSetService) ListDaemonSets

func (s *DaemonSetService) ListDaemonSets(namespace string) ([]k8s.DaemonSetModel, error)

ListDaemonSets 列出指定命名空间中的所有 DaemonSets

func (*DaemonSetService) UpdateDaemonSet

func (s *DaemonSetService) UpdateDaemonSet(namespace string, daemonSet *appsv1.DaemonSet) (*k8s.DaemonSetModel, error)

UpdateDaemonSet 更新指定的 DaemonSet

type DeploymentService

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

DeploymentService provides methods for interacting with Kubernetes Deployments

func NewDeploymentService

func NewDeploymentService(k8sClient *client.Client) *DeploymentService

NewDeploymentService creates a new DeploymentService instance with a Kubernetes client

func (*DeploymentService) CreateDeployment

func (s *DeploymentService) CreateDeployment(ctx context.Context, deployment *k8s.Deployment) error

CreateDeployment creates a new Deployment

func (*DeploymentService) DeleteDeployment

func (s *DeploymentService) DeleteDeployment(ctx context.Context, namespace, name string) error

DeleteDeployment deletes a Deployment by name and namespace

func (*DeploymentService) GetDeployment

func (s *DeploymentService) GetDeployment(ctx context.Context, namespace, name string) (*k8s.Deployment, error)

GetDeployment retrieves a single Deployment by name and namespace

func (*DeploymentService) ListDeployments

func (s *DeploymentService) ListDeployments(ctx context.Context, namespace string) ([]k8s.Deployment, error)

ListDeployments retrieves a list of Deployments in the specified namespace

func (*DeploymentService) UpdateDeployment

func (s *DeploymentService) UpdateDeployment(ctx context.Context, deployment *k8s.Deployment) error

UpdateDeployment updates an existing Deployment

type IngressService

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

func NewIngressService

func NewIngressService(clientset *kubernetes.Clientset) *IngressService

NewIngressService creates a new instance of IngressService

func (*IngressService) CreateIngress

func (s *IngressService) CreateIngress(namespace string, ingress *networkingv1.Ingress) (*networkingv1.Ingress, error)

CreateIngress creates a new ingress in a given namespace

func (*IngressService) DeleteIngress

func (s *IngressService) DeleteIngress(namespace, name string) error

DeleteIngress deletes an ingress by name in a given namespace

func (*IngressService) GetIngress

func (s *IngressService) GetIngress(namespace, name string) (*networkingv1.Ingress, error)

GetIngress retrieves a specific ingress by name in a given namespace

func (*IngressService) ListIngresses

func (s *IngressService) ListIngresses(namespace string) ([]networkingv1.Ingress, error)

ListIngresses lists all ingresses in a given namespace

type NamespaceService

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

NamespaceService provides methods for managing Kubernetes Namespaces

func NewNamespaceService

func NewNamespaceService(client *client.Client) *NamespaceService

NewNamespaceService creates a new NamespaceService

func (*NamespaceService) CreateNamespace

func (s *NamespaceService) CreateNamespace(name string, labels map[string]string) (*k8s.Namespace, error)

CreateNamespace creates a new Namespace

func (*NamespaceService) DeleteNamespace

func (s *NamespaceService) DeleteNamespace(name string) error

DeleteNamespace deletes an existing Namespace by name

func (*NamespaceService) GetNamespace

func (s *NamespaceService) GetNamespace(name string) (*k8s.Namespace, error)

GetNamespace retrieves a single Namespace by name

func (*NamespaceService) ListNamespaces

func (s *NamespaceService) ListNamespaces() ([]*k8s.Namespace, error)

ListNamespaces retrieves a list of Namespaces

type NodeService

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

func NewNodeService

func NewNodeService(client *client.Client) *NodeService

NewNodeService creates a new NodeService

func (*NodeService) CreateNode

func (s *NodeService) CreateNode(node *v1.Node) (*k8s.NodeModel, error)

CreateNode creates a new Node

func (*NodeService) DeleteNode

func (s *NodeService) DeleteNode(name string) error

DeleteNode deletes a Node by name

func (*NodeService) GetNode

func (s *NodeService) GetNode(name string) (*k8s.NodeModel, error)

GetNode returns the details of a specific Node

func (*NodeService) ListNodes

func (s *NodeService) ListNodes() ([]k8s.NodeModel, error)

ListNodes returns a list of all Nodes with detailed information

type PVCService

type PVCService struct {
	K8sClient *client.Client
}

func NewPVCService

func NewPVCService(k8sClient *client.Client) *PVCService

func (*PVCService) CreatePVC

func (s *PVCService) CreatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)

func (*PVCService) DeletePVC

func (s *PVCService) DeletePVC(namespace, name string) error

func (*PVCService) GetPVC

func (s *PVCService) GetPVC(namespace, name string) (*v1.PersistentVolumeClaim, error)

func (*PVCService) UpdatePVC

func (s *PVCService) UpdatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)

type PVService

type PVService struct {
	K8sClient *client.Client
}

func NewPVService

func NewPVService(k8sClient *client.Client) *PVService

func (*PVService) CreatePV

func (s *PVService) CreatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)

func (*PVService) DeletePV

func (s *PVService) DeletePV(name string) error

func (*PVService) GetPV

func (s *PVService) GetPV(name string) (*v1.PersistentVolume, error)

func (*PVService) UpdatePV

func (s *PVService) UpdatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)

type PodService

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

func NewPodService

func NewPodService(c *client.Client) *PodService

func (*PodService) CreatePod

func (ps *PodService) CreatePod(namespace string, pod *corev1.Pod) (*k8s.Pod, error)

func (*PodService) DeletePod

func (ps *PodService) DeletePod(namespace, podName string) error

func (*PodService) GetPod

func (ps *PodService) GetPod(namespace, podName string) (*k8s.Pod, error)

func (*PodService) ListPods

func (ps *PodService) ListPods(namespace string) ([]k8s.Pod, error)

type SecretService

type SecretService struct {
	K8sClient *client.Client
}

func NewSecretService

func NewSecretService(k8sClient *client.Client) *SecretService

func (*SecretService) CreateSecret

func (s *SecretService) CreateSecret(namespace string, secret *v1.Secret) (*v1.Secret, error)

func (*SecretService) DeleteSecret

func (s *SecretService) DeleteSecret(namespace, name string) error

func (*SecretService) GetSecret

func (s *SecretService) GetSecret(namespace, name string) (*v1.Secret, error)

func (*SecretService) UpdateSecret

func (s *SecretService) UpdateSecret(namespace string, secret *v1.Secret) (*v1.Secret, error)

type ServiceService

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

ServiceService 提供对 Kubernetes Service 资源的操作

func NewServiceService

func NewServiceService(client *client.Client) *ServiceService

NewServiceService 创建一个新的 ServiceService 实例

func (*ServiceService) CreateService

func (s *ServiceService) CreateService(namespace string, service *v1.Service) (*k8s.ServiceModel, error)

CreateService 创建一个新的 Service

func (*ServiceService) DeleteService

func (s *ServiceService) DeleteService(namespace, name string) error

DeleteService 删除指定命名空间中的指定 Service

func (*ServiceService) GetService

func (s *ServiceService) GetService(namespace, name string) (*k8s.ServiceModel, error)

GetService 获取指定命名空间中指定 Service 的详细信息

func (*ServiceService) ListAllServices

func (s *ServiceService) ListAllServices() ([]k8s.ServiceModel, error)

ListAllServices 列出所有命名空间中的所有 Services

func (*ServiceService) ListServices

func (s *ServiceService) ListServices(namespace string) ([]k8s.ServiceModel, error)

ListServices 列出指定命名空间中的所有 Services

type StatefulSetService

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

func NewStatefulSetService

func NewStatefulSetService(client *client.Client) *StatefulSetService

func (*StatefulSetService) CreateStatefulSet

func (s *StatefulSetService) CreateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)

func (*StatefulSetService) DeleteStatefulSet

func (s *StatefulSetService) DeleteStatefulSet(namespace, name string) error

func (*StatefulSetService) GetStatefulSet

func (s *StatefulSetService) GetStatefulSet(namespace, name string) (*k8s.StatefulSetModel, error)

func (*StatefulSetService) ListStatefulSets

func (s *StatefulSetService) ListStatefulSets(namespace string) ([]k8s.StatefulSetModel, error)

func (*StatefulSetService) UpdateStatefulSet

func (s *StatefulSetService) UpdateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)

type StorageClassService

type StorageClassService struct {
	K8sClient *client.Client
}

func NewStorageClassService

func NewStorageClassService(k8sClient *client.Client) *StorageClassService

func (*StorageClassService) CreateStorageClass

func (s *StorageClassService) CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)

func (*StorageClassService) DeleteStorageClass

func (s *StorageClassService) DeleteStorageClass(name string) error

func (*StorageClassService) GetStorageClass

func (s *StorageClassService) GetStorageClass(name string) (*storagev1.StorageClass, error)

func (*StorageClassService) UpdateStorageClass

func (s *StorageClassService) UpdateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)

Jump to

Keyboard shortcuts

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