Documentation ¶
Index ¶
- Variables
- func Hash(o interface{}) string
- func ServiceExcludes(fn GeneratorFunction) []string
- type ControlledResources
- type Deployment
- type ExtendedObjectList
- type GeneratorFunction
- type GrafanaDashboard
- type HorizontalPodAutoscaler
- type LockedResource
- type PodDisruptionBudget
- type PodMonitor
- type Reconciler
- func (r *Reconciler) DeploymentWithRolloutTriggers(deployment GeneratorFunction, triggers []RolloutTrigger, replicas *int32) GeneratorFunction
- func (r *Reconciler) GetDeploymentReplicas(ctx context.Context, d Deployment) (*int32, error)
- func (r *Reconciler) GetInstance(ctx context.Context, key types.NamespacedName, instance client.Object, ...) (*ctrl.Result, error)
- func (r *Reconciler) IsInitialized(instance client.Object, finalizer string) bool
- func (r *Reconciler) ManageCleanUpLogic(instance client.Object, log logr.Logger) error
- func (r *Reconciler) NewLockedResources(list []LockedResource, owner client.Object) ([]lockedresource.LockedResource, error)
- func (r *Reconciler) ReconcileOwnedResources(ctx context.Context, owner client.Object, crs ControlledResources) error
- func (r *Reconciler) SecretEventHandler(ol ExtendedObjectList, logger logr.Logger) handler.EventHandler
- func (r *Reconciler) StatefulSetWithRolloutTriggers(statefulset GeneratorFunction, triggers []RolloutTrigger) GeneratorFunction
- func (r *Reconciler) TriggersFromSecretDefs(ctx context.Context, sd ...GeneratorFunction) ([]RolloutTrigger, error)
- type RolloutTrigger
- type SecretDefinition
- type Service
- type StatefulSet
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultExcludedPaths is a list of jsonpaths paths to ignore during reconciliation DefaultExcludedPaths []string = []string{ "/metadata/creationTimestamp", "/metadata/deletionGracePeriodSeconds", "/metadata/deletionTimestamp", "/metadata/finalizers", "/metadata/generateName", "/metadata/generation", "/metadata/managedFields", "/metadata/ownerReferences", "/metadata/resourceVersion", "/metadata/selfLink", "/metadata/uid", "/status", } // DeploymentExcludedPaths is a list fo path to ignore for Deployment resources DeploymentExcludedPaths []string = []string{ "/metadata", "/status", "/spec/progressDeadlineSeconds", "/spec/revisionHistoryLimit", "/spec/template/metadata/creationTimestamp", "/spec/template/spec/dnsPolicy", "/spec/template/spec/restartPolicy", "/spec/template/spec/schedulerName", "/spec/template/spec/securityContext", "/spec/template/spec/terminationGracePeriodSeconds", } )
Functions ¶
func ServiceExcludes ¶
func ServiceExcludes(fn GeneratorFunction) []string
ServiceExcludes generates the list of excluded paths for a Service resource
Types ¶
type ControlledResources ¶
type ControlledResources struct { Deployments []Deployment StatefulSets []StatefulSet SecretDefinitions []SecretDefinition Services []Service PodDisruptionBudgets []PodDisruptionBudget HorizontalPodAutoscalers []HorizontalPodAutoscaler PodMonitors []PodMonitor GrafanaDashboards []GrafanaDashboard }
ControlledResources defines the resources that each of the Custom Resources own
type Deployment ¶
type Deployment struct { Template GeneratorFunction RolloutTriggers []RolloutTrigger HasHPA bool }
Deployment specifies a Deployment resource and its rollout triggers
type ExtendedObjectList ¶
ExtendedObjectList is an extension of client.ObjectList with methods to manipulate generically the objects in the list
type GeneratorFunction ¶
GeneratorFunction is a function that returns a client.Object
type GrafanaDashboard ¶
type GrafanaDashboard struct { Template GeneratorFunction Enabled bool }
GrafanaDashboard specifies a GrafanaDashboard resource
type HorizontalPodAutoscaler ¶
type HorizontalPodAutoscaler struct { Template GeneratorFunction Enabled bool }
HorizontalPodAutoscaler specifies a HorizontalPodAutoscaler resource
type LockedResource ¶
type LockedResource struct { GeneratorFn GeneratorFunction ExcludePaths []string }
LockedResource is a struct that instructs the reconciler how to generate and reconcile a resource
type PodDisruptionBudget ¶
type PodDisruptionBudget struct { Template GeneratorFunction Enabled bool }
PodDisruptionBudget specifies a PodDisruptionBudget resource
type PodMonitor ¶
type PodMonitor struct { Template GeneratorFunction Enabled bool }
PodMonitor specifies a PodMonitor resource
type Reconciler ¶
type Reconciler struct {
lockedresourcecontroller.EnforcingReconciler
}
Reconciler computes a list of resources that it needs to keep in place
func NewFromManager ¶
func NewFromManager(mgr manager.Manager, recorder record.EventRecorder, clusterWatchers bool) Reconciler
NewFromManager constructs a new Reconciler from the given manager
func (*Reconciler) DeploymentWithRolloutTriggers ¶
func (r *Reconciler) DeploymentWithRolloutTriggers(deployment GeneratorFunction, triggers []RolloutTrigger, replicas *int32) GeneratorFunction
DeploymentWithRolloutTriggers returns the Deployment modified with the appropriate rollout triggers (annotations)
func (*Reconciler) GetDeploymentReplicas ¶ added in v0.9.11
func (r *Reconciler) GetDeploymentReplicas(ctx context.Context, d Deployment) (*int32, error)
GetDeploymentReplicas returns the number of replicas for a deployment, current value if HPA is enabled.
func (*Reconciler) GetInstance ¶
func (r *Reconciler) GetInstance(ctx context.Context, key types.NamespacedName, instance client.Object, finalizer string, log logr.Logger) (*ctrl.Result, error)
GetInstance tries to retrieve the custom resource instance and perform some standard tasks like initizalization and cleanup when required.
func (*Reconciler) IsInitialized ¶
func (r *Reconciler) IsInitialized(instance client.Object, finalizer string) bool
IsInitialized can be used to check if instance is correctly initialized. Returns false if it isn't.
func (*Reconciler) ManageCleanUpLogic ¶
ManageCleanUpLogic contains finalization logic for the LockedResourcesReconciler
func (*Reconciler) NewLockedResources ¶
func (r *Reconciler) NewLockedResources(list []LockedResource, owner client.Object) ([]lockedresource.LockedResource, error)
NewLockedResources returns the list of lockedresource.LockedResource that the reconciler needs to enforce
func (*Reconciler) ReconcileOwnedResources ¶
func (r *Reconciler) ReconcileOwnedResources(ctx context.Context, owner client.Object, crs ControlledResources) error
ReconcileOwnedResources handles generalized resource reconcile logic for all controllers
func (*Reconciler) SecretEventHandler ¶
func (r *Reconciler) SecretEventHandler(ol ExtendedObjectList, logger logr.Logger) handler.EventHandler
SecretEventHandler returns an EventHandler for the specific ExtendedObjectList list object passed as parameter
func (*Reconciler) StatefulSetWithRolloutTriggers ¶
func (r *Reconciler) StatefulSetWithRolloutTriggers(statefulset GeneratorFunction, triggers []RolloutTrigger) GeneratorFunction
StatefulSetWithRolloutTriggers returns the StatefulSet modified with the appropriate rollout triggers (annotations)
func (*Reconciler) TriggersFromSecretDefs ¶
func (r *Reconciler) TriggersFromSecretDefs(ctx context.Context, sd ...GeneratorFunction) ([]RolloutTrigger, error)
TriggersFromSecretDefs generates a list of RolloutTrigger from the given SecretDefinition generator functions
type RolloutTrigger ¶
type RolloutTrigger struct {
// contains filtered or unexported fields
}
RolloutTrigger defines a configuration source that should trigger a rollout whenever the data within that configuration source changes
func NewRolloutTrigger ¶
func NewRolloutTrigger(name string, o client.Object) RolloutTrigger
NewRolloutTrigger returns a new RolloutTrigger from a Secret or ConfigMap It panics if the passed client.Object is not a Secret or ConfigMap
func (*RolloutTrigger) GetAnnotationKey ¶
func (rt *RolloutTrigger) GetAnnotationKey() string
GetAnnotationKey returns the annotation key to be used in the Pods that read from the config source defined in the RolloutTrigger
func (*RolloutTrigger) GetHash ¶
func (rt *RolloutTrigger) GetHash() string
GetHash returns the hash of the data container in the RolloutTrigger config source
type SecretDefinition ¶
type SecretDefinition struct { Template GeneratorFunction Enabled bool }
SecretDefinition specifies a SecretDefinition resource
type Service ¶
type Service struct { Template GeneratorFunction Enabled bool }
Service specifies a Service resource
type StatefulSet ¶
type StatefulSet struct { Template GeneratorFunction RolloutTriggers []RolloutTrigger Enabled bool }
StatefulSet specifies a StatefulSet resource and its rollout triggers
Directories ¶
Path | Synopsis |
---|---|
api/v1alpha1
Package v1alpha1 is a test API definition +kubebuilder:object:generate=true +groupName=example.com
|
Package v1alpha1 is a test API definition +kubebuilder:object:generate=true +groupName=example.com |