k8s

package
v0.7.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeImageDeployment

func ChangeImageDeployment(namespace, name, image string) (*v1.Deployment, error)

func CreatePod

func CreatePod(pod *apiv1.Pod) (*apiv1.Pod, error)

创建pod

func CreateService

func CreateService(info *models.Service) (*apiv1.Service, error)

func DeleteDeployment

func DeleteDeployment(namespace, name string) error

func DeleteJob

func DeleteJob(namespace, name string) error

func DeletePod

func DeletePod(namespace, name string) error

func DeleteService

func DeleteService(namespace, name string) error

func GetClientSet

func GetClientSet() (*kubernetes.Clientset, error)

返回k8s client实例和初始化错误信息

func GetClientSetAndConfig

func GetClientSetAndConfig() (*kubernetes.Clientset, *rest.Config)

func GetDeploymentByName

func GetDeploymentByName(namespace, name string) (*v1.Deployment, error)

func GetDeploymentList

func GetDeploymentList() (*v1.DeploymentList, error)

获取deployment列表

func GetDeploymentListByNamespace

func GetDeploymentListByNamespace(namespace string) (*v1.DeploymentList, error)

func GetJobByName

func GetJobByName(namespace, name string) (*apiv1.Job, error)

func GetJobList

func GetJobList(namespace string) (*apiv1.JobList, error)

func GetJobListByLabels

func GetJobListByLabels(namespace, label string) (*apiv1.JobList, error)

func GetPodByName

func GetPodByName(namespace, name string) (*apiv1.Pod, error)

func GetPodList

func GetPodList() (*apiv1.PodList, error)

func GetPodListByLabels

func GetPodListByLabels(namespace, label string) (*apiv1.PodList, error)

func GetPodListByNamespace

func GetPodListByNamespace(namespace string) (*apiv1.PodList, error)

func GetPodLogByPodId

func GetPodLogByPodId(namespace, podid string) (string, error)

func GetPodLogByPodIdAll

func GetPodLogByPodIdAll(namespace, podid string) (string, error)

func GetPodLogByPodIdByNum

func GetPodLogByPodIdByNum(namespace, podid string, num int64) (string, error)

func GetServiceByName

func GetServiceByName(namespace, name string) (*apiv1.Service, error)

func GetServiceList

func GetServiceList() (*apiv1.ServiceList, error)

func GetServiceListByNamespace

func GetServiceListByNamespace(namespace string) (*apiv1.ServiceList, error)

func InitClientSet

func InitClientSet()

兼容k8s inner Cluster 和 Outter Cluster client实例

func PatchServicePort

func PatchServicePort(info *models.Service) (*apiv1.Service, error)

func ScaleDeployment

func ScaleDeployment(namespace, name string, num int32) (*v1.Deployment, error)

Types

type KubeConfig

type KubeConfig struct {
	Config string
}

func (*KubeConfig) GetClientSet

func (this *KubeConfig) GetClientSet() (*kubernetes.Clientset, error)

k8s config实例初始化方法

func (*KubeConfig) GetClientSetInner

func (this *KubeConfig) GetClientSetInner() (*kubernetes.Clientset, error)

k8s集群内部client

Jump to

Keyboard shortcuts

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