k8s

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWSCredentials

func AWSCredentials() []kcore.EnvVar

func CPU

func CPU(cpu string) kresource.Quantity

func ConfigMap added in v0.7.0

func ConfigMap(spec *ConfigMapSpec) *kcore.ConfigMap

func ConfigMapMap added in v0.7.0

func ConfigMapMap(configMaps []kcore.ConfigMap) map[string]kcore.ConfigMap

func CortexConfigVolume

func CortexConfigVolume() kcore.Volume

func CortexConfigVolumeMount

func CortexConfigVolumeMount() kcore.VolumeMount

func DefaultVolumeMounts

func DefaultVolumeMounts() []kcore.VolumeMount

func DefaultVolumes

func DefaultVolumes() []kcore.Volume

func Deployment

func Deployment(spec *DeploymentSpec) *kapps.Deployment

func DeploymentMap

func DeploymentMap(deployments []kapps.Deployment) map[string]kapps.Deployment

func DeploymentStartTime

func DeploymentStartTime(deployment *kapps.Deployment) *time.Time

func EmptyDirVolume

func EmptyDirVolume() kcore.Volume

func EmptyDirVolumeMount

func EmptyDirVolumeMount() kcore.VolumeMount

func FieldSelectorNotIn

func FieldSelectorNotIn(key string, values []string) string

func GetPodReadyTime added in v0.7.0

func GetPodReadyTime(pod *kcore.Pod) *time.Time

func HPA added in v0.6.0

func Ingress

func Ingress(spec *IngressSpec) *kextensions.Ingress

func IngressMap

func IngressMap(ingresses []kextensions.Ingress) map[string]kextensions.Ingress

func IsHPAUpToDate added in v0.7.0

func IsHPAUpToDate(hpa *kautoscaling.HorizontalPodAutoscaler, minReplicas int32, maxReplicas int32, targetCPUUtilization int32) bool

func IsPodReady added in v0.7.0

func IsPodReady(pod *kcore.Pod) bool

func Job

func Job(spec *JobSpec) *kbatch.Job

func JobMap

func JobMap(jobs []kbatch.Job) map[string]kbatch.Job

func LabelSelector

func LabelSelector(labels map[string]string) string

func Mem

func Mem(mem string) kresource.Quantity

func Pod

func Pod(spec *PodSpec) *kcore.Pod

func PodMap

func PodMap(pods []kcore.Pod) map[string]kcore.Pod

func Service

func Service(spec *ServiceSpec) *kcore.Service

func ServiceMap

func ServiceMap(services []kcore.Service) map[string]kcore.Service

func ValidName

func ValidName(name string) string

ValidName ensures name contains only lower case alphanumeric, '-', or '.'

func ValidNameContainer

func ValidNameContainer(name string) string

ValidNameContainer ensures name contains only lower case alphanumeric or '-', must start with alphabetic, end with alphanumeric

Types

type Client

type Client struct {
	RestConfig *kclientrest.Config

	Namespace string
	// contains filtered or unexported fields
}

func New

func New(namespace string, inCluster bool) (*Client, error)

func (*Client) ApplyConfigMap added in v0.7.0

func (c *Client) ApplyConfigMap(configMap *kcore.ConfigMap) (*kcore.ConfigMap, error)

func (*Client) ApplyDeployment added in v0.7.0

func (c *Client) ApplyDeployment(deployment *kapps.Deployment) (*kapps.Deployment, error)

func (*Client) ApplyHPA added in v0.7.0

func (*Client) ApplyIngress added in v0.7.0

func (c *Client) ApplyIngress(ingress *kextensions.Ingress) (*kextensions.Ingress, error)

func (*Client) ApplyJob added in v0.7.0

func (c *Client) ApplyJob(job *kbatch.Job) (*kbatch.Job, error)

func (*Client) ApplyPod added in v0.7.0

func (c *Client) ApplyPod(pod *kcore.Pod) (*kcore.Pod, error)

func (*Client) ApplyService added in v0.7.0

func (c *Client) ApplyService(service *kcore.Service) (*kcore.Service, error)

func (*Client) ConfigMapExists added in v0.7.0

func (c *Client) ConfigMapExists(name string) (bool, error)

