controllers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const CesServiceAnnotation = "k8s-dogu-operator.cloudogu.com/ces-services"

CesServiceAnnotation can be appended to services with information of ces services.

View Source
const (
	IngressRewriteTargetAnnotation = "nginx.ingress.kubernetes.io/rewrite-target"
)

Variables

This section is empty.

Functions

func NewSslCertificateUpdater added in v0.3.0

func NewSslCertificateUpdater(client client.Client, namespace string) (*sslCertificateUpdater, error)

NewSslCertificateUpdater creates a new updater.

Types

type CesService

type CesService struct {
	// Name of the ces service serving as identifier.
	Name string `json:"name"`
	// Port of the ces service.
	Port int `json:"port"`
	// Location of the ces service defining the external path to the service.
	Location string `json:"location"`
	// Pass of the ces service defining the target path inside the service's pod.
	Pass string `json:"pass"`
}

CesService contains information about one exposed ces service.

type IngressClassCreator

type IngressClassCreator struct {
	Client    client.Client `json:"client"`
	ClassName string        `json:"class_name"`
}

IngressClassCreator is responsible to create a cluster wide ingress class in the cluster.

func NewIngressClassCreator

func NewIngressClassCreator(client client.Client, className string) IngressClassCreator

NewIngressClassCreator creates a new ingress class creator.

func (IngressClassCreator) CreateIngressClass

func (icc IngressClassCreator) CreateIngressClass(logger logr.Logger) error

CreateIngressClass check whether the ingress class for the generator exists. If not it will be created.

func (IngressClassCreator) Start

type IngressGenerator

type IngressGenerator struct {
	// Client used to communicate with k8s.
	Client client.Client `json:"client"`
	// Namespace defines the target namespace for the ingress objects.
	Namespace string `json:"namespace"`
	// IngressClassName defines the ingress class for the ces services.
	IngressClassName string `json:"ingress_class_name"`
}

IngressGenerator generates ingress objects based on ces service information.

func NewIngressGenerator

func NewIngressGenerator(client client.Client, namespace string, ingressClassName string) IngressGenerator

NewIngressGenerator create a new ingress generator.

func (IngressGenerator) CreateCesServiceIngress

func (g IngressGenerator) CreateCesServiceIngress(ctx context.Context, cesService CesService, service *corev1.Service) error

CreateCesServiceIngress creates a new ingress resource based on the given ces service

type ServiceReconciler

type ServiceReconciler struct {
	client.Client    `json:"client_._client"`
	Scheme           *runtime.Scheme  `json:"scheme"`
	IngressGenerator IngressGenerator `json:"ingress_creator"`
}

ServiceReconciler reconciles a Service object.

func (*ServiceReconciler) Reconcile

func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

The ServiceReconciler is responsible to generate ingress objects for respective services containing the ces service discovery annotation.

func (*ServiceReconciler) SetupWithManager

func (r *ServiceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type WarpMenuCreator added in v0.2.0

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

WarpMenuCreator used to create warp menu

func NewWarpMenuCreator added in v0.2.0

func NewWarpMenuCreator(client client.Client, registry registry.Registry, namespace string) WarpMenuCreator

NewWarpMenuCreator initialises a creator object to start the warp menu creation

func (WarpMenuCreator) CreateWarpMenu added in v0.2.0

func (wmc WarpMenuCreator) CreateWarpMenu(ctx context.Context) error

CreateWarpMenu reads the warp configuration and starts watchers to refresh the menu.json configmap in background.

func (WarpMenuCreator) Start added in v0.2.0

func (wmc WarpMenuCreator) Start(ctx context.Context) error

Start starts the runnable.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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