system

package
v2.0.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 43 Imported by: 1

Documentation

Index

Constants

View Source
const CertificateDirectory = "/etc/ssl/certs"
View Source
const ControllerName = "system-controller"
View Source
const DefaultAvailableControllerNodeMonitorInterval = 60 * time.Second

DefaultAvailableControllerNodeMonitorInterval represents the default interval between polling attempts to check whether all controller nodes have reached the unlocked/enabled/available state. The DRDB file systems have to be fully synchronized before the degraded state is cleared therefore there is no need to poll this frequently.

View Source
const DefaultFileSystemResizeMonitorInterval = 15 * time.Second

DefaultPartitionMonitorInterval represents the default interval between polling attempts to check file system states.

View Source
const NoContent = "NC"

NoContent represents an empty command separated list to certain endpoints of the system API (i.e., DNS and NTP)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new SystemNamespace Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func FillOptionalMergedSystemSpec

func FillOptionalMergedSystemSpec(spec *starlingxv1.SystemSpec) (*starlingxv1.SystemSpec, error)

After MergeSystemSpecs fill out any missing optional value

func InstallCertificate

func InstallCertificate(filename string, data []byte) error

func MergeSystemSpecs

func MergeSystemSpecs(a, b *starlingxv1.SystemSpec) (*starlingxv1.SystemSpec, error)

MergeSystemSpecs invokes the mergo.Merge API with our desired modifiers.

func NewAvailableControllerNodeMonitor added in v1.0.0

func NewAvailableControllerNodeMonitor(instance *v1.System, required int) *manager.Monitor

NewAvailableControllerNodeMonitor defines a convenience function to instantiate a new available controller monitor with all required attributes.

func NewFileSystemResizeMonitor added in v1.0.0

func NewFileSystemResizeMonitor(instance *v1.System) *manager.Monitor

NewPartitionStateMonitor defines a convenience function to instantiate a new partition monitor with all required attributes.

Types

type ReconcileSystem

type ReconcileSystem struct {
	manager.Manager
	client.Client

	cloudManager.CloudManager
	common.ReconcilerErrorHandler
	common.ReconcilerEventLogger
	// contains filtered or unexported fields
}

ReconcileSystem reconciles a SystemNamespace object

func (*ReconcileSystem) BuildSystemDefaults

func (r *ReconcileSystem) BuildSystemDefaults(instance *starlingxv1.System, system v1info.SystemInfo) (*starlingxv1.SystemSpec, error)

BuildSystemDefaults takes the current set of system attributes and builds a fake system object that can be used as a reference for the current settings applied to the system. The default settings are saved on the system status.

func (*ReconcileSystem) ControllerNodesAvailable added in v1.0.0

func (r *ReconcileSystem) ControllerNodesAvailable(required int) bool

ControllerNodesAvailable counts the number of nodes that are unlocked, enabled, and available.

func (*ReconcileSystem) FileSystemResizeAllowed added in v1.0.0

func (r *ReconcileSystem) FileSystemResizeAllowed(instance *starlingxv1.System, info *v1info.SystemInfo, fs controllerFilesystems.FileSystem) (ready bool, err error)

FileSystemResizeAllowed defines whether a particular file system can be resized.

func (*ReconcileSystem) GetCertificateSignatures

func (r *ReconcileSystem) GetCertificateSignatures(instance *starlingxv1.System) error

func (*ReconcileSystem) GetSystemDefaults

func (r *ReconcileSystem) GetSystemDefaults(instance *starlingxv1.System) (*starlingxv1.SystemSpec, error)

GetHostDefaults retrieves the default attributes for a host. The set of default attributes are collected from the host before any user configurations are applied.

func (*ReconcileSystem) HTTPSRequiredForCertificates

func (r *ReconcileSystem) HTTPSRequiredForCertificates() bool

HTTPSRequired determines whether an HTTPS connection is required for the purpose of installing system certificates.

func (*ReconcileSystem) PrivateKeyTranmissionAllowed

func (r *ReconcileSystem) PrivateKeyTranmissionAllowed(client *gophercloud.ServiceClient, info *v1info.SystemInfo) error

func (*ReconcileSystem) Reconcile

