setup

package
v0.2.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateImagePullSecret

func CreateImagePullSecret(ctx context.Context, c client.Client, namespace, secretName, server, username, password string) (string, bool, error)

CreateImagePullSecret creates a dockerconfigjson Secret for the given registry. server is the registry hostname (e.g. "nvcr.io", "ghcr.io"). username is the registry username (e.g. "$oauthtoken" for NGC, "token" for GHCR). password is the registry password or API key. secretName is the name to give the created Secret. Returns (secretName, wasCreated, error) where wasCreated is true only when a new Secret was created — false means an existing Secret was updated. Callers must only delete the secret on rollback when wasCreated is true.

func EnsureNamespace

func EnsureNamespace(ctx context.Context, c client.Client, name string, out io.Writer) (bool, error)

EnsureNamespace creates a namespace if it doesn't exist. Returns true if the namespace was created by this call (false if it already existed).

func NewCommand

func NewCommand(version string) *cobra.Command

NewCommand returns the "setup" cobra command. version is the running binary version and is threaded through to init/upgrade operations.

func RunInit

func RunInit(
	version string,
	image, imagePullSecret, skipPhases string, autoApprove bool,
	configFlags *kubeconfig.ConfigFlags, versionOverride string,
	in io.Reader, out io.Writer,
) error

runInit executes the init phases sequentially.

func RunReset

func RunReset(
	skipPhases string, autoApprove bool,
	configFlags *kubeconfig.ConfigFlags,
	in io.Reader, out io.Writer,
) error

runReset executes the reset phases in reverse order.

func WaitForNamespaceDeletion

func WaitForNamespaceDeletion(ctx context.Context, c client.Client, name string, out io.Writer)

waitForNamespaceDeletion polls until a namespace is fully removed.

func WorkloadPullSecretName

func WorkloadPullSecretName(resourceName string) string

WorkloadPullSecretName returns the name of the workload image pull secret for a given Certification or WorkloadRun. Deriving from the resource name prevents concurrent runs in the same namespace from fighting over a single fixed name.

Types

type HelmReleaseStatus

type HelmReleaseStatus struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	// State is the release state helm reports ("deployed", "failed",
	// "pending-upgrade", ...), "not installed" when helm has no record of
	// the release, or "unknown" when the query could not be completed.
	State string `json:"state"`
}

HelmReleaseStatus reports the Helm state of one managed release.

type SetupStatus

type SetupStatus struct {
	// Installed is true when all required components are present and ready
	// and no managed Helm release is in a failed or pending state.
	Installed  bool                  `json:"installed"`
	Components SetupStatusComponents `json:"components"`
	// KubeflowTrainerVersion reports the detected Kubeflow Trainer version
	// against the version this build supports. Nil when the TrainJob CRD is
	// not installed.
	KubeflowTrainerVersion *TrainerVersionStatus `json:"kubeflowTrainerVersion,omitempty"`
	// HelmReleases reports the state of the Helm releases setup init manages.
	HelmReleases []HelmReleaseStatus `json:"helmReleases"`
	// contains filtered or unexported fields
}

SetupStatus is the JSON output structure for nvcrectl setup status.

type SetupStatusComponents

type SetupStatusComponents struct {
	NVCRECRDs       bool `json:"nvcreCRDs"`
	NVCREController bool `json:"nvcreController"`
	KubeflowTrainer bool `json:"kubeflowTrainer"`
	LogProfiles     bool `json:"logProfiles"`
	GPUOperator     bool `json:"gpuOperator"`
	// DCGM is optional. Only the diagnostics/dcgm-level4 category needs it,
	// so it does not count toward Installed.
	DCGM bool `json:"dcgm"`
}

SetupStatusComponents reports the status of each individual component.

type TrainerVersionStatus

type TrainerVersionStatus struct {
	// Supported is the Trainer version this NVCRE build supports.
	Supported string `json:"supported"`
	// Detected is the installed Trainer version, empty when it could not be
	// determined.
	Detected string `json:"detected,omitempty"`
	// Source names where Detected came from: "helm release", "deployment
	// image", or "crd label".
	Source string `json:"source,omitempty"`
}

TrainerVersionStatus reports the installed Kubeflow Trainer version against the version this NVCRE build is pinned to.

Jump to

Keyboard shortcuts

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