system

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContainerImageConstraint is the instantiated semver contraints used for image verification
	ContainerImageConstraint, _ = semver.NewConstraint(options.ContainerImageConstraintSemver)

	// ReadmeReady is a template for system.status.readme
	ReadmeReady = template.Must(template.New("system_status_readme_ready").
				Parse(bundle.File_deploy_internal_text_system_status_readme_ready_tmpl))

	// ReadmeProgress is a template for system.status.readme
	ReadmeProgress = template.Must(template.New("system_status_readme_progress").
					Parse(bundle.File_deploy_internal_text_system_status_readme_progress_tmpl))

	// ReadmeRejected is a template for system.status.readme
	ReadmeRejected = template.Must(template.New("system_status_readme_rejected").
					Parse(bundle.File_deploy_internal_text_system_status_readme_rejected_tmpl))
)

Functions

func CheckWaitingFor added in v1.1.0

func CheckWaitingFor(sys *nbv1.NooBaa) error

CheckWaitingFor checks what the system deployment is waiting for in order to become ready in order to help the user troubleshoot common deployment issues.

func Cmd added in v1.1.0

func Cmd() *cobra.Command

Cmd returns a CLI command

func CmdCreate added in v1.1.0

func CmdCreate() *cobra.Command

CmdCreate returns a CLI command

func CmdDelete added in v1.1.0

func CmdDelete() *cobra.Command

CmdDelete returns a CLI command

func CmdList added in v1.1.0

func CmdList() *cobra.Command

CmdList returns a CLI command

func CmdReconcile added in v1.1.0

func CmdReconcile() *cobra.Command

CmdReconcile returns a CLI command

func CmdStatus added in v1.1.0

func CmdStatus() *cobra.Command

CmdStatus returns a CLI command

func CmdYaml added in v1.1.0

func CmdYaml() *cobra.Command

CmdYaml returns a CLI command

func GetNBClient added in v1.1.0

func GetNBClient() nb.Client

GetNBClient returns an api client

func LoadSystemDefaults added in v1.1.0

func LoadSystemDefaults() *nbv1.NooBaa

LoadSystemDefaults loads a noobaa system CR from bundled yamls and apply's changes from CLI flags to the defaults.

func RunCreate added in v1.1.0

func RunCreate(cmd *cobra.Command, args []string)

RunCreate runs a CLI command

func RunDelete added in v1.1.0

func RunDelete(cmd *cobra.Command, args []string)

RunDelete runs a CLI command

func RunList added in v1.1.0

func RunList(cmd *cobra.Command, args []string)

RunList runs a CLI command

func RunOperatorCreate added in v1.1.0

func RunOperatorCreate(cmd *cobra.Command, args []string)

RunOperatorCreate creates the default system when the operator starts.

func RunReconcile added in v1.1.0

func RunReconcile(cmd *cobra.Command, args []string)

RunReconcile runs a CLI command

func RunStatus added in v1.1.0

func RunStatus(cmd *cobra.Command, args []string)

RunStatus runs a CLI command

func RunYaml added in v1.1.0

func RunYaml(cmd *cobra.Command, args []string)

RunYaml runs a CLI command

func WaitReady added in v1.1.0

func WaitReady() bool

WaitReady waits until the system phase changes to ready by the operator

Types

type Client added in v1.1.0

type Client struct {
	NooBaa   *nbv1.NooBaa
	NBClient nb.Client
	S3Client *s3.S3
}

Client is the system client for making mgmt or s3 calls (with operator/admin credentials)

func Connect added in v1.1.0

func Connect() (*Client, error)

Connect loads the mgmt and S3 api details from the system. It gets the endpoint address and token from the system status and secret that the operator creates for the system.

type Reconciler added in v1.1.0

type Reconciler struct {
	Request  types.NamespacedName
	Client   client.Client
	Scheme   *runtime.Scheme
	Ctx      context.Context
	Logger   *logrus.Entry
	Recorder record.EventRecorder
	NBClient nb.Client

	NooBaa              *nbv1.NooBaa
	CoreApp             *appsv1.StatefulSet
	ServiceMgmt         *corev1.Service
	ServiceS3           *corev1.Service
	SecretServer        *corev1.Secret
	SecretOp            *corev1.Secret
	SecretAdmin         *corev1.Secret
	CloudCreds          *cloudcredsv1.CredentialsRequest
	DefaultBackingStore *nbv1.BackingStore
	DefaultBucketClass  *nbv1.BucketClass
	StorageClass        *storagev1.StorageClass
	PrometheusRule      *monitoringv1.PrometheusRule
	ServiceMonitor      *monitoringv1.ServiceMonitor
}

Reconciler is the context for loading or reconciling a noobaa system

func NewReconciler added in v1.1.0

func NewReconciler(
	req types.NamespacedName,
	client client.Client,
	scheme *runtime.Scheme,
	recorder record.EventRecorder,
) *Reconciler

NewReconciler initializes a reconciler to be used for loading or reconciling a noobaa system

