Documentation ¶
Index ¶
- Constants
- Variables
- func JobFromClusterVersionMapper(c client.Reader, cvName string) handler.MapFunc
- type Clock
- type ClusterVersionCollector
- type ClusterVersionReconciler
- type NodeReconciler
- type UpgradeConfigReconciler
- type UpgradeInformationCollector
- type UpgradeJobReconciler
- type UpgradeSuspensionWindowReconciler
Constants ¶
const ( // https://github.com/openshift/machine-config-operator/blob/b36482885ba1304e122e7c01c26cd671dfdd0418/pkg/daemon/constants/constants.go#L17 // https://github.com/openshift/machine-config-operator/blob/b36482885ba1304e122e7c01c26cd671dfdd0418/pkg/daemon/drain.go#L79 // DesiredDrainerAnnotationKey is set by OCP to indicate drain/uncordon requests DesiredDrainerAnnotationKey = "machineconfiguration.openshift.io/desiredDrain" // LastAppliedDrainerAnnotationKey is by OCP to indicate the last request applied LastAppliedDrainerAnnotationKey = "machineconfiguration.openshift.io/lastAppliedDrain" )
const ( EventReasonUpgradeConfigSuspended = "UpgradeConfigSuspended" EventReasonUpgradeConfigSuspendedBySuspensionWindow = "UpgradeConfigSuspendedBySuspensionWindow" )
const MetricsNamespace = "openshift_upgrade_controller"
const (
UpgradeJobHookJobTrackerFinalizer = "upgradejobs.managedupgrade.appuio.io/hook-job-tracker"
)
Variables ¶
var ClusterVersionLockAnnotation = managedupgradev1beta1.GroupVersion.Group + "/upgrade-job"
Functions ¶
Types ¶
type ClusterVersionCollector ¶ added in v0.7.0
type ClusterVersionCollector struct { Client client.Client ManagedClusterVersionName string ManagedClusterVersionNamespace string }
ClusterVersionCollector is a Prometheus collector that collects cluster info metrics.
func (*ClusterVersionCollector) Collect ¶ added in v0.7.0
func (m *ClusterVersionCollector) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector. Collects metrics from the cluster version object and sends them to the channel.
func (*ClusterVersionCollector) Describe ¶ added in v0.7.0
func (*ClusterVersionCollector) Describe(d chan<- *prometheus.Desc)
Describe implements prometheus.Collector. Sends the descriptors of the metrics to the channel.
type ClusterVersionReconciler ¶
type ClusterVersionReconciler struct { client.Client Scheme *runtime.Scheme Clock ManagedUpstreamClusterVersionName string ManagedClusterVersionName string ManagedClusterVersionNamespace string }
ClusterVersionReconciler reconciles a ClusterVersion object
func (*ClusterVersionReconciler) Filter ¶
func (r *ClusterVersionReconciler) Filter(obj client.Object) bool
Filter filters the ClusterVersion objects to only reconcile the managed ClusterVersion object. Returns true if the object is managed by this controller.
func (*ClusterVersionReconciler) Reconcile ¶
func (r *ClusterVersionReconciler) Reconcile(ctx context.Context, _ ctrl.Request) (ctrl.Result, error)
Reconcile compares the ClusterVersion object with the upstream ClusterVersion object and updates the upstream ClusterVersion object if necessary.
func (*ClusterVersionReconciler) SetupWithManager ¶
func (r *ClusterVersionReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager. The controller is setup to watch the managed ClusterVersion object and the upstream ClusterVersion object.
type NodeReconciler ¶
NodeReconciler reconciles a Node object
func (*NodeReconciler) Reconcile ¶
Reconcile reacts to Node changes and updates the node draining metric.
func (*NodeReconciler) SetupWithManager ¶
func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type UpgradeConfigReconciler ¶
type UpgradeConfigReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder Clock Clock ManagedUpstreamClusterVersionName string }
UpgradeConfigReconciler reconciles a UpgradeConfig object
func (*UpgradeConfigReconciler) Reconcile ¶
func (r *UpgradeConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile implements the reconcile loop for UpgradeConfig. It schedules UpgradeJobs based on the UpgradeConfig's schedule - if an update is available.
func (*UpgradeConfigReconciler) SetupWithManager ¶
func (r *UpgradeConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type UpgradeInformationCollector ¶ added in v0.7.0
UpgradeInformationCollector is a Prometheus collector that exposes various metrics about the upgrade process.
func (*UpgradeInformationCollector) Collect ¶ added in v0.7.0
func (m *UpgradeInformationCollector) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector. Sends a metric if the cluster is currently upgrading and an upgrading metric for each machine config pool. It also collects job states and whether they have matching disruptive hooks.
func (*UpgradeInformationCollector) Describe ¶ added in v0.7.0
func (*UpgradeInformationCollector) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector. Sends the static description of the metrics to the provided channel.
type UpgradeJobReconciler ¶
type UpgradeJobReconciler struct { client.Client Scheme *runtime.Scheme Clock Clock ManagedUpstreamClusterVersionName string }
UpgradeJobReconciler reconciles a UpgradeJob object
func (*UpgradeJobReconciler) Reconcile ¶
func (r *UpgradeJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile reconciles a UpgradeJob object and starts the upgrade if necessary.
func (*UpgradeJobReconciler) SetupWithManager ¶
func (r *UpgradeJobReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type UpgradeSuspensionWindowReconciler ¶ added in v0.9.0
UpgradeSuspensionWindowReconciler reconciles a UpgradeSuspensionWindow object
func (*UpgradeSuspensionWindowReconciler) Reconcile ¶ added in v0.9.0
func (r *UpgradeSuspensionWindowReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile implements the reconcile loop for UpgradeSuspensionWindow. It writes the list of matching UpgradeConfigs and UpgradeJobs to the status.
func (*UpgradeSuspensionWindowReconciler) SetupWithManager ¶ added in v0.9.0
func (r *UpgradeSuspensionWindowReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.