func (*Client) CreateConfigMap added in v0.7.0

func (c *Client) CreateConfigMap(configMap *kcore.ConfigMap) (*kcore.ConfigMap, error)

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(deployment *kapps.Deployment) (*kapps.Deployment, error)

func (*Client) CreateHPA added in v0.6.0

func (*Client) CreateIngress

func (c *Client) CreateIngress(ingress *kextensions.Ingress) (*kextensions.Ingress, error)

func (*Client) CreateJob

func (c *Client) CreateJob(job *kbatch.Job) (*kbatch.Job, error)

func (*Client) CreatePod

func (c *Client) CreatePod(pod *kcore.Pod) (*kcore.Pod, error)

func (*Client) CreateService

func (c *Client) CreateService(service *kcore.Service) (*kcore.Service, error)

func (*Client) DeleteConfigMap added in v0.7.0

func (c *Client) DeleteConfigMap(name string) (bool, error)

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(name string) (bool, error)

func (*Client) DeleteHPA added in v0.6.0

func (c *Client) DeleteHPA(name string) (bool, error)

func (*Client) DeleteIngress

func (c *Client) DeleteIngress(name string) (bool, error)

func (*Client) DeleteJob

func (c *Client) DeleteJob(name string) (bool, error)

func (*Client) DeletePod

func (c *Client) DeletePod(name string) (bool, error)

func (*Client) DeleteService

func (c *Client) DeleteService(name string) (bool, error)

func (*Client) DeploymentExists

func (c *Client) DeploymentExists(name string) (bool, error)

func (*Client) GetConfigMap added in v0.7.0

func (c *Client) GetConfigMap(name string) (*kcore.ConfigMap, error)

func (*Client) GetConfigMapData added in v0.7.0

func (c *Client) GetConfigMapData(name string) (map[string]string, error)

func (*Client) GetDeployment

func (c *Client) GetDeployment(name string) (*kapps.Deployment, error)

func (*Client) GetHPA added in v0.6.0

func (*Client) GetIngress

func (c *Client) GetIngress(name string) (*kextensions.Ingress, error)

func (*Client) GetJob

func (c *Client) GetJob(name string) (*kbatch.Job, error)

func (*Client) GetPod

func (c *Client) GetPod(name string) (*kcore.Pod, error)

func (*Client) GetService

func (c *Client) GetService(name string) (*kcore.Service, error)

func (*Client) HPAExists added in v0.6.0

func (c *Client) HPAExists(name string) (bool, error)

func (*Client) IngressExists

func (c *Client) IngressExists(name string) (bool, error)

func (*Client) IsJobRunning added in v0.7.0

func (c *Client) IsJobRunning(name string) (bool, error)

func (*Client) JobExists

func (c *Client) JobExists(name string) (bool, error)

func (*Client) ListConfigMaps added in v0.7.0

func (c *Client) ListConfigMaps(opts *kmeta.ListOptions) ([]kcore.ConfigMap, error)

func (*Client) ListConfigMapsByLabel added in v0.7.0

func (c *Client) ListConfigMapsByLabel(labelKey string, labelValue string) ([]kcore.ConfigMap, error)

func (*Client) ListConfigMapsByLabels added in v0.7.0

func (c *Client) ListConfigMapsByLabels(labels map[string]string) ([]kcore.ConfigMap, error)

func (*Client) ListDeployments

func (c *Client) ListDeployments(opts *kmeta.ListOptions) ([]kapps.Deployment, error)

func (*Client) ListDeploymentsByLabel

func (c *Client) ListDeploymentsByLabel(labelKey string, labelValue string) ([]kapps.Deployment, error)

func (*Client) ListDeploymentsByLabels

func (c *Client) ListDeploymentsByLabels(labels map[string]string) ([]kapps.Deployment, error)

func (*Client) ListHPAs added in v0.6.0

func (*Client) ListHPAsByLabel added in v0.6.0

func (c *Client) ListHPAsByLabel(labelKey string, labelValue string) ([]kautoscaling.HorizontalPodAutoscaler, error)

func (*Client) ListHPAsByLabels added in v0.6.0

