kubernetes

package
v0.0.0-...-0637115 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	REDIS_IMAGE_TAG      = "redis"
	REDIS_CONTAINER_PORT = 6379
)
View Source
var ErrDeployJobCreate = errors.Errorf("Job has failed to create")
View Source
var ErrDeployJobStarting = errors.Errorf("Job has failed to start")
View Source
var ErrDeployJobUpdate = errors.Errorf("Faild to create job")
View Source
var ErrDeployListingJobs = errors.Errorf("Failed to get list of jobs")
View Source
var ErrDeployListingPods = errors.Errorf("Failed to get list of pods")
View Source
var ErrDeployListingReplicaSets = errors.Errorf("Failed to get list of replica-sets")
View Source
var ErrDeployNoSecrets = errors.Errorf("There were no secrets provided for deploying")

Deployment errors

View Source
var ErrDeployOneShotActive = errors.Errorf("Canceled deployment because one-shot service is still active. Redeploy your release once the currently running deployment process completes.")
View Source
var ErrDeployPodRestartLoop = errors.Errorf("Deployment had too many restarts")
View Source
var ErrDeployPodWaitingForever = errors.Errorf("Pod is waiting forever")
View Source
var ErrDeployPodWaitingForeverUnwindingDeploy = errors.Errorf("Pod is waiting forever - Unwinding Deploy")
View Source
var ErrDeployPodWaitingForeverUnwindingDeployFirstDeploy = errors.Errorf("Pod is waiting forever - Unwinding Deploy First Deploy")
View Source
var ErrDeploySecretCreate = errors.Errorf("There was an error creating the secret")
View Source
var ErrDeployServiceCreate = errors.Errorf("Failed to create service")
View Source
var ErrDeployServiceTypeNotSupported = errors.Errorf("This service type is not supported. Try again with either 'one-shot' or 'general' as the service type.")
View Source
var ErrDeployServiceUpdate = errors.Errorf("Failed to update service")
View Source
var ErrDeploySetupEnvironmentNoSecrets = errors.Errorf("There were no secrets provided for setting up environment")
View Source
var ErrDeployTimeout = errors.Errorf("Error, timeout reached waiting for all deployments to succeed.")
View Source
var ErrKubernetesClientSetup = errors.Errorf("You must set the environment variable CF_PLUGINS_KUBEDEPLOY_KUBECONFIG=/path/to/kubeconfig")

Services Errors

View Source
var ErrKubernetesNewForConfig = errors.Errorf("Could not create config for Kubernetes")
View Source
var ErrServiceCreateFailed = errors.Errorf("Failed to create service")
View Source
var ErrServiceDNSTimeout = errors.Errorf("Timeout waiting for ELB DNS name")
View Source
var ErrServiceDeleteFailed = errors.Errorf("Failed to delete service")
View Source
var ErrServiceDeleteNotFound = errors.Errorf("Failed to find service when deleting")
View Source
var ErrServiceUnexpectedError = errors.Errorf("There was an unexpected error involving services")
View Source
var ErrServiceUpdateFailed = errors.Errorf("Failed to update service")

Functions

This section is empty.

Types

type BatchV1Job

type BatchV1Job struct{}

func (BatchV1Job) Create

func (l BatchV1Job) Create(clientset kubernetes.Interface, namespace string, job *v1.Job) (*v1.Job, error)

func (BatchV1Job) Get

func (l BatchV1Job) Get(clientset kubernetes.Interface, namespace string, jobName string, getOptions meta_v1.GetOptions) (*v1.Job, error)

type BatchV1Jobber

type BatchV1Jobber interface {
	Create(kubernetes.Interface, string, *v1.Job) (*v1.Job, error)
	Get(kubernetes.Interface, string, string, meta_v1.GetOptions) (*v1.Job, error)
}

type ContourNamespace

type ContourNamespace struct{}

func (ContourNamespace) NewForConfig

