controller

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SatelliteNameReplacements = []kusttypes.ReplacementField{
	{Replacement: kusttypes.Replacement{
		Source: &kusttypes.SourceSelector{
			ResId: resid.NewResId(resid.NewGvk("", "v1", "Pod"), "satellite"),

			FieldPath: "spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.0.matchFields.0.values.0",
		},
		Targets: []*kusttypes.TargetSelector{
			{

				Select:     &kusttypes.Selector{ResId: resid.NewResId(resid.NewGvk("", "v1", "Pod"), "satellite")},
				FieldPaths: []string{"metadata.name"},
			},
			{

				Select:     &kusttypes.Selector{ResId: resid.NewResIdKindOnly("ConfigMap", "")},
				FieldPaths: []string{"metadata.name"},
				Options:    &kusttypes.FieldOptions{Delimiter: "-", Index: -1},
			},
			{

				Select:     &kusttypes.Selector{ResId: resid.NewResId(resid.NewGvk("cert-manager.io", "v1", "Certificate"), "tls")},
				FieldPaths: []string{"metadata.name"},
				Options:    &kusttypes.FieldOptions{Delimiter: "-", Index: -1},
			},
			{

				Select:     &kusttypes.Selector{ResId: resid.NewResId(resid.NewGvk("cert-manager.io", "v1", "Certificate"), "tls")},
				FieldPaths: []string{"spec.dnsNames.0"},
			},
		},
	}},
}

SatelliteNameReplacements are the kustomize replacements for renaming resources for a single satellite.

Functions

func CSINodeMatchesLINSTOR

func CSINodeMatchesLINSTOR(csiNodeDriver *storagev1.CSINodeDriver, linstorNode *lapi.Node) bool

func ClusterApiEndpointPatch

func ClusterApiEndpointPatch(url string) ([]kusttypes.Patch, error)

func ClusterApiTLSCertManagerPatch

func ClusterApiTLSCertManagerPatch(secretName string, issuer *cmmetav1.ObjectReference, dnsNames []string) ([]kusttypes.Patch, error)

func ClusterApiTLSClientCertManagerPatch

func ClusterApiTLSClientCertManagerPatch(certName, secretName string, issuer *cmmetav1.ObjectReference) ([]kusttypes.Patch, error)

func ClusterApiTLSPatch

func ClusterApiTLSPatch(apiSecretName, clientSecretName string) ([]kusttypes.Patch, error)

func ClusterCSIControllerApiTLSPatch added in v2.3.0

func ClusterCSIControllerApiTLSPatch(controllerSecret string) ([]kusttypes.Patch, error)

func ClusterCSIControllerNodeAffinityPatch added in v2.3.0

func ClusterCSIControllerNodeAffinityPatch(affinity *corev1.NodeSelector) ([]kusttypes.Patch, error)

func ClusterCSIControllerNodeSelector added in v2.3.0

func ClusterCSIControllerNodeSelector(selector map[string]string) ([]kusttypes.Patch, error)

func ClusterCSINodeApiTLSPatch added in v2.3.0

func ClusterCSINodeApiTLSPatch(nodeSecret string) ([]kusttypes.Patch, error)

func ClusterCSINodeNodeAffinityPatch added in v2.3.0

func ClusterCSINodeNodeAffinityPatch(affinity *corev1.NodeSelector) ([]kusttypes.Patch, error)

func ClusterCSINodeSelectorPatch

func ClusterCSINodeSelectorPatch(selector map[string]string) ([]kusttypes.Patch, error)

func ClusterHAControllerNodeAffinityPatch added in v2.3.0

func ClusterHAControllerNodeAffinityPatch(affinity *corev1.NodeSelector) ([]kusttypes.Patch, error)

func ClusterHAControllerNodeSelectorPatch

func ClusterHAControllerNodeSelectorPatch(selector map[string]string) ([]kusttypes.Patch, error)

func ClusterLinstorControllerNodeAffinityPatch added in v2.3.0

func ClusterLinstorControllerNodeAffinityPatch(affinity *corev1.NodeSelector) ([]kusttypes.Patch, error)

func ClusterLinstorControllerNodeSelector added in v2.3.0

func ClusterLinstorControllerNodeSelector(selector map[string]string) ([]kusttypes.Patch, error)

func ClusterLinstorInternalTLSCertManagerPatch

func ClusterLinstorInternalTLSCertManagerPatch(secretName string, issuer *cmmetav1.ObjectReference) ([]kusttypes.Patch, error)

func ClusterLinstorInternalTLSPatch

func ClusterLinstorInternalTLSPatch(secretName string) ([]kusttypes.Patch, error)

func ClusterLinstorPassphrasePatch

