Documentation
¶
Overview ¶
Package deployer is the v4 install path: load a CLI config, translate to operator chart values + four platform CRs, install the operator chart via Helm SDK, server-side-apply the CRs in dependency order, and wait for each to be Ready=True.
Index ¶
Constants ¶
const ( // OperatorNamespace is where the educates-installer helm release // lives. Matches the chart's recommended deploy namespace and the // samples in installer/samples/. OperatorNamespace = "educates-installer" // OperatorReleaseName is the helm release name. OperatorReleaseName = "educates-installer" // DefaultTimeout caps the wait on each CR's Ready=True condition. DefaultTimeout = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, opts DeleteOptions) error
Delete executes the uninstall pipeline:
- Delete SessionManager → wait gone.
- Delete LookupService → wait gone.
- Delete SecretsManager → wait gone.
- Delete EducatesClusterConfig → wait gone (its finalizer drains kyverno → external-dns → contour → cert-manager → CustomCA copy in reverse install order).
- helm uninstall the operator chart.
Idempotent: a CR that's already gone is a no-op step. Useful for re-running after a half-finished delete or for cleaning up state the last deploy never created.
Deliberately NOT deleted (user state across reinstalls):
- CRDs (helm never owns them; would cascade-delete any CR in the cluster, including ones from other Educates installs).
- The operator namespace itself.
- educates-secrets namespace + the synced CA Secret (so the next deploy reuses the same CA the user already trusts in their browser).
func Deploy ¶
Deploy executes the install pipeline against the cluster reachable via opts.Getter:
- Helm install/upgrade the operator chart in the operator namespace.
- Apply EducatesClusterConfig → wait Ready.
- Verify the educates-custom-ca prerequisite Secret (unless skipped).
- Apply SecretsManager → wait Ready.
- Apply LookupService (if present) → wait Ready.
- Apply SessionManager → wait Ready.
Returns the last LookupService/SessionManager objects observed so the caller can print URLs from .status.
Types ¶
type DeleteOptions ¶
type DeleteOptions struct {
Getter genericclioptions.RESTClientGetter
Out io.Writer
HelmLog io.Writer
Timeout time.Duration
Progress progress.Reporter
// Purge, when true, extends the delete pipeline AFTER helm
// uninstall to remove the four CRDs, the operator namespace, and
// the 'educates-secrets' namespace. Local <data-home>/config.yaml
// + cached CA Secrets are intentionally preserved — they're user
// authoring inputs and survive cluster reinstalls.
Purge bool
}
DeleteOptions configures a delete run. Mirrors Options but the inputs differ: we don't need translator output here since the resources are always the same four CRs at metadata.name=cluster + the helm release.
type Options ¶
type Options struct {
// Getter is the kubectl-style RESTClientGetter — typically a
// configured genericclioptions.ConfigFlags from cobra.
Getter genericclioptions.RESTClientGetter
// Out is where progress lines are written. Pass cmd.OutOrStdout()
// from cobra; pass io.Discard from tests.
Out io.Writer
// HelmLog receives helm SDK debug output. io.Discard by default.
HelmLog io.Writer
// Timeout overrides DefaultTimeout per CR wait.
Timeout time.Duration
// SkipPrereqCheck bypasses the educates-custom-ca Secret existence
// check. Set when the caller has already verified, or for advanced
// users who manage the Secret asynchronously.
SkipPrereqCheck bool
// SkipCRDApply bypasses the operator CRD apply step. The default
// is to push CRDs from the embedded chart before helm-install so a
// CRD shape change reaches the cluster on re-deploy (helm itself
// only installs CRDs on first install, never on upgrade). Set true
// when the user manages CRDs out of band (GitOps, separate
// kubectl apply, etc.).
SkipCRDApply bool
// SyncLocalSecrets, when true, copies <data-home>/secrets/*.yaml into
// the cluster's 'educates-secrets' namespace before applying the
// platform CRs. Matches the v3 laptop flow: cached CA/TLS material
// is pushed at deploy time, ECC's caCertificateRef points there.
// Only meaningful for EducatesLocalConfig deploys.
SyncLocalSecrets bool
// Progress is the structured progress reporter. When nil, plain
// io.Discard-backed reporter is used (no progress output, but the
// helpers still call into it so the call-site code is uniform).
// Cmd code typically passes progress.NewForStdout(...) to render
// to the user's terminal with TTY-aware overwriting.
Progress progress.Reporter
}
Options configures a deploy run.
type PlatformComponentStatus ¶
type PlatformComponentStatus struct {
Kind string // e.g. "EducatesClusterConfig"
Optional bool // absent is acceptable (only LookupService)
Present bool // the CR (and its CRD) exists in the cluster
Ready bool // status.conditions[type=Ready].status == "True"
Phase string // status.phase, for extra detail when not Ready
}
PlatformComponentStatus is the observed status of one Educates platform CR.
func PlatformStatus ¶
PlatformStatus reads the status of the Educates platform CRs from the cluster. A CR whose CRD or "cluster" instance is absent is reported with Present=false — that is how a cluster-only install (no Educates) is detected. A connectivity error (unreachable API) is returned as an error.
type PurgeTargets ¶
PurgeTargets is the inventory --purge will delete in addition to the standard delete pipeline. Exported so the cmd-layer confirmation prompt can render it for the user before they accept.
func PurgePlan ¶
func PurgePlan() PurgeTargets
PurgePlan returns the list of cluster resources Purge would remove after helm uninstall. Stable order so the confirmation prompt is reproducible.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apply server-side-applies arbitrary unstructured Kubernetes objects from the CLI.
|
Package apply server-side-applies arbitrary unstructured Kubernetes objects from the CLI. |
|
Package chart embeds the educates-installer Helm chart into the CLI binary.
|
Package chart embeds the educates-installer Helm chart into the CLI binary. |
|
Package crds applies the four platform CRDs from the embedded operator chart to the cluster before helm-install.
|
Package crds applies the four platform CRDs from the embedded operator chart to the cluster before helm-install. |
|
Package helm wraps the helm SDK with the small surface the CLI needs to install or upgrade the educates-installer chart in-process.
|
Package helm wraps the helm SDK with the small surface the CLI needs to install or upgrade the educates-installer chart in-process. |
|
Package prereq checks deploy prerequisites that must be satisfied before the four platform CRs can reconcile.
|
Package prereq checks deploy prerequisites that must be satisfied before the four platform CRs can reconcile. |
|
Package progress renders deploy/delete step status as compact per-step lines instead of free-form prints.
|
Package progress renders deploy/delete step status as compact per-step lines instead of free-form prints. |
|
Package wait polls a Kubernetes resource until its Ready=True condition flips, or a timeout fires.
|
Package wait polls a Kubernetes resource until its Ready=True condition flips, or a timeout fires. |