k8s

package
v0.0.0-...-de354b7 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildClient

func BuildClient(server string, configV1 clientcmdapiv1.Config) (*kubernetes.Clientset, *rest.Config, error)

Types

type CRDInterface

type CRDInterface interface {
	Create(ctx context.Context, gvk schema.GroupVersionResource, data map[string]interface{}) (*unstructured.Unstructured, error)
	Delete(ctx context.Context, gvk schema.GroupVersionResource, namespace, name string) error
	Get(ctx context.Context, gvk schema.GroupVersionResource, namespace, name string) (*unstructured.Unstructured, error)
	List(ctx context.Context, gvk schema.GroupVersionResource, queryParam metadata.CommonQueryParameter) (*unstructured.UnstructuredList, error)
	Update(ctx context.Context, gvk schema.GroupVersionResource, namespace, name string, data map[string]interface{}) (*unstructured.Unstructured, error)
}

func NewCRDOperation

func NewCRDOperation(dyn dynamic.Interface) CRDInterface

type CRDOperation

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

func (*CRDOperation) Create

func (o *CRDOperation) Create(ctx context.Context, gvk schema.GroupVersionResource, data map[string]interface{}) (*unstructured.Unstructured, error)

func (*CRDOperation) Delete

func (o *CRDOperation) Delete(ctx context.Context, gvk schema.GroupVersionResource, namespace, name string) error

func (*CRDOperation) Get

func (*CRDOperation) Update

func (o *CRDOperation) Update(ctx context.Context, gvk schema.GroupVersionResource, namespace, name string, data map[string]interface{}) (*unstructured.Unstructured, error)

type ConfigmapInterface

type ConfigmapInterface interface {
	Create(ctx context.Context, confMap *v1.ConfigMap) (*v1.ConfigMap, error)
	List(ctx context.Context, queryParam metadata.CommonQueryParameter) ([]v1.ConfigMap, error)
	Delete(ctx context.Context, namespace, name string) error
	Get(ctx context.Context, namespace, name string) (*v1.ConfigMap, error)
	Update(ctx context.Context, namespace, name string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)
}

func NewConfigmapOperation

func NewConfigmapOperation(client *kubernetes.Clientset) ConfigmapInterface

type ConfigmapOperation

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

func (ConfigmapOperation) Create

func (c ConfigmapOperation) Create(ctx context.Context, confMap *v1.ConfigMap) (*v1.ConfigMap, error)

func (ConfigmapOperation) Delete

func (c ConfigmapOperation) Delete(ctx context.Context, namespace, name string) error

func (ConfigmapOperation) Get

func (c ConfigmapOperation) Get(ctx context.Context, namespace, name string) (*v1.ConfigMap, error)

func (ConfigmapOperation) List

func (ConfigmapOperation) Update

func (c ConfigmapOperation) Update(ctx context.Context, namespace, name string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)

type DeploymentInterface

type DeploymentInterface interface {
	Get(ctx context.Context, namespace, name string) (*appsv1.Deployment, error)
	Create(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
	Update(ctx context.Context, namespace, name string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
}

func NewDeploymentOperation

func NewDeploymentOperation(client *kubernetes.Clientset) DeploymentInterface

type DeploymentOperation

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

func (DeploymentOperation) Create

func (o DeploymentOperation) Create(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.Deployment, error)

func (DeploymentOperation) Get

func (o DeploymentOperation) Get(ctx context.Context, namespace, name string) (*appsv1.Deployment, error)

func (DeploymentOperation) Update

func (o DeploymentOperation) Update(ctx context.Context, namespace, name string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)

type HorizontalPodAutoScalerInterface

type HorizontalPodAutoScalerInterface interface {
	Create(ctx context.Context, scaler *v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error)
	List(ctx context.Context, queryParam metadata.CommonQueryParameter) ([]v1.HorizontalPodAutoscaler, error)
	Get(ctx context.Context, namespace, name string) (*v1.HorizontalPodAutoscaler, error)
	Update(ctx context.Context, namespace, name string, scaler *v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error)
	Delete(ctx context.Context, namespace, name string) error
}

func NewHorizontalPodAutoScalerOperation

func NewHorizontalPodAutoScalerOperation(client *kubernetes.Clientset) HorizontalPodAutoScalerInterface

type HorizontalPodAutoScalerOperation

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

func (*HorizontalPodAutoScalerOperation) Create

func (*HorizontalPodAutoScalerOperation) Delete

func (o *HorizontalPodAutoScalerOperation) Delete(ctx context.Context, namespace, name string) error

func (*HorizontalPodAutoScalerOperation) Get

func (*HorizontalPodAutoScalerOperation) List

func (*HorizontalPodAutoScalerOperation) Update

type K8sClient

type K8sClient struct {
	RestConfig *rest.Config
	ClientV1   *kubernetes.Clientset
}

func GetClient

func GetClient(clusterName string) (*K8sClient, error)

type PodFormatStatus

type PodFormatStatus struct {
	Ready  string `json:"ready"`
	Reason string `json:"reason"`
}

func GetFormatStatus

func GetFormatStatus(pod *corev1.Pod) (*PodFormatStatus, error)

Jump to

Keyboard shortcuts

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