func ClusterLinstorPassphrasePatch(secretName string) ([]kusttypes.Patch, error)

func ClustersBySatellites

func ClustersBySatellites(satellites []piraeusiov1.LinstorSatellite) map[string]*ClusterView

ClustersBySatellites collects all LinstorSatellite resource that are part of the same cluster.

This should only ever return a map with a single entry, but it can support more.

func ComponentPodTemplate added in v2.3.0

func ComponentPodTemplate(kind, name string, template json.RawMessage) ([]kusttypes.Patch, error)

func DefaultRateLimiter

func DefaultRateLimiter() workqueue.RateLimiter

DefaultRateLimiter is a modified workqueue.DefaultControllerRateLimiter.

It reduced the maximum delay between reconcile attempts from 1000 seconds to 30 seconds.

func DesiredNodeConnections

func DesiredNodeConnections(conns []piraeusiov1.LinstorNodeConnection, satellites map[string]bool, nodeLabelMap map[string]map[string]string) map[string]lapi.Connection

func GetCSINodeDriverFromNode

func GetCSINodeDriverFromNode(csiNode *storagev1.CSINode) *storagev1.CSINodeDriver

func LinstorControllerUrl

func LinstorControllerUrl(cluster *piraeusiov1.LinstorCluster) string

func MergeNodeConnection

func MergeNodeConnection(props map[string]string, conn *piraeusiov1.LinstorNodeConnection, nodeA, nodeB string) map[string]string

func NodeConnectionApplies

func NodeConnectionApplies(selectors []piraeusiov1.SelectorTerm, nodeA, nodeB string, nodeLabelMap map[string]map[string]string) bool

func NodeLabelMap

func NodeLabelMap(nodes ...corev1.Node) map[string]map[string]string

func PodReady

func PodReady(pod *corev1.Pod) bool

func PullSecretPatch

func PullSecretPatch(secretName string) ([]kusttypes.Patch, error)

func SatelliteCommonNodePatch

func SatelliteCommonNodePatch(nodeName string) ([]kusttypes.Patch, error)

func SatelliteHostPathVolumeEnvPatch

func SatelliteHostPathVolumeEnvPatch(hostPaths []string) ([]kusttypes.Patch, error)

func SatelliteHostPathVolumePatch

func SatelliteHostPathVolumePatch(volumeName, hostPath string) ([]kusttypes.Patch, error)

func SatelliteLinstorHandshakeDaemonPatch added in v2.3.0

func SatelliteLinstorHandshakeDaemonPatch() ([]kusttypes.Patch, error)

func SatelliteLinstorInternalTLSCertManagerPatch

func SatelliteLinstorInternalTLSCertManagerPatch(secretName string, issuer *cmmetav1.ObjectReference) ([]kusttypes.Patch, error)

func SatelliteLinstorInternalTLSPatch

func SatelliteLinstorInternalTLSPatch(secretName string) ([]kusttypes.Patch, error)

func SatellitePrecompiledModulePatch

func SatellitePrecompiledModulePatch() ([]kusttypes.Patch, error)

Types

type ClusterView

type ClusterView struct {
	ClusterRef piraeusiov1.ClusterReference
	// Satellites maps the name of satellites to their ONLINE status.
	Satellites map[string]bool
}

type LinstorClusterReconciler

type LinstorClusterReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	Namespace          string
	PullSecret         string
	ImageConfigMapName string
	LinstorApiLimiter  *rate.Limiter
	Kustomizer         *resources.Kustomizer
}

LinstorClusterReconciler reconciles a LinstorCluster object

func (*LinstorClusterReconciler) Reconcile

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

func (*LinstorClusterReconciler) SetupWithManager

func (r *LinstorClusterReconciler) SetupWithManager(mgr ctrl.Manager, opts controller.Options) error

SetupWithManager sets up the controller with the Manager.

type LinstorNodeConnectionReconciler

type LinstorNodeConnectionReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	Namespace         string
	LinstorApiLimiter *rate.Limiter
}

LinstorNodeConnectionReconciler reconciles a LinstorNodeConnection object

func (*LinstorNodeConnectionReconciler) Reconcile

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

func (*LinstorNodeConnectionReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type LinstorSatelliteReconciler

type LinstorSatelliteReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	Namespace          string
	ImageConfigMapName string
	LinstorApiLimiter  *rate.Limiter
	Kustomizer         *resources.Kustomizer
	// contains filtered or unexported fields
}

LinstorSatelliteReconciler reconciles a LinstorSatellite object

func (*LinstorSatelliteReconciler) Reconcile

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

func (*LinstorSatelliteReconciler) SetupWithManager

func (r *LinstorSatelliteReconciler) SetupWithManager(mgr ctrl.Manager, opts controller.Options) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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