func (*Reconciler) CheckAll added in v1.1.0

func (r *Reconciler) CheckAll()

CheckAll checks the state of all the objects controlled by the system

func (*Reconciler) CheckServiceStatus added in v1.1.0

func (r *Reconciler) CheckServiceStatus(srv *corev1.Service, status *nbv1.ServiceStatus, portName string)

CheckServiceStatus populates the status of a service by detecting all of its addresses

func (*Reconciler) CheckSystemCR added in v1.1.0

func (r *Reconciler) CheckSystemCR() error

CheckSystemCR checks the validity of the system CR (i.e system.metadata.name and system.spec.image) and updates the status accordingly

func (*Reconciler) Own added in v1.1.0

func (r *Reconciler) Own(obj metav1.Object)

Own sets the object owner references to the noobaa system

func (*Reconciler) Reconcile added in v1.1.0

func (r *Reconciler) Reconcile() (reconcile.Result, error)

Reconcile reads that state of the cluster for a System object, and makes changes based on the state read and what is in the System.Spec. The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

func (*Reconciler) ReconcileCredentialsRequest added in v1.2.0

func (r *Reconciler) ReconcileCredentialsRequest() error

ReconcileCredentialsRequest creates a CredentialsRequest resource if neccesary and returns the bucket name allowed for the credentials. nil is returned if cloud credentials are not supported

func (*Reconciler) ReconcileDefaultBackingStore added in v1.2.0

func (r *Reconciler) ReconcileDefaultBackingStore() error

ReconcileDefaultBackingStore attempts to get credentials to cloud storage using the cloud-credentials operator and use it for the default backing store

func (*Reconciler) ReconcileDefaultBucketClass added in v1.2.0

func (r *Reconciler) ReconcileDefaultBucketClass() error

ReconcileDefaultBucketClass creates the default bucket class

func (*Reconciler) ReconcileObject added in v1.1.0

func (r *Reconciler) ReconcileObject(obj runtime.Object, desiredFunc func()) error

ReconcileObject is a generic call to reconcile a kubernetes object desiredFunc can be passed to modify the object before create/update. Currently we ignore enforcing a desired state, but it might be needed on upgrades.

func (*Reconciler) ReconcilePhaseConfiguring added in v1.1.0

func (r *Reconciler) ReconcilePhaseConfiguring() error

ReconcilePhaseConfiguring runs the reconcile phase

func (*Reconciler) ReconcilePhaseConnecting added in v1.1.0

func (r *Reconciler) ReconcilePhaseConnecting() error

ReconcilePhaseConnecting runs the reconcile phase

func (*Reconciler) ReconcilePhaseCreating added in v1.1.0

func (r *Reconciler) ReconcilePhaseCreating() error

ReconcilePhaseCreating runs the reconcile phase

func (*Reconciler) ReconcilePhaseVerifying added in v1.1.0

func (r *Reconciler) ReconcilePhaseVerifying() error

ReconcilePhaseVerifying runs the reconcile verify phase

func (*Reconciler) ReconcilePhases added in v1.1.0

func (r *Reconciler) ReconcilePhases() error

ReconcilePhases runs the reconcile flow and populates System.Status.

func (*Reconciler) ReconcileSecretAdmin added in v1.1.0

func (r *Reconciler) ReconcileSecretAdmin() error

ReconcileSecretAdmin creates the admin secret

func (*Reconciler) ReconcileSecretOp added in v1.1.0

func (r *Reconciler) ReconcileSecretOp() error

ReconcileSecretOp creates a new system in the noobaa server if not created yet.

func (*Reconciler) ReconcileStorageClass added in v1.2.0

func (r *Reconciler) ReconcileStorageClass() error

ReconcileStorageClass reconciles default storage class for the system

func (*Reconciler) SetDesiredCoreApp added in v1.1.0

func (r *Reconciler) SetDesiredCoreApp()

SetDesiredCoreApp updates the CoreApp as desired for reconciling

func (*Reconciler) SetDesiredServiceMgmt added in v1.1.0

func (r *Reconciler) SetDesiredServiceMgmt()

SetDesiredServiceMgmt updates the ServiceMgmt as desired for reconciling

func (*Reconciler) SetDesiredServiceS3 added in v1.1.0

func (r *Reconciler) SetDesiredServiceS3()

SetDesiredServiceS3 updates the ServiceS3 as desired for reconciling

func (*Reconciler) SetPhase added in v1.1.0

func (r *Reconciler) SetPhase(phase nbv1.SystemPhase, reason string, message string)

SetPhase updates the status phase and conditions

func (*Reconciler) SetReadme added in v1.1.0

func (r *Reconciler) SetReadme(t *template.Template)

SetReadme runs the template and sets the readme

func (*Reconciler) UpdateStatus added in v1.1.0

func (r *Reconciler) UpdateStatus()

UpdateStatus updates the system status in kubernetes from the memory

Jump to

Keyboard shortcuts

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