kube

package
v1.0.0-alpha.19 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteApp

func DeleteApp(c *kubernetes.Clientset, ns, app string, provider cloud.CloudProvider) error

func DeleteTLSCertificates

func DeleteTLSCertificates(c *kubernetes.Clientset, ns, app, domain string, provider cloud.CloudProvider) error

func GetAllPodNames

func GetAllPodNames(c *kubernetes.Clientset, ns, app string) ([]string, error)

func GetAllPods

func GetAllPods(c *kubernetes.Clientset, ns, app string) ([]v1.Pod, error)

func GetAllRunningPods

func GetAllRunningPods(c *kubernetes.Clientset, ns, app string) ([]v1.Pod, error)

Return the pods which seems to be up and running.

func GetServiceEndpoint

func GetServiceEndpoint(c *kubernetes.Clientset, ns, name string) (string, error)

func LogStreamReq

func LogStreamReq(c *kubernetes.Clientset, w io.Writer, ns, app string, opts pb.LogStreamOptions) error

func MergeCloudSQLManifest

func MergeCloudSQLManifest(spec *core_v1.PodSpec, app string, env map[string]string)

func ProcessLimits

func ProcessLimits(c *kubernetes.Clientset, ns, app, resource string, limits map[string]string) error

func ProcessList

func ProcessList(c *kubernetes.Clientset, ns, app string) ([]*pb.Process, error)

ProcessList will fetch the list of processes running based on deployments Labels TODO: fetch the status as well

func ProcessRun

func ProcessRun(
	c *kubernetes.Clientset,
	cfg *rest.Config,
	ns, name, image string,
	options pb.ProcessRunOptions,
	envVars map[string]string,
	sqlproxy bool,
	stream io.ReadWriter,
	provider cloud.CloudProvider,
) error

func PruneCloudSQLManifest

func PruneCloudSQLManifest(spec *core_v1.PodSpec)

func ScalePodReplicas

func ScalePodReplicas(c *kubernetes.Clientset, ns, app, proctype, image string, command []string,
	replicas int32, sqlproxy bool, cronExpr *string, envVars map[string]string, provider cloud.CloudProvider,
) error

ScalePodReplicas can scale up/down pods as per replicas count

func SetPodEnv

func SetPodEnv(c *kubernetes.Clientset, ns, app string, env map[string]string) error

func UpdateTLSCertificates

func UpdateTLSCertificates(c *kubernetes.Clientset, ns, app, domain, cert, key string, provider cloud.CloudProvider) (err error)

Types

type DefaultRemoteExecutor

type DefaultRemoteExecutor struct{}

DefaultRemoteExecutor is the standard implementation of remote command execution

func (*DefaultRemoteExecutor) Execute

func (*DefaultRemoteExecutor) Execute(method string, url *url.URL, config *rest.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error

type DeployRequest

type DeployRequest struct {
	Entrypoint    []string
	Args          []string
	ContainerPort intstr.IntOrString
	Namespace     string
	EnvVars       map[string]string
	Heartbeat     struct {
		Path                         string
		Port                         intstr.IntOrString
		InitialDelayLivenessSeconds  int
		InitialDelayReadinessSeconds int
		TimeoutSeconds               int32
	}

	Image     string
	Replicas  *int32
	ServiceID string
	Secrets   []struct {
		Name  string
		Value string
	}
	Domains  []string
	Tags     map[string]string
	App      string // to specify pods belonging to an App
	Version  string // to specify the version of pod to deploy
	Proctype string // to specify the type of process web, worker, or other

	// For GCP, we need to provision cloudsql-proxy as a sidecar container.
	EnableCloudSqlProxy bool

	CronExpr *string             // A cron schedule expression, if present we will create an object with `kind: CronJob“
	Provider cloud.CloudProvider // cloud provider aws, gcp or local
	// contains filtered or unexported fields
}

type DeployResponse

type DeployResponse struct {
	Request  DeployRequest
	NodePort int
}

type Deployer

type Deployer struct {
	Client *kubernetes.Clientset
}

func NewDeployer

func NewDeployer(c *kubernetes.Clientset) (*Deployer, error)

func (*Deployer) CreateOrUpdateCronJob

func (r *Deployer) CreateOrUpdateCronJob(cj *batch_v1beta1.CronJob, ns string) (*batch_v1beta1.CronJob, error)

func (*Deployer) CreateOrUpdateDeployment

func (r *Deployer) CreateOrUpdateDeployment(payload *DeployRequest) (*v1beta1.Deployment, error)

CreateOrUpdateDeployment creates or updates a service

func (*Deployer) CreateOrUpdateIngress

func (r *Deployer) CreateOrUpdateIngress(ingress *v1beta1.Ingress, env string, provider cloud.CloudProvider) (*v1beta1.Ingress, error)

CreateOrUpdateIngress creates or updates an ingress rule

func (*Deployer) CreateOrUpdateService

func (r *Deployer) CreateOrUpdateService(svc *v1.Service, env string) (*v1.Service, error)

CreateOrUpdateService creates or updates a service

func (*Deployer) Remove

func (d *Deployer) Remove(r *DeployRequest) error

func (*Deployer) Run

func (d *Deployer) Run(payload *DeployRequest) (*DeployResponse, error)

type ExecOptions

type ExecOptions struct {
	Namespace     string
	PodName       string
	ContainerName string
	Stdin         bool
	Command       []string

	In  io.Reader
	Out io.Writer
	Err io.Writer

	Executor RemoteExecutor
	Client   *kubernetes.Clientset
	Config   *rest.Config
}

ExecOptions declare the arguments accepted by the Exec command

func (*ExecOptions) Run

func (p *ExecOptions) Run() error

Run executes a validated remote execution against a pod.

type LimitRequest

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

type RemoteExecutor

type RemoteExecutor interface {
	Execute(method string, url *url.URL, config *rest.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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