controller

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	metav1.Object

	// GetKind returns the actual Kind of the Kubernetes Resource
	GetKind() string

	// GetPodTemplateSpec retuns the inner PodTemplateSpec
	GetPodTemplateSpec() *v1.PodTemplateSpec

	// StatusOK indicated, if the Kubernetes Resource is properly running,
	// e.g. if a Deployment has a proper Number of Pods.
	StatusOK() bool

	// Update updates the app with the the new set values
	Update(context.Context, *kubernetes.Clientset) error
}

App is an interface generalize the access to Deployments, StatefulSets and DaemonSets

type Controller

type Controller struct {
	Logger    *zap.Logger
	Cfg       *config.Config
	Clientset *kubernetes.Clientset
	Server    *server.Server
	// contains filtered or unexported fields
}

Controller is responsible for the reconcilation

func (*Controller) Run

func (c *Controller) Run(ctx context.Context)

func (*Controller) Stop

func (c *Controller) Stop()

type DaemonSet

type DaemonSet appv1.DaemonSet

DaemonSet fulfilling the App Interface

func (*DaemonSet) GetKind

func (*DaemonSet) GetKind() string

func (*DaemonSet) GetPodTemplateSpec

func (d *DaemonSet) GetPodTemplateSpec() *v1.PodTemplateSpec

func (*DaemonSet) StatusOK

func (d *DaemonSet) StatusOK() bool

func (*DaemonSet) Update

func (d *DaemonSet) Update(ctx context.Context, clientset *kubernetes.Clientset) error

type Deployment

type Deployment appv1.Deployment

Deployment fulfilling the App Interface

func (*Deployment) GetKind

func (*Deployment) GetKind() string

func (*Deployment) GetPodTemplateSpec

func (d *Deployment) GetPodTemplateSpec() *v1.PodTemplateSpec

func (*Deployment) StatusOK

func (d *Deployment) StatusOK() bool

func (*Deployment) Update

func (d *Deployment) Update(ctx context.Context, clientset *kubernetes.Clientset) error

type StatefulSet

type StatefulSet appv1.StatefulSet

StatefulSet fulfilling the App Interface

func (*StatefulSet) GetKind

func (*StatefulSet) GetKind() string

func (*StatefulSet) GetPodTemplateSpec

func (s *StatefulSet) GetPodTemplateSpec() *v1.PodTemplateSpec

func (*StatefulSet) StatusOK

func (s *StatefulSet) StatusOK() bool

func (*StatefulSet) Update

func (s *StatefulSet) Update(ctx context.Context, clientset *kubernetes.Clientset) error

Jump to

Keyboard shortcuts

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