kubernetes

package
v0.0.0-...-e7db92f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerStatus

type ContainerStatus struct {

	// The JointJS container ID
	ID string `json:"id"`

	// The current state of the container
	State string `json:"state"`

	// If the container has terminated, the reason is placed here
	Reason string `json:"reason"`
}

ContainerStatus : A struct holding the status of a container

type Kubernetes

type Kubernetes struct {

	// The kubernetes configuration file for connecting to the cluster
	KubeConfig *rest.Config

	// Kubernetes clientset for connections
	ClientSet *kubernetes.Clientset

	// tiyo config file
	Config *config.Config

	// The pipeline for the current build
	Pipeline *pipeline.Pipeline
}

Kubernetes : Construction struct for Kubernetes

func NewKubernetes

func NewKubernetes(config *config.Config, pipeline *pipeline.Pipeline) (*Kubernetes, error)

NewKubernetes : Create a new Kubernetes engine

func (*Kubernetes) CreateDaemonSet

func (kube *Kubernetes) CreateDaemonSet(pipeline string, container *pipeline.Container)

func (*Kubernetes) CreateDeployment

func (kube *Kubernetes) CreateDeployment(pipeline string, container *pipeline.Container)

func (*Kubernetes) CreateIngress

func (kube *Kubernetes) CreateIngress(ingressName string, instances []*pipeline.Command)

func (*Kubernetes) CreateNamespace

func (kube *Kubernetes) CreateNamespace(name string)

func (*Kubernetes) CreateService

func (kube *Kubernetes) CreateService(name string, instances []*pipeline.Command) string

func (*Kubernetes) CreateServiceAccount

func (kube *Kubernetes) CreateServiceAccount()

func (*Kubernetes) CreateStatefulSet

func (kube *Kubernetes) CreateStatefulSet(pipeline string, container *pipeline.Container)

CreateStatefulSet : Create a new statefulset

func (*Kubernetes) DaemonSetExists

func (kube *Kubernetes) DaemonSetExists(name string) bool

func (*Kubernetes) DeploymentExists

func (kube *Kubernetes) DeploymentExists(name string) bool

func (*Kubernetes) DestroyDaemonSet

func (kube *Kubernetes) DestroyDaemonSet(pipeline string, container *pipeline.Container)

func (*Kubernetes) DestroyDeployment

func (kube *Kubernetes) DestroyDeployment(pipeline string, container *pipeline.Container)

func (*Kubernetes) DestroyIngress

func (kube *Kubernetes) DestroyIngress(name string)

func (*Kubernetes) DestroyNamespace

func (kube *Kubernetes) DestroyNamespace(name string)

func (*Kubernetes) DestroyService

func (kube *Kubernetes) DestroyService(name string)

func (*Kubernetes) DestroyStatefulSet

func (kube *Kubernetes) DestroyStatefulSet(pipeline string, container *pipeline.Container)

DestroyStatefulSet : Destroys a given statefulset and all resources under it

func (*Kubernetes) GetContainerPorts

func (kube *Kubernetes) GetContainerPorts(instance *pipeline.Command) []corev1.ContainerPort

func (*Kubernetes) GetDaemonSet

func (kube *Kubernetes) GetDaemonSet(name string) *appsv1.DaemonSet

func (*Kubernetes) GetDeployment

func (kube *Kubernetes) GetDeployment(name string) *appsv1.Deployment

func (*Kubernetes) GetDeploymentContainers

func (kube *Kubernetes) GetDeploymentContainers(instances []*pipeline.Command) []corev1.Container

func (*Kubernetes) GetExternalNodeIPs

func (kube *Kubernetes) GetExternalNodeIPs() []string

GetExternalNodeIPs : Get the list of external IPs available to the cluster

func (*Kubernetes) GetNamespace

func (kube *Kubernetes) GetNamespace(name string) *corev1.Namespace

func (*Kubernetes) GetNodeResources

func (kube *Kubernetes) GetNodeResources(node *corev1.Node) *NodeMetrics

GetNodeResources : Get the resources available to a node

func (*Kubernetes) GetNodes

func (kube *Kubernetes) GetNodes() map[string]*NodeMetrics

GetNodes : Get all nodes in the kubernetes cluster as a map[string]*NodeMetrics

func (*Kubernetes) GetPod

func (kube *Kubernetes) GetPod(name string) *corev1.Pod

GetPod : Get a single pod by name

func (*Kubernetes) GetServicePorts

func (kube *Kubernetes) GetServicePorts(instances []*pipeline.Command) []corev1.ServicePort

func (*Kubernetes) GetStatefulSet

func (kube *Kubernetes) GetStatefulSet(name string) *appsv1.StatefulSet

GetStatefulSet : Retrieves a statefulset configuration from the cluster

func (*Kubernetes) GetStatefulSetContainers

func (kube *Kubernetes) GetStatefulSetContainers(instances []*pipeline.Command) []corev1.Container

GetStatefulSetContainers : Get all containers under a statefulset

func (*Kubernetes) GetVolumeMountForNamespace

func (kube *Kubernetes) GetVolumeMountForNamespace(namespace string) []corev1.VolumeMount

func (*Kubernetes) IngressExists

func (kube *Kubernetes) IngressExists(name string) bool

func (*Kubernetes) IngressRules

func (kube *Kubernetes) IngressRules(serviceName string, instances []*pipeline.Command) []networkv1.IngressRule

func (*Kubernetes) IsExistingResource

func (kube *Kubernetes) IsExistingResource(name string) bool

func (*Kubernetes) ListNamespaces

func (kube *Kubernetes) ListNamespaces() []string

func (*Kubernetes) PodExists

func (kube *Kubernetes) PodExists(name string) bool

PodExists : Check that a pod exists

func (*Kubernetes) PodStatus

func (kube *Kubernetes) PodStatus(name string) (map[string]PodsStatus, error)

PodStatus : Get the status of a pod and its containers

func (*Kubernetes) ServiceExists

func (kube *Kubernetes) ServiceExists(name string) bool

func (*Kubernetes) ServiceNodePorts

func (kube *Kubernetes) ServiceNodePorts(name string) *[]nginx.ServicePort

ServicePort : Address and port information for sending into NGINX

func (*Kubernetes) StatefulSetExists

func (kube *Kubernetes) StatefulSetExists(name string) bool

StatefulSetExists : Check that a statefulset of a given name exists

type NodeMetrics

type NodeMetrics struct {

	// the max cpu capacity of this node in millicpus
	CPUCapacity int64 `json:"cpucapacity"`

	// the number of requests on this node in millicpus
	CPURequests int64 `json:"cpurequests"`

	// the cpu limits on this node in millicpus
	CPULimits int64 `json:"cpulimits"`

	// the amount of memory available to this node in bytes
	MemoryCapacity int64 `json:"memorycapacity"`

	// the memory requests on this node in bytes
	MemoryRequests int64 `json:"memoryrequests"`

	// the memory limits on this node in bytes
	MemoryLimits int64 `json:"memorylimits"`
}

NodeMetrics : Information about nodes

type PodsStatus

type PodsStatus struct {

	// The status of the pod
	State string `json:"state"`

	// A list of containers held by the pod
	Containers map[string]ContainerStatus `json:"containers"`
}

PodsStatus : A struct holding the status of a pod

Jump to

Keyboard shortcuts

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