operator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package operator implements the capabilities used by CNPG

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectPluginSidecarPodSpec

func InjectPluginSidecarPodSpec(
	spec *corev1.PodSpec,
	sidecar *corev1.Container,
	mainContainerName string,
	injectMainContainerVolumes bool,
) error

InjectPluginSidecarPodSpec injects a plugin sidecar into a CNPG Pod spec.

If the "injectMainContainerVolumes" flag is true, this will append all the volume mounts that are used in the instance manager Pod to the passed sidecar container, granting it superuser access to the PostgreSQL instance.

func InjectPluginVolumePodSpec

func InjectPluginVolumePodSpec(spec *corev1.PodSpec, mainContainerName string)

InjectPluginVolumePodSpec injects the plugin volume into a CNPG Pod spec.

func Start

func Start(ctx context.Context) error

Start starts the manager

Types

type CNPGI

type CNPGI struct {
	Client         client.Client
	PluginPath     string
	ServerCertPath string
	ServerKeyPath  string
	ClientCertPath string
	ServerAddress  string
}

CNPGI is the implementation of the CNPG-i server

func (*CNPGI) Start

func (c *CNPGI) Start(ctx context.Context) error

Start starts the GRPC server of the operator plugin

type IdentityImplementation

type IdentityImplementation struct {
	identity.UnimplementedIdentityServer
}

IdentityImplementation is the implementation of the CNPG-i Identity entrypoint

func (IdentityImplementation) GetPluginCapabilities

GetPluginCapabilities implements identity

func (IdentityImplementation) GetPluginMetadata

GetPluginMetadata implements Identity

func (IdentityImplementation) Probe

Probe implements Identity

type LifecycleImplementation

type LifecycleImplementation struct {
	lifecycle.UnimplementedOperatorLifecycleServer
	Client client.Client
}

LifecycleImplementation is the implementation of the lifecycle handler

func (LifecycleImplementation) GetCapabilities

GetCapabilities exposes the lifecycle capabilities

func (LifecycleImplementation) LifecycleHook

LifecycleHook is called when creating Kubernetes services

type ReconcilerImplementation

type ReconcilerImplementation struct {
	Client client.Client
	reconciler.UnimplementedReconcilerHooksServer
}

ReconcilerImplementation implements the Reconciler capability

func (ReconcilerImplementation) GetCapabilities

GetCapabilities implements the Reconciler interface

func (ReconcilerImplementation) Post

Post implements the reconciler interface

func (ReconcilerImplementation) Pre

Pre implements the reconciler interface

Directories

Path Synopsis
Package config contains the functions to parse the plugin configuration
Package config contains the functions to parse the plugin configuration
Package specs contains the specification of the kubernetes objects that are created by the plugin
Package specs contains the specification of the kubernetes objects that are created by the plugin

Jump to

Keyboard shortcuts

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