Documentation
¶
Overview ¶
Package devinstall installs one disposable, explicitly non-production provider. Its KubeVirt substrate is an operator-selected prerequisite, never an owned production cluster or a substitute for the production site profile.
Index ¶
- Constants
- Variables
- func BootstrapGuest(ctx context.Context, input io.Reader, output io.Writer) error
- func Fingerprint(profile Profile) string
- func RunCLI(ctx context.Context, args []string, input io.Reader, ...) int
- func Validate(profile Profile, mode string) error
- type APIError
- type BOM
- type Check
- type Client
- type Credentials
- type Download
- type Engine
- func (engine *Engine) Connect(ctx context.Context) error
- func (engine *Engine) Create(ctx context.Context) (Report, error)
- func (engine *Engine) Destroy(ctx context.Context) (Report, error)
- func (engine *Engine) Diagnose(ctx context.Context) (Report, error)
- func (engine *Engine) Reset(ctx context.Context) (Report, error)
- func (engine *Engine) Status(ctx context.Context) (Report, error)
- type Guest
- type ImagePin
- type Network
- type Object
- type OwnedObject
- type OwnedVolume
- type Plan
- type Prerequisites
- type Profile
- type ProviderObservation
- type Report
- type State
- type StateStore
- type Target
Constants ¶
const ( APIVersion = "cloudring.org/v1alpha1" Kind = "CloudRINGDevelopmentInstallation" Development = "development" OwnerLabel = "cloudring.org/development-installation" OwnerAnnotation = "cloudring.org/development-owner" ProfileAnnotation = "cloudring.org/development-profile-sha256" )
Variables ¶
var ( ErrInvalidProfile = errors.New("development installation profile is invalid") ErrProduction = errors.New("development installation cannot select a production profile") ErrConflict = errors.New("development installation ownership conflicts with observed state") ErrNotFound = errors.New("development installation is absent") )
var ErrCredentials = errors.New("development substrate credentials are invalid; require one explicit inline context")
Functions ¶
func BootstrapGuest ¶
BootstrapGuest is an internal subcommand. It only operates as root inside the exact disposable Linux guest whose firmware and cloud-init identity match the caller's durable ownership journal. No host fallback exists.
func Fingerprint ¶
Types ¶
type APIError ¶
type APIError struct{ StatusCode int }
APIError exposes only a status code. API bodies can include Secret contents or broad cluster information and are never returned as diagnostic strings.
type BOM ¶
type BOM struct {
SourceCommit string `json:"sourceCommit"`
Installer Download `json:"installer"`
GuestImage string `json:"guestImage"`
RuntimeImage string `json:"runtimeImage"`
PostgreSQLImage string `json:"postgresqlImage"`
Kubeadm Download `json:"kubeadm"`
Kubelet Download `json:"kubelet"`
Kubectl Download `json:"kubectl"`
Containerd Download `json:"containerd"`
Runc Download `json:"runc"`
CNIPlugins Download `json:"cniPlugins"`
CRICTL Download `json:"crictl"`
Helm Download `json:"helm"`
CiliumChart Download `json:"ciliumChart"`
CiliumImage string `json:"ciliumImage"`
CiliumOperatorImage string `json:"ciliumOperatorImage"`
KubernetesImages []ImagePin `json:"kubernetesImages"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient consumes credentials once. They are held in memory only and are never copied into the installation journal, command arguments or reports.
func (*Client) CheckPrerequisites ¶
func (client *Client) CheckPrerequisites(ctx context.Context) (Prerequisites, error)
CheckPrerequisites performs fresh read-only checks. Its report explicitly distinguishes API scheduling headroom from storage failure headroom and policy enforcement, which need the operator's substrate-specific evidence.
type Credentials ¶
type Credentials struct {
OperatorToken string `json:"operatorToken"`
DatabaseAdminPassword string `json:"databaseAdminPassword"`
DatabaseOwnerPassword string `json:"databaseOwnerPassword"`
DatabaseApplicationPassword string `json:"databaseApplicationPassword"`
CACertificate string `json:"caCertificate"`
APIKey string `json:"apiKey"`
APICertificate string `json:"apiCertificate"`
DatabaseKey string `json:"databaseKey"`
DatabaseCertificate string `json:"databaseCertificate"`
SSHClientPrivateKey string `json:"sshClientPrivateKey"`
SSHClientPublicKey string `json:"sshClientPublicKey"`
SSHHostPrivateKey string `json:"sshHostPrivateKey"`
SSHHostPublicKey string `json:"sshHostPublicKey"`
CertificateExpiresAt time.Time `json:"certificateExpiresAt"`
}
Credentials are generated once and kept only in the protected installation directory and its own guest/Kubernetes Secrets. Never encode this structure into a diagnostic report, deterministic plan or command argument.
type Download ¶
type Download struct {
Version string `json:"version"`
URL string `json:"url"`
SHA256 string `json:"sha256"`
}
Download is an exact upstream artifact. Archives are checked before any executable is installed in the owned guest.
type Engine ¶
type Engine struct {
Client *Client
Store *StateStore
Progress io.Writer
}
func (*Engine) Connect ¶
Connect keeps a single loopback HTTPS forwarding listener in the foreground. It owns no background process, proxy configuration, DNS or global CA trust.
func (*Engine) Destroy ¶
Destroy never clears finalizers or directly deletes CSI backend volumes. The normal controllers must finish foreground deletion and Longhorn reclaim.
type ImagePin ¶
ImagePin binds kubeadm's upstream image name to its immutable OCI digest. The alias is needed by upstream kubeadm; it may never be rebound to a different digest while this installation exists.
type Object ¶
type Object struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Resource string `json:"resource"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
UID string `json:"uid,omitempty"`
}
Object identifies the exact API object which an operation may create. UID is filled only from successful API readback, never manufactured locally.
type OwnedObject ¶
type OwnedVolume ¶
type Plan ¶
type Plan struct {
APIVersion string `json:"apiVersion"`
InstallationID string `json:"installationID"`
ProfileSHA256 string `json:"profileSHA256"`
Profile string `json:"profile"`
ProductionReady bool `json:"productionReady"`
TargetClusterUID string `json:"targetClusterUID"`
Objects []Object `json:"objects"`
GuestAddress string `json:"guestAddress"`
GuestCommands []string `json:"guestCommands"`
PublicOrigin string `json:"publicOrigin"`
RequiredPrerequisites []string `json:"requiredPrerequisites"`
}
type Prerequisites ¶
type Prerequisites struct {
ObservedAt time.Time `json:"observedAt"`
TargetClusterUID string `json:"targetClusterUID"`
Node string `json:"node"`
AvailableCPUMilli int64 `json:"availableCPUMilli"`
AvailableMemoryMiB int64 `json:"availableMemoryMiB"`
StorageClass string `json:"storageClass"`
StorageReclaimPolicy string `json:"storageReclaimPolicy"`
StoragePlacementRequiresOperatorAcceptance bool `json:"storagePlacementRequiresOperatorAcceptance"`
NetworkPolicyRequiresLiveDenialTest bool `json:"networkPolicyRequiresLiveDenialTest"`
}
type Profile ¶
type Profile struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Profile string `json:"profile"`
InstallationID string `json:"installationID"`
Target Target `json:"target"`
Guest Guest `json:"guest"`
Network Network `json:"network"`
Artifacts BOM `json:"artifacts"`
}
Profile contains public artifact pins and explicit infrastructure selection. Credentials never belong in a profile or in its deterministic plan.
type ProviderObservation ¶
type ProviderObservation struct {
InstallationID string `json:"installationID"`
Profile string `json:"profile"`
Status string `json:"status"`
OperatorID string `json:"operatorID"`
CreatedAt time.Time `json:"createdAt"`
ProductCount int `json:"productCount"`
Database string `json:"database"`
SourceRevision string `json:"sourceRevision"`
SourceModified bool `json:"sourceModified"`
UnauthenticatedDenied bool `json:"unauthenticatedDenied"`
ForeignTokenDenied bool `json:"foreignTokenDenied"`
}
type Report ¶
type Report struct {
APIVersion string `json:"apiVersion"`
InstallationID string `json:"installationID"`
Profile string `json:"profile"`
ProfileSHA256 string `json:"profileSHA256"`
SourceCommit string `json:"sourceCommit"`
ProductionReady bool `json:"productionReady"`
ObservedAt time.Time `json:"observedAt"`
Phase string `json:"phase"`
Ready bool `json:"ready"`
TargetClusterUID string `json:"targetClusterUID"`
PublicOrigin string `json:"publicOrigin"`
Objects []Object `json:"objects"`
DerivedObjects []Object `json:"derivedObjects,omitempty"`
Volumes []OwnedVolume `json:"volumes,omitempty"`
Provider *ProviderObservation `json:"provider,omitempty"`
Checks []Check `json:"checks"`
ZeroOwnedResidue bool `json:"zeroOwnedResidue"`
}
type State ¶
type State struct {
APIVersion string `json:"apiVersion"`
InstallationID string `json:"installationID"`
OwnerNonce string `json:"ownerNonce"`
ProfileSHA256 string `json:"profileSHA256"`
Profile Profile `json:"profile"`
Credentials Credentials `json:"credentials"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Sequence uint64 `json:"sequence"`
Phase string `json:"phase"`
Objects []OwnedObject `json:"objects"`
DerivedObjects []Object `json:"derivedObjects,omitempty"`
Volumes []OwnedVolume `json:"volumes,omitempty"`
GuestBootstrapped bool `json:"guestBootstrapped"`
FailureCode string `json:"failureCode,omitempty"`
}
State is an installation-specific ownership journal, not runtime data. Accepted API/domain state lives only in the real PostgreSQL provider.
type StateStore ¶
StateStore keeps a process-wide exclusive lock and root directory handle. The root must be a new directory or a complete owned journal. No existing arbitrary directory is adopted, even when its name looks correct.
func OpenState ¶
func OpenState(path string, profile Profile, create bool) (_ *StateStore, resultErr error)
func (*StateStore) Close ¶
func (store *StateStore) Close() error
func (*StateStore) Remove ¶
func (store *StateStore) Remove() error
Remove is called only after the backend's complete owned-resource absence sweep has succeeded. Unexpected local content is preserved, never recursed.
func (*StateStore) Save ¶
func (store *StateStore) Save() error
func (*StateStore) WriteCredentialFile ¶
func (store *StateStore) WriteCredentialFile(name string, payload []byte) error
Source Files
¶
- api.go
- cli.go
- credentials.go
- destroy.go
- guest_bootstrap.go
- guest_download.go
- guest_files_unix.go
- guest_kubernetes.go
- guest_transport.go
- guest_workloads.go
- installer_transfer.go
- inventory.go
- lifecycle.go
- network.go
- objects.go
- plan.go
- prerequisites.go
- profile.go
- provider_client.go
- state.go
- state_unix.go
- substrate_context.go