func (c *Client) ListHPAsByLabels(labels map[string]string) ([]kautoscaling.HorizontalPodAutoscaler, error)

func (*Client) ListIngresses

func (c *Client) ListIngresses(opts *kmeta.ListOptions) ([]kextensions.Ingress, error)

func (*Client) ListIngressesByLabel

func (c *Client) ListIngressesByLabel(labelKey string, labelValue string) ([]kextensions.Ingress, error)

func (*Client) ListIngressesByLabels

func (c *Client) ListIngressesByLabels(labels map[string]string) ([]kextensions.Ingress, error)

func (*Client) ListJobs

func (c *Client) ListJobs(opts *kmeta.ListOptions) ([]kbatch.Job, error)

func (*Client) ListJobsByLabel

func (c *Client) ListJobsByLabel(labelKey string, labelValue string) ([]kbatch.Job, error)

func (*Client) ListJobsByLabels

func (c *Client) ListJobsByLabels(labels map[string]string) ([]kbatch.Job, error)

func (*Client) ListPods

func (c *Client) ListPods(opts *kmeta.ListOptions) ([]kcore.Pod, error)

func (*Client) ListPodsByLabel

func (c *Client) ListPodsByLabel(labelKey string, labelValue string) ([]kcore.Pod, error)

func (*Client) ListPodsByLabels

func (c *Client) ListPodsByLabels(labels map[string]string) ([]kcore.Pod, error)

func (*Client) ListServices

func (c *Client) ListServices(opts *kmeta.ListOptions) ([]kcore.Service, error)

func (*Client) ListServicesByLabel

func (c *Client) ListServicesByLabel(labelKey string, labelValue string) ([]kcore.Service, error)

func (*Client) ListServicesByLabels

func (c *Client) ListServicesByLabels(labels map[string]string) ([]kcore.Service, error)

func (*Client) PodExists

func (c *Client) PodExists(name string) (bool, error)

func (*Client) ServiceExists

func (c *Client) ServiceExists(name string) (bool, error)

func (*Client) StalledPods

func (c *Client) StalledPods() ([]kcore.Pod, error)

func (*Client) WaitForPodRunning

func (c *Client) WaitForPodRunning(name string, numSeconds int) error

type ConfigMapSpec added in v0.7.0

type ConfigMapSpec struct {
	Name      string
	Namespace string
	Data      map[string]string
	Labels    map[string]string
}

type DeploymentSpec

type DeploymentSpec struct {
	Name      string
	Namespace string
	Replicas  int32
	PodSpec   PodSpec
	Labels    map[string]string
	Selector  map[string]string
}

type HPASpec added in v0.6.0

type HPASpec struct {
	DeploymentName       string
	Namespace            string
	MinReplicas          int32
	MaxReplicas          int32
	TargetCPUUtilization int32
	Labels               map[string]string
}

type IngressSpec

type IngressSpec struct {
	Name         string
	Namespace    string
	IngressClass string
	ServiceName  string
	ServicePort  int32
	Path         string
	Labels       map[string]string
}

type JobSpec

type JobSpec struct {
	Name      string
	Namespace string
	PodSpec   PodSpec
	Labels    map[string]string
}

type PodSpec

type PodSpec struct {
	Name       string
	Namespace  string
	K8sPodSpec kcore.PodSpec
	Labels     map[string]string
}

type PodStatus added in v0.5.0

type PodStatus string
const (
	PodStatusUnknown     PodStatus = "Unknown"
	PodStatusPending     PodStatus = "Pending"
	PodStatusRunning     PodStatus = "Running"
	PodStatusTerminating PodStatus = "Terminating"
	PodStatusSucceeded   PodStatus = "Succeeded"
	PodStatusFailed      PodStatus = "Failed"
	PodStatusKilled      PodStatus = "Killed"
	PodStatusKilledOOM   PodStatus = "Out of Memory"
)

func GetPodStatus

func GetPodStatus(pod *kcore.Pod) PodStatus

type ServiceSpec

type ServiceSpec struct {
	Name       string
	Namespace  string
	Port       int32
	TargetPort int32
	Labels     map[string]string
	Selector   map[string]string
}

Jump to

Keyboard shortcuts

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