ukubernetes

package
v0.0.0-...-881d3a2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(runOutsideCluster bool) (*rest.Config, error)

GetConfig returns k8s Config struct

func GetKClient

func GetKClient(restconfig *rest.Config) (*kubernetes.Clientset, error)

GetKClient returns *kubernetes.Clientset with tested connection

func GetPodDeployment

func GetPodDeployment(kClient *kubernetes.Clientset, namespace, podName string) (deployments []string, err error)

GetPodDeployment return's pod's Deployment object

func GetPodRequests

func GetPodRequests(kClient *kubernetes.Clientset, namespace, podName string) (cpu int64, mem int64, err error)

GetPodsCpuReq returns CPU and memory requests 0.100 CPU mean "1/10 of 1 core CPU time". memory units is bytes

func GetPodsBySelector

func GetPodsBySelector(kClient *kubernetes.Clientset, namespace string, selector map[string]string) (*v1.PodList, error)

GetPodsBySelector

func GetSvcSelectorByIngressBackend

func GetSvcSelectorByIngressBackend(kClient *kubernetes.Clientset, namespace string, ServiceName string) (map[string]string, error)

GetSvcSelectorByIngressBackend returns service's selector

Types

type Ingress

type Ingress struct {
	Name      string
	Namespace string
	Rules     []Rule
}

Ingress

type IngressBackend

type IngressBackend struct {
	// Specifies the name of the referenced service.
	ServiceName string `json:"serviceName" protobuf:"bytes,1,opt,name=serviceName"`

	// Specifies the port of the referenced service.
	ServicePort intstr.IntOrString `json:"servicePort" protobuf:"bytes,2,opt,name=servicePort"`
}

IngressBackend describes all endpoints for a given service and port.

func GetIngressBackend

func GetIngressBackend(kClient *kubernetes.Clientset, namespace, ingress, host, path string) (backend IngressBackend, err error)

GetIngressBackend returns ingress backend by specific host and path

type Rule

type Rule struct {
	Host  string
	Paths []string
}

Ingress rule

Jump to

Keyboard shortcuts

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