kubes

package
v0.0.0-...-8f2f122 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2019 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations map[string]string

type Container

type Container struct {
	Name      string    `json:"name"`
	Image     string    `json:"image"`
	Command   []string  `json:"command"`
	Ports     []Port    `json:"ports" yaml:"ports,omitempty"`
	Env       Env       `json:"env" yaml:"env,omitempty"`
	Resources Resources `json:"resources" yaml:"resources,omitempty"`
}

type CronJob

type CronJob struct {
	APIVersion string `json:"apiVersion" yaml:"apiVersion"`
	Kind       string `json:"kind"`
	Metadata   struct {
		Name        string      `json:"name"`
		Annotations Annotations `json:"annotations" yaml:"annotations,omitempty"`
	} `json:"metadata"`
	Spec struct {
		ConcurrencyPolicy string `json:"concurrencyPolicy" yaml:"concurrencyPolicy"`
		Schedule          string `json:"string"`
		JobTemplate       struct {
			Spec struct {
				Template struct {
					Spec struct {
						DNSPolicy     string      `json:"dnsPolicy" yaml:"dnsPolicy"`
						RestartPolicy string      `json:"restartPolicy" yaml:"restartPolicy"`
						Containers    []Container `json:"containers"`
					}
				} `json:"template"`
			} `json:"spec"`
		} `json:"jobTemplate" yaml:"jobTemplate"`
	} `json:"spec"`
}

func NewCronJob

func NewCronJob(name, schedule, concurrencyPolicy, restartPolicy,
	image string, command []string, env map[string]string, resources Resources, annotations Annotations) *CronJob

type Deployment

type Deployment struct {
	APIVersion string `json:"apiVersion" yaml:"apiVersion"`
	Kind       string `json:"kind"`
	Metadata   struct {
		Name   string `json:"name"`
		Labels struct {
			App string `json:"app"`
		} `json:"labels"`
	} `json:"metadata"`
	Spec struct {
		Replicas int `json:"replicas"`
		Selector struct {
			MatchLabels struct {
				App string `json:"app"`
			} `json:"matchLabels" yaml:"matchLabels"`
		} `json:"selector"`
		Template struct {
			Metadata struct {
				Labels struct {
					App string `json:"app"`
				} `json:"labels"`
			} `json:"metadata"`
			Spec struct {
				DNSPolicy string `json:"dnsPolicy" yaml:"dnsPolicy"`
				DNSConfig struct {
					Options []Option `json:"options"`
				} `json:"dnsConfig" yaml:"dnsConfig"`
				Containers []Container `json:"containers"`
			} `json:"spec"`
		} `json:"template"`
	} `json:"spec"`
}

func NewDeployment

func NewDeployment(name, image string, command []string, replicas, port int, env map[string]string,
	resources Resources) *Deployment

type Env

type Env []Option

type Option

type Option struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Port

type Port struct {
	ContainerPort int `json:"containerPort" yaml:"containerPort,omitempty"`
}

type Resources

type Resources struct {
	Requests struct {
		Memory string `json:"memory" yaml:"memory,omitempty"`
		CPU    string `json:"cpu" yaml:"cpu,omitempty"`
	} `json:"requests" yaml:"requests,omitempty"`
	Limits struct {
		Memory string `json:"memory" yaml:"memory,omitempty"`
		CPU    string `json:"cpu" yaml:"cpu,omitempty"`
	} `json:"limits" yaml:"limits,omitempty"`
}

func NewResources

func NewResources(memLimit, cpuLimit, reqMemLimit, reqCPULimit string) Resources

type Service

type Service struct {
	APIVersion string `json:"apiVersion" yaml:"apiVersion"`
	Kind       string `json:"kind"`
	Metadata   struct {
		Name   string `json:"name"`
		Labels struct {
			App string `json:"app"`
		} `json:"labels"`
	} `json:"metadata"`
	Spec struct {
		LoadBalancerIP string        `json:"loadBalancerIP" yaml:"loadBalancerIP"`
		Ports          []ServicePort `json:"ports"`
		Selector       struct {
			App string `json:"app"`
		} `json:"selector"`
		SessionAffinity string `json:"sessionAffinity" yaml:"sessionAffinity"`
		Type            string `json:"type"`
	} `json:"spec"`
}

func NewService

func NewService(name string, IP string, port int) *Service

type ServicePort

type ServicePort struct {
	Protocol   string `json:"protocol"`
	Port       int    `json:"port"`
	TargetPort int    `json:"targetPort" yaml:"targetPort"`
}

Jump to

Keyboard shortcuts

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