func (l ContourNamespace) NewForConfig(config *rest.Config) (contour_client.Interface, error)

type CoreDeployment

type CoreDeployment struct{}

func (CoreDeployment) Create

func (l CoreDeployment) Create(clientset kubernetes.Interface, namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)

func (CoreDeployment) Delete

func (l CoreDeployment) Delete(clientset kubernetes.Interface, namespace string, deploymentName string, deleteOptions *meta_v1.DeleteOptions) error

type CoreDeploymenter

type CoreDeploymenter interface {
	Create(kubernetes.Interface, string, *appsv1.Deployment) (*appsv1.Deployment, error)
}

type CoreSecret

type CoreSecret struct{}

func (CoreSecret) Create

func (l CoreSecret) Create(clientset kubernetes.Interface, namespace string, secretParams *corev1.Secret) (*corev1.Secret, error)

type CoreSecreter

type CoreSecreter interface {
	Create(kubernetes.Interface, string, *corev1.Secret) (*corev1.Secret, error)
}

type CoreService

type CoreService struct{}

func (CoreService) Create

func (l CoreService) Create(clientset kubernetes.Interface, namespace string, service *corev1.Service) (*corev1.Service, error)

func (CoreService) Delete

func (l CoreService) Delete(clientset kubernetes.Interface, namespace string, serviceName string, deleteOptions *meta_v1.DeleteOptions) error

func (CoreService) Get

func (l CoreService) Get(clientset kubernetes.Interface, namespace string, serviceName string, getOptions meta_v1.GetOptions) (*corev1.Service, error)

func (CoreService) Update

func (l CoreService) Update(clientset kubernetes.Interface, namespace string, service *corev1.Service) (*corev1.Service, error)

type DeploymentConfiguration

type DeploymentConfiguration struct {
	Replicas        int32
	PodTemplateSpec v1.PodTemplateSpec
	Annotations     map[string]string
	Labels          map[string]string
}

type Domain

type Domain struct {
	Apex      string
	Subdomain string
	FQDN      string
}

type IngressController

type IngressController struct {
	ControllerName string
	ControllerID   string
	ELB            string
}

type IngressInput

type IngressInput struct {
	Type                 string
	KubeConfig           string
	ClientCertificate    string
	ClientKey            string
	CertificateAuthority string
	Controller           IngressController
	Service              Service
	ControlledApexDomain string
	UpstreamFQDNs        []Domain
}

type IngressRouteInput

type IngressRouteInput struct {
	Type                 string
	KubeConfig           string
	ClientCertificate    string
	ClientKey            string
	CertificateAuthority string
	Controller           IngressController
	Service              Service
	EnableWebsockets     bool
	ControlledApexDomain string
	UpstreamDomains      []Domain
}

type K8sContourNamespacer

type K8sContourNamespacer interface {
	NewForConfig(*rest.Config) (contour_client.Interface, error)
}

type K8sNamespacer

type K8sNamespacer interface {
	NewForConfig(*rest.Config) (kubernetes.Interface, error)
}

/////////////////////////////////////////////////

type KongIngressController

type KongIngressController struct {
	ControllerName string `json:"name"`
	ControllerID   string `json:"id"`
	ELB            string `json:"elb"`
	API            string `json:"api"`
}

type KongIngressInput

type KongIngressInput struct {
	Type                 string
	KubeConfig           string
	ClientCertificate    string
	ClientKey            string
	CertificateAuthority string
	Controller           KongIngressController
	Service              Service
	ControlledApexDomain string
	UpstreamRoutes       []UpstreamRoute
}

type Kubernetes

type Kubernetes struct {
	K8sNamespacer
	K8sContourNamespacer
	BatchV1Jobber
	CoreServicer
	CoreSecreter
	CoreDeploymenter

	KubernetesConfig
	// contains filtered or unexported fields
}

Kubernetes

func (*Kubernetes) CreateNamespaceIfNotExists

