k8s

package
v0.0.0-...-2c87c15 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNodeLabel

func AddNodeLabel(data models.NodeLabels) (*apiv1.Node, error)

func ChangeImageDeployment

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

func CreateConfigmap

func CreateConfigmap(data models.ConfigmapsJson) (*apiv1.ConfigMap, error)

func CreateNamespaces

func CreateNamespaces(name string) error

func CreatePvc

func CreatePvc(data *models.DynamicPVC) (*apiv1.PersistentVolumeClaim, error)

func CreateSecretWithDockerConfigJson

func CreateSecretWithDockerConfigJson(info DockerConfigJson) (*apiv1.Secret, error)

func CreateService

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

func DeleteConfigmaps

func DeleteConfigmaps(namespace, name string) error

func DeleteDeployment

func DeleteDeployment(namespace, name string) error

func DeleteEvents

func DeleteEvents(namespace, name string) error

func DeleteJob

func DeleteJob(namespace, name string) error

func DeleteNamespaces

func DeleteNamespaces(name string) error

func DeleteNode

func DeleteNode(name string) error

func DeleteNodeLabel

func DeleteNodeLabel(nodename, key string) (*apiv1.Node, error)

func DeletePod

func DeletePod(namespace, name string) error

func DeletePv

func DeletePv(name string) error

func DeletePvc

func DeletePvc(namespace, name string) error

func DeleteRbac

func DeleteRbac(namespace, name string) error

func DeleteSecret

func DeleteSecret(namespace, name string) error

func DeleteSecretWithDockerConfigJson

func DeleteSecretWithDockerConfigJson(namespace, username, server string) error

func DeleteService

func DeleteService(namespace, name string) error

func DeleteServiceAccount

func DeleteServiceAccount(namespace, name string) error

func DeleteStorageClass

func DeleteStorageClass(name string) error

func EncodeBase64

func EncodeBase64(in string) string

加密base64

func GetClientSet

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

func GetClientSetAndConfig

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

func GetConfigmapsByName

func GetConfigmapsByName(namespace, name string) (*apiv1.ConfigMap, error)

func GetConfigmapsList

func GetConfigmapsList() (*apiv1.ConfigMapList, error)

func GetConfigmapsListByLabels

func GetConfigmapsListByLabels(namespace, labels string) (*apiv1.ConfigMapList, error)

func GetConfigmapsListByOnlyLabels

func GetConfigmapsListByOnlyLabels(labels string) (*apiv1.ConfigMapList, error)

func GetDeploymentByName

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

func GetDeploymentList

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

func GetDeploymentListByNamespace

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

func GetEvenstList

func GetEvenstList() (*apiv1.EventList, error)

func GetEventsByName

func GetEventsByName(namespace, name string) (*apiv1.Event, error)

func GetEventsByNamespace

func GetEventsByNamespace(namespace string) (*apiv1.EventList, 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 GetNamespaces

func GetNamespaces() (*apiv1.NamespaceList, error)

func GetNamespacesByName

func GetNamespacesByName(name string) (*apiv1.Namespace, error)

func GetNodeByName

func GetNodeByName(name string) (*apiv1.Node, error)

func GetNodeList

func GetNodeList() (*apiv1.NodeList, 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 GetPvByName

func GetPvByName(name string) (*apiv1.PersistentVolume, error)

func GetPvList

func GetPvList() (*apiv1.PersistentVolumeList, error)

func GetPvcByName

func GetPvcByName(namespace, name string) (*apiv1.PersistentVolumeClaim, error)

func GetPvcList

func GetPvcList() (*apiv1.PersistentVolumeClaimList, error)

func GetRbacByName

func GetRbacByName(namespace, name string) (*v1.Role, error)

func GetRbacList

func GetRbacList() (*v1.RoleList, error)

func GetSecretByLables

func GetSecretByLables(namespace, labels string) (*apiv1.SecretList, error)

func GetSecretByName

func GetSecretByName(namespace, name string) (*apiv1.Secret, error)

func GetSecretList

func GetSecretList() (*apiv1.SecretList, error)

func GetServiceAccountByName

func GetServiceAccountByName(namespace, name string) (*apiv1.ServiceAccount, error)

func GetServiceAccountList

func GetServiceAccountList() (*apiv1.ServiceAccountList, 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 GetStorageClassByName

func GetStorageClassByName(name string) (*v1.StorageClass, error)

func GetStorageClassList

func GetStorageClassList() (*v1.StorageClassList, error)

func InitClientSet

func InitClientSet()

func Jiami

func Jiami(code string) string

加密

func MutilDeleteNamespace

func MutilDeleteNamespace(name models.Namespaces) error

func PatchServicePort

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

func ScaleDeployment

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

func UpdateConfigmap

func UpdateConfigmap(data models.ConfigmapsJson) (*apiv1.ConfigMap, error)

Types

type DockerConfigJson

type DockerConfigJson struct {
	Namespace   string            `namespace`
	Name        string            `name`
	Password    string            `password`
	Server      string            `server`
	Annotations map[string]string `annotations`
	Labels      map[string]string `labels`
}

func (DockerConfigJson) GetAuth

func (this DockerConfigJson) GetAuth() []byte

{"auths":{"(server)":{"username":"***","password":"***","email":"***","auth":"base64(***)"}}}

type KubeConfig

type KubeConfig struct {
	Config string
}

func NewKubeConfig

func NewKubeConfig() *KubeConfig

func (*KubeConfig) GetClientSet

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

func (*KubeConfig) GetClientSetInner

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

type RemoteCommand

type RemoteCommand struct {
	Resource  string   `json:"resource"`  // pods
	PodName   string   `json:"podname"`   // pod名称
	Container string   `json:"container"` // pod内container名称
	Namespace string   `json:"namespace"` // 命名空间
	Command   []string `json:"command"`   // 执行命令
}

func (*RemoteCommand) Exec

func (this *RemoteCommand) Exec() (string, string, error)

stdout,stderr,err

Jump to

Keyboard shortcuts

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