sprvsr

package module
v0.0.0-...-89f4574 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

README

sprvsr

Common utility function for maintner and samplr to interact with the Kubernetes API and create Services and Deployments for the various resources they manage.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentBuilder

type DeploymentBuilder func(repos.TrackedRepository) (*appsv1.Deployment, error)

DeploymentBuilder builds a Deployment based on the given TrackedRepository

type DeploymentCheck

type DeploymentCheck func(repos.TrackedRepository) bool

DeploymentCheck is called to decide whether a deployment should be created for a given TrackedRepository.

type DeploymentNamer

type DeploymentNamer func(repos.TrackedRepository) (string, error)

DeploymentNamer is called to determine what to name a Deployment Given a TrackedRepository

type DeploymentPrep

type DeploymentPrep func(repos.TrackedRepository) error

DeploymentPrep is called before building a deployment. This can be used to provision additional resources before the Deployment is applied

type K8sConfiguration

type K8sConfiguration struct {
	ServiceNamer      ServiceNamer
	DeploymentNamer   DeploymentNamer
	ServiceBuilder    ServiceBuilder
	DeploymentBuilder DeploymentBuilder
	PreDeploy         DeploymentPrep
	ShouldDeploy      DeploymentCheck
}

K8sConfiguration is a struct to describe the set of operations a K8SSupervisor needs to manage a cluster

type ServiceBuilder

type ServiceBuilder func(repos.TrackedRepository) (*apiv1.Service, error)

ServiceBuilder buidls a Service based on the given TrackedRepository

type ServiceNamer

type ServiceNamer func(repos.TrackedRepository) (string, error)

ServiceNamer is called to determine what to name a Service Given a TrackedRepository

type Supervisor

type Supervisor interface {
	Supervise(string, func(error)) error
}

Supervisor exists to supervise a set of deployments

func NewK8sSupervisor

func NewK8sSupervisor(log *logrus.Logger, clientset kubernetes.Interface, kconfig K8sConfiguration,
	rl repos.RepoList,
	appid string) (Supervisor, error)

NewK8sSupervisor creates a new supervisor backed by Kubernetes

Jump to

Keyboard shortcuts

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