cluster

package
v0.0.0-...-3b5879d Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	kubernetes.Interface
	CRDClient rest.Interface
}

Cluster wraps low level kubernetes api requests to an object easier to interact with

func Client

func Client() (*Cluster, error)

Client returns default in-cluster kubernetes client

func (*Cluster) ApplyEnvironment

func (cluster *Cluster) ApplyEnvironment(currentEnvironment, newEnvironment *bitesize.Environment) error

ApplyEnvironment executes kubectl apply against ingresses, services, deployments etc.

func (*Cluster) ApplyIfChanged

func (cluster *Cluster) ApplyIfChanged(newConfig *bitesize.Environment) error

ApplyIfChanged compares bitesize Environment passed as an argument to the current client environment. If there are any changes, c is applied to the current config

func (*Cluster) ApplyService

func (cluster *Cluster) ApplyService(service *bitesize.Service, gists *bitesize.Gists, namespace string) error

ApplyService applies a single service to the namespace

func (*Cluster) LoadPods

func (cluster *Cluster) LoadPods(namespace string) ([]bitesize.Pod, error)

LoadPods returns Pod object loaded from Kubernetes API

func (*Cluster) ScrapeResourcesForNamespace

func (cluster *Cluster) ScrapeResourcesForNamespace(namespace string) (*bitesize.Environment, error)

ScrapeResourcesForNamespace returns BitesizeEnvironment object loaded from Kubernetes API

type GistMap

type GistMap map[string]*bitesize.Gist

GistMap holds a list of bitesize.Gist objects, representing the bitesize config gist path

func (GistMap) AddConfigMap

func (m GistMap) AddConfigMap(gist v1.ConfigMap) *bitesize.Gist

AddConfigMap adds imported ConfigMap resource to GistMap

func (GistMap) AddCronJob

func (m GistMap) AddCronJob(gist v1beta1.CronJob) *bitesize.Gist

AddCronJob adds imported v1beta1.CronJob Gist to GistMap

func (GistMap) AddJob

func (m GistMap) AddJob(gist v1batch.Job) *bitesize.Gist

AddJob adds imported v1batch.Job Gist to GistMap

func (GistMap) Gists

func (m GistMap) Gists() bitesize.Gists

Gists extracts a sorted list of bitesize.Gist type out from ImportMap type

type ServiceMap

type ServiceMap map[string]*bitesize.Service

ServiceMap holds a list of bitesize.Service objects, representing the whole environment. Actions on it allow to fill in respective bits of information, from kubernetes objects to bitesize objects

func (ServiceMap) AddCustomResourceDefinition

func (s ServiceMap) AddCustomResourceDefinition(crd k8_extensions.PrsnExternalResource)

AddCustomResourceDefinition adds Kubernetes CRD to biteservice

func (ServiceMap) AddDeployment

func (s ServiceMap) AddDeployment(deployment apps_v1.Deployment)

AddDeployment adds kubernetes deployment object to biteservice

func (ServiceMap) AddHPA

AddHPA adds Kubernetes HPA to biteservice

func (ServiceMap) AddIngress

func (s ServiceMap) AddIngress(ingress netwk_v1beta1.Ingress)

AddIngress adds Kubernetes ingress fields to biteservice

func (ServiceMap) AddService

func (s ServiceMap) AddService(svc v1.Service)

AddService adds Kubernetes service object to biteservice

func (ServiceMap) AddVolumeClaim

func (s ServiceMap) AddVolumeClaim(claim v1.PersistentVolumeClaim)

AddVolumeClaim adds Kubernetes PVC to biteservice

func (ServiceMap) CreateOrGet

func (s ServiceMap) CreateOrGet(name string) *bitesize.Service

CreateOrGet initializes new biteservice or returns an existing one (by name)

func (ServiceMap) Services

func (s ServiceMap) Services() bitesize.Services

Services extracts a sorted list of bitesize.Services type out from ServiceMap type

Jump to

Keyboard shortcuts

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