func (x *Kubernetes) CreateNamespaceIfNotExists(namespace string, coreInterface corev1.CoreV1Interface) error

func (*Kubernetes) Description

func (x *Kubernetes) Description() string

func (*Kubernetes) GenDeploymentName

func (x *Kubernetes) GenDeploymentName(slugName string, serviceName string) string

func (*Kubernetes) GenNamespaceName

func (x *Kubernetes) GenNamespaceName(suggestedEnvironment string, projectSlug string) string

func (*Kubernetes) GenOneShotServiceName

func (x *Kubernetes) GenOneShotServiceName(slugName string, serviceName string) string

func (*Kubernetes) GetTempDir

func (x *Kubernetes) GetTempDir() (string, error)

func (*Kubernetes) Process

func (x *Kubernetes) Process(e transistor.Event) error

func (*Kubernetes) ProcessDeployment

func (x *Kubernetes) ProcessDeployment(e transistor.Event)

func (*Kubernetes) ProcessIngress

func (x *Kubernetes) ProcessIngress(e transistor.Event)

ProcessIngress Processes Kubernetes Ingress Events

func (*Kubernetes) ProcessIngressRoute

func (x *Kubernetes) ProcessIngressRoute(e transistor.Event)

ProcessIngress Processes Kubernetes Ingress Events

func (*Kubernetes) ProcessKongIngress

func (x *Kubernetes) ProcessKongIngress(e transistor.Event)

func (*Kubernetes) ProcessLoadBalancer

func (x *Kubernetes) ProcessLoadBalancer(e transistor.Event)

func (*Kubernetes) ProcessRedis

func (x *Kubernetes) ProcessRedis(e transistor.Event)

func (*Kubernetes) SampleConfig

func (x *Kubernetes) SampleConfig() string

func (*Kubernetes) SetupClientset

func (x *Kubernetes) SetupClientset(e transistor.Event) (kubernetes.Interface, error)

Builds a Kube ClientSet. Depends on setupKubeConfig to build the config file for interacting with K8s

func (*Kubernetes) Start

func (x *Kubernetes) Start(e chan transistor.Event) error

func (*Kubernetes) Stop

func (x *Kubernetes) Stop()

func (*Kubernetes) Subscribe

func (x *Kubernetes) Subscribe() []string

type KubernetesConfig

type KubernetesConfig struct {
	Hash string

	ContourClient    contour_client.Interface
	KubernetesClient kubernetes.Interface
}

type KubernetesNamespace

type KubernetesNamespace struct {
}

func (KubernetesNamespace) NewForConfig

func (l KubernetesNamespace) NewForConfig(config *rest.Config) (kubernetes.Interface, error)

type ListenerPair

type ListenerPair struct {
	Name       string
	Protocol   string
	SourcePort int32
	TargetPort int32
}

Load Balancer

type ProbeDefaults

type ProbeDefaults struct {
	InitialDelaySeconds int32
	PeriodSeconds       int32
	SuccessThreshold    int32
	FailureThreshold    int32
	TimeoutSeconds      int32
}

ProbeDefaults

type Service

type Service struct {
	ID   string
	Name string
	Port ListenerPair
}

func ParseService

func ParseService(e transistor.Event) (Service, error)

Service should be in the format servicename:port

type SimplePodSpec

type SimplePodSpec struct {
	Name           string
	DeployPorts    []v1.ContainerPort
	ReadinessProbe v1.Probe
	LivenessProbe  v1.Probe
	PreStopHook    v1.Handler
	RestartPolicy  v1.RestartPolicy
	NodeSelector   map[string]string
	Args           []string
	Service        plugins.Service
	Image          string
	Env            []v1.EnvVar
	VolumeMounts   []v1.VolumeMount
	Volumes        []v1.Volume
	Tolerations    []v1.Toleration
}

Deployments

type UpstreamRoute

type UpstreamRoute struct {
	Domain  Domain
	Methods []string
	Paths   []string
}

Jump to

Keyboard shortcuts

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