k8s

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodStatusPending     = "Pending"
	PodStatusRunning     = "Running"
	PodStatusTerminating = "Terminating"
	PodStatusSucceeded   = "Succeeded"
	PodStatusFailed      = "Failed"
	PodStatusKilled      = "Killed"
	PodStatusUnknown     = "Unknown"
)
View Source
const DeploymentSuccessConditionAll = "!status.unavailableReplicas"
View Source
const JobFailureCondition = "status.failed > 0"
View Source
const JobSuccessCondition = "status.succeeded > 0"

Variables

View Source
var (
	Config *rest.Config
)

Functions

func AWSCredentials

func AWSCredentials() []corev1.EnvVar

func CPU added in v0.2.0

func CPU(cpu string) k8sresource.Quantity

func CortexConfigVolume

func CortexConfigVolume() corev1.Volume

func CortexConfigVolumeMount

func CortexConfigVolumeMount() corev1.VolumeMount

func CreateDeployment

func CreateDeployment(spec *DeploymentSpec) (*appsv1b1.Deployment, error)

func CreateIngress

func CreateIngress(spec *IngressSpec) (*v1beta1.Ingress, error)

func CreateJob

func CreateJob(spec *JobSpec) (*batchv1.Job, error)

func CreatePod

func CreatePod(spec *PodSpec) (*corev1.Pod, error)

func CreateService

func CreateService(spec *ServiceSpec) (*corev1.Service, error)

func DefaultVolumeMounts

func DefaultVolumeMounts() []corev1.VolumeMount

func DefaultVolumes

func DefaultVolumes() []corev1.Volume

func DeleteDeployment

func DeleteDeployment(name string) (bool, error)

func DeleteIngress

func DeleteIngress(name string) (bool, error)

func DeleteJob

func DeleteJob(name string) (bool, error)

func DeletePod

func DeletePod(name string) (bool, error)

func DeleteService

func DeleteService(name string) (bool, error)

func Deployment

func Deployment(spec *DeploymentSpec) *appsv1b1.Deployment

func DeploymentExists

func DeploymentExists(name string) (bool, error)

func DeploymentMap

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

func DeploymentStartTime

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

func EmptyDirVolume

func EmptyDirVolume() corev1.Volume

func EmptyDirVolumeMount

func EmptyDirVolumeMount() corev1.VolumeMount

func FieldSelectorNotIn

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

func GetDeployment

func GetDeployment(name string) (*appsv1b1.Deployment, error)

func GetIngress

func GetIngress(name string) (*v1beta1.Ingress, error)

func GetJob

func GetJob(name string) (*batchv1.Job, error)

func GetPod

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

func GetPodLastContainerStartTime

func GetPodLastContainerStartTime(pod *corev1.Pod) *time.Time

func GetPodStatus

func GetPodStatus(pod *corev1.Pod) string

func GetService

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

func Ingress

func Ingress(spec *IngressSpec) *v1beta1.Ingress

func IngressExists

func IngressExists(name string) (bool, error)

func IngressMap

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

func Job

func Job(spec *JobSpec) *batchv1.Job

func JobExists

func JobExists(name string) (bool, error)

func JobMap

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

func LabelSelector

func LabelSelector(labels map[string]string) string

func ListDeployments

func ListDeployments(opts *metav1.ListOptions) ([]appsv1b1.Deployment, error)

func ListDeploymentsByLabel

func ListDeploymentsByLabel(labelKey string, labelValue string) ([]appsv1b1.Deployment, error)

func ListDeploymentsByLabels

func ListDeploymentsByLabels(labels map[string]string) ([]appsv1b1.Deployment, error)

func ListIngresses

func ListIngresses(opts *metav1.ListOptions) ([]v1beta1.Ingress, error)

func ListIngressesByLabel

func ListIngressesByLabel(labelKey string, labelValue string) ([]v1beta1.Ingress, error)

func ListIngressesByLabels

func ListIngressesByLabels(labels map[string]string) ([]v1beta1.Ingress, error)

func ListJobs

func ListJobs(opts *metav1.ListOptions) ([]batchv1.Job, error)

func ListJobsByLabel

func ListJobsByLabel(labelKey string, labelValue string) ([]batchv1.Job, error)

func ListJobsByLabels

func ListJobsByLabels(labels map[string]string) ([]batchv1.Job, error)

func ListPods

func ListPods(opts *metav1.ListOptions) ([]corev1.Pod, error)

func ListPodsByLabel

func ListPodsByLabel(labelKey string, labelValue string) ([]corev1.Pod, error)

func ListPodsByLabels

func ListPodsByLabels(labels map[string]string) ([]corev1.Pod, error)

func ListServices

func ListServices(opts *metav1.ListOptions) ([]corev1.Service, error)

func ListServicesByLabel

func ListServicesByLabel(labelKey string, labelValue string) ([]corev1.Service, error)

func ListServicesByLabels

func ListServicesByLabels(labels map[string]string) ([]corev1.Service, error)

func Mem

func Mem(mem string) k8sresource.Quantity

func Pod

func Pod(spec *PodSpec) *corev1.Pod

func PodExists

func PodExists(name string) (bool, error)

func PodMap

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

func Service

func Service(spec *ServiceSpec) *corev1.Service

func ServiceExists

func ServiceExists(name string) (bool, error)

func ServiceMap

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

func StalledPods

func StalledPods() ([]corev1.Pod, error)

func UpdateDeployment

func UpdateDeployment(deployment *appsv1b1.Deployment) (*appsv1b1.Deployment, error)

func UpdateJob

func UpdateJob(job *batchv1.Job) (*batchv1.Job, error)

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

func WaitForPodRunning

func WaitForPodRunning(name string, numSeconds int) error

Types

type DeploymentSpec

type DeploymentSpec struct {
	Name      string
	Namespace string
	Replicas  int32
	PodSpec   PodSpec
	Labels    map[string]string
	Selector  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 corev1.PodSpec
	Labels     map[string]string
}

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