kubernetes

package
v0.0.0-...-fd92c9c Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() (client *kubernetes.Clientset)

Client returns the clientset used to access the Kubernetes cluster that is being used to run our pods within the CI/CD pipeline

func IsMinikube

func IsMinikube(ctx context.Context) (isMinikube bool, err kv.Error)

IsMinikube will test the operating environment of the present process to determine if it is running within a minikube provisioned cluster

func RestConfig

func RestConfig() (client *rest.Config)

RestConfig returns the rest configuration used to access the Kubernetes cluster Pods that are being created

func TasksRunner

func TasksRunner(ctx context.Context, debugMode bool, triggerC chan *TaskSpec, statusC chan *Status)

TasksRunner will listen for changes to a git repository and trigger downstream tasks that will process and consume the change

func TasksStart

func TasksStart(ctx context.Context, debugMode bool, triggerC chan *TaskSpec, statusC chan *Status)

TasksStart is used to initate a git change notification processing go routine

func TrimNamespace

func TrimNamespace(ns string) (trimmed string)

TrimNamespace can be used to trim strings that consist of words with dash '-' separators and a semver style format consisting of trailing branch names potentially and a unique ID on the very end to 64 characters, of significant information. Examples of names might include 0.9.23-feature-265-zero-length-metadata-reinstated-aaaagmwypak

Types

type MicroK8s

type MicroK8s struct{}

MicroK8s is used to encapsulate receivers for working with microk8s clusters

func (*MicroK8s) GetRegistryPod

func (*MicroK8s) GetRegistryPod(ctx context.Context) (pod *apiv1.Pod, err kv.Error)

GetRegistryPod is used to obtain pod information for the microk8s provisioned image registry.

type Status

type Status struct {
	ID    string
	Level int
	Msg   kv.Error
}

type Task

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

Task encapsulates the entire context of a Kubernetes batch job/pod, including the persistent volume that is being used to transport the state related to the pipeline actions being undertaken, for example a git cloned repository.

type TaskSpec

type TaskSpec struct {
	Namespace    string // The Kubernetes namespace being used for running the CI bootstrapping
	ID           string
	Dir          string
	Dockerfile   string
	Env          map[string]string
	JobSpec      *batchv1.Job
	SecretSpecs  []*v1.Secret
	ServiceSpecs []*v1.Service
}

TaskSpec encapsulates the information used when initating the bootstrapping pods and jobs involved in generation of images etc

Jump to

Keyboard shortcuts

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