kubernetes

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseK8SYAML added in v0.2.6

func ParseK8SYAML(data []byte) (runtime.Object, error)

Types

type KubeCtl

type KubeCtl struct {
	Clientset kubernetes.Interface
}

KubeCtl object is used to interact with the kubernetes cluster. Use the export function New to Get a KubeCtl object.

func New

func New(clientset kubernetes.Interface) *KubeCtl

New is the API to New a kubectl object and you need to pass two parameters 1. The kubernetes clientset object from the client-go library. You can also use the fake-client for testing 2. The namespace of the kubernetes you want to manipulate

func (*KubeCtl) CreateAutoscaler added in v0.2.9

func (kc *KubeCtl) CreateAutoscaler(autoscaler *v1beta2.HorizontalPodAutoscaler, namespace string) (*v1beta2.HorizontalPodAutoscaler, error)

CreateAutoscaler will create a autoscaler

func (*KubeCtl) CreateConfigMap added in v0.2.9

func (kc *KubeCtl) CreateConfigMap(configMap *corev1.ConfigMap, namespace string) (*corev1.ConfigMap, error)

CreateConfigMap will create the configMap by the configMap object

func (*KubeCtl) CreateDeployment

func (kc *KubeCtl) CreateDeployment(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)

CreateDeployment will get the external IP address of node

func (*KubeCtl) CreateNamespace added in v0.1.13

func (kc *KubeCtl) CreateNamespace(namespace *corev1.Namespace) (*corev1.Namespace, error)

CreateNamespace will create the namespace by the namespace object

func (*KubeCtl) CreatePVC

func (kc *KubeCtl) CreatePVC(pvc *corev1.PersistentVolumeClaim, namespace string) (*corev1.PersistentVolumeClaim, error)

CreatePVC will create the PVC by the PVC object

func (*KubeCtl) CreatePod

func (kc *KubeCtl) CreatePod(pod *corev1.Pod, namespace string) (*corev1.Pod, error)

CreatePod will create the pod by the pod object

func (*KubeCtl) CreateService

func (kc *KubeCtl) CreateService(service *corev1.Service, namespace string) (*corev1.Service, error)

CreateService will create the service by the service object

func (*KubeCtl) CreateStorageClass

func (kc *KubeCtl) CreateStorageClass(storageClass *v1.StorageClass) (*v1.StorageClass, error)

CreateStorageClass will get the external IP address of node

func (*KubeCtl) DeleteAutoscaler added in v0.2.9

func (kc *KubeCtl) DeleteAutoscaler(name string, namespace string) error

DeleteAutoscaler will delete a autoscaler

func (*KubeCtl) DeleteConfigMap added in v0.2.9

func (kc *KubeCtl) DeleteConfigMap(name string, namespace string) error

DeleteConfigMap will delete the configMap by the configMap name

func (*KubeCtl) DeleteDeployment

func (kc *KubeCtl) DeleteDeployment(name string, namespace string) error

DeleteDeployment will delete deploy

func (*KubeCtl) DeleteNamespace added in v0.1.13

func (kc *KubeCtl) DeleteNamespace(name string) error

DeleteNamespace will delete the namespace by the namespace name

func (*KubeCtl) DeletePVC

func (kc *KubeCtl) DeletePVC(name string, namespace string) error

DeletePVC will delete the PVC by the PVC name

func (*KubeCtl) DeletePod

func (kc *KubeCtl) DeletePod(name string, namespace string) error

DeletePod will delete the pod by the pod name

func (*KubeCtl) DeleteService

func (kc *KubeCtl) DeleteService(name string, namespace string) error

DeleteService will delete the service by the service name

func (*KubeCtl) DeleteStorageClass

func (kc *KubeCtl) DeleteStorageClass(name string) error

DeleteStorageClass willl delete storage class

func (*KubeCtl) GetAutoscaler added in v0.2.9

func (kc *KubeCtl) GetAutoscaler(name string, namespace string) (*v1beta2.HorizontalPodAutoscaler, error)

GetAutoscaler will get a autoscaler

func (*KubeCtl) GetConfigMap added in v0.2.9

func (kc *KubeCtl) GetConfigMap(name string, namespace string) (*corev1.ConfigMap, error)

GetConfigMap will get the configMap object by the configMap name

func (*KubeCtl) GetConfigMaps added in v0.2.9

func (kc *KubeCtl) GetConfigMaps(namespace string) ([]*corev1.ConfigMap, error)

GetConfigMaps will get all configMaps from the k8s cluster

func (*KubeCtl) GetDeployment

func (kc *KubeCtl) GetDeployment(name string, namespace string) (*appsv1.Deployment, error)

GetDeployment will get deploy

func (*KubeCtl) GetDeployments

func (kc *KubeCtl) GetDeployments(namespace string) ([]*appsv1.Deployment, error)

GetDeployments will get deploys

func (*KubeCtl) GetNamespace added in v0.1.13

func (kc *KubeCtl) GetNamespace(name string) (*corev1.Namespace, error)

GetNamespace will get the namespace object by the namespace name

func (*KubeCtl) GetNamespaces added in v0.1.13

func (kc *KubeCtl) GetNamespaces() ([]*corev1.Namespace, error)

GetNamespaces will get all namespaces from the k8s cluster

func (*KubeCtl) GetNode

func (kc *KubeCtl) GetNode(name string) (*corev1.Node, error)

GetNode will get the node object by the node name

func (*KubeCtl) GetNodeExternalIP

func (kc *KubeCtl) GetNodeExternalIP(name string) (string, error)

GetNodeExternalIP will get the external IP address of node

func (*KubeCtl) GetNodeInternalIP

func (kc *KubeCtl) GetNodeInternalIP(name string) (string, error)

GetNodeInternalIP wil get the internal IP address of node

func (*KubeCtl) GetNodes

func (kc *KubeCtl) GetNodes() ([]*corev1.Node, error)

GetNodes will get all nodes from the k8s cluster

func (*KubeCtl) GetPVC

func (kc *KubeCtl) GetPVC(name string, namespace string) (*corev1.PersistentVolumeClaim, error)

GetPVC will get the PVC object by the PVC name

func (*KubeCtl) GetPVCs

func (kc *KubeCtl) GetPVCs(namespace string) ([]*corev1.PersistentVolumeClaim, error)

GetPVCs will get all PVCs from the k8s cluster

func (*KubeCtl) GetPod

func (kc *KubeCtl) GetPod(name string, namespace string) (*corev1.Pod, error)

GetPod will get the pod object by the pod name

func (*KubeCtl) GetPods

func (kc *KubeCtl) GetPods(namespace string) ([]*corev1.Pod, error)

GetPods will get all pods from the k8s cluster

func (*KubeCtl) GetService

func (kc *KubeCtl) GetService(name string, namespace string) (*corev1.Service, error)

GetService will get the service object by the service name

func (*KubeCtl) GetServices

func (kc *KubeCtl) GetServices(namespace string) ([]*corev1.Service, error)

GetServices will get all services from the k8s cluster

func (*KubeCtl) GetStorageClass

func (kc *KubeCtl) GetStorageClass(name string) (*v1.StorageClass, error)

GetStorageClass will get storage class

func (*KubeCtl) IsPodCompleted

func (kc *KubeCtl) IsPodCompleted(pod *corev1.Pod) bool

IsPodCompleted will check that pod is completed

Jump to

Keyboard shortcuts

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