func (r *ReconcileSystem) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a SystemNamespace object and makes changes based on the state read and what is in the SystemNamespace.Spec +kubebuilder:rbac:groups="",resources=events,verbs=create;patch +kubebuilder:rbac:groups=starlingx.windriver.com,resources=systems,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=starlingx.windriver.com,resources=systems/status,verbs=get;update;patch

func (*ReconcileSystem) ReconcileCertificates

func (r *ReconcileSystem) ReconcileCertificates(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileCertificates configures the system certificates to align with the desired list of certificates.

func (*ReconcileSystem) ReconcileDNS

func (r *ReconcileSystem) ReconcileDNS(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileDNS configures the system resources to align with the desired DNS configuration.

func (*ReconcileSystem) ReconcileDRBD

func (r *ReconcileSystem) ReconcileDRBD(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileDRBD configures the system resources to align with the desired DRBD configuration.

func (*ReconcileSystem) ReconcileFileSystems added in v1.0.0

func (r *ReconcileSystem) ReconcileFileSystems(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) (err error)

ReconcileFilesystems configures the system resources to align with the desired controller filesystem configuration.

func (*ReconcileSystem) ReconcileLicense added in v1.0.0

func (r *ReconcileSystem) ReconcileLicense(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileLicense configures the system license to align with the desired license file.

func (*ReconcileSystem) ReconcileNTP

func (r *ReconcileSystem) ReconcileNTP(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileNTP configures the system resources to align with the desired NTP state.

func (*ReconcileSystem) ReconcilePTP

func (r *ReconcileSystem) ReconcilePTP(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcilePTP configures the system resources to align with the desired PTP state.

func (*ReconcileSystem) ReconcileRequired added in v1.0.0

func (r *ReconcileSystem) ReconcileRequired(instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) (err error, required bool)

ReconcileRequired determines whether reconciliation is allowed/required on the System resource. Reconciliation is required if there is a difference between the configured Spec and the current system state. Reconciliation is only allowed if the resource has not already been successfully reconciled at least once; or the user has overridden this check by adding an annotation on the resource.

func (*ReconcileSystem) ReconcileResource

func (r *ReconcileSystem) ReconcileResource(client *gophercloud.ServiceClient, instance *starlingxv1.System) (err error)

ReconcileResource interacts with the system API in order to reconcile the state of a data network with the state stored in the k8s database.

func (*ReconcileSystem) ReconcileServiceParameters

func (r *ReconcileSystem) ReconcileServiceParameters(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileServiceParameters configures the system resources to align with the desired ServiceParameter state.

func (*ReconcileSystem) ReconcileStorageBackends

func (r *ReconcileSystem) ReconcileStorageBackends(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileStorageBackend configures the storage Backend to align with the desired Ceph State Only supports creating storage backends

func (*ReconcileSystem) ReconcileSystem

func (r *ReconcileSystem) ReconcileSystem(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) (ready bool, err error)

ReconcileSystem is the main top level reconciler for System resources.

func (*ReconcileSystem) ReconcileSystemAttributes

func (r *ReconcileSystem) ReconcileSystemAttributes(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileSystemAttributes configures the system resources to align with the desired state.

func (*ReconcileSystem) ReconcileSystemFinal added in v1.0.0

func (r *ReconcileSystem) ReconcileSystemFinal(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileSystemFinal is responsible for completing the configuration of the system entity by running all steps that can be completed in parallel with other resource types. That is, once we know that the controllers are already enabled so that we can provision the file systems.

func (*ReconcileSystem) ReconcileSystemInitial added in v1.0.0

func (r *ReconcileSystem) ReconcileSystemInitial(client *gophercloud.ServiceClient, instance *starlingxv1.System, spec *starlingxv1.SystemSpec, info *v1info.SystemInfo) error

ReconcileSystemInitial is responsible for reconciling the system attributes that do not depend on any other resource types (i.e., hosts). Its purpose is to get the system into a state in which other resources can be configured.

func (*ReconcileSystem) StopAfterInSync added in v1.0.0

func (r *ReconcileSystem) StopAfterInSync() bool

StopAfterInSync determines whether the reconciler should continue processing change requests after the configuration has been reconciled a first time.

Jump to

Keyboard shortcuts

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