local

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CephCredentials

type CephCredentials struct {
	FSID                  string
	CephfsAdmin           CephUserCredentials
	CephfsAdminCodesphere CephUserCredentials
	CSIRBDNode            CephUserCredentials
	CSIRBDProvisioner     CephUserCredentials
	CSICephFSNode         CephUserCredentials
	CSICephFSProvisioner  CephUserCredentials
}

CephCredentials holds all Ceph credentials needed by Codesphere.

type CephUserCredentials

type CephUserCredentials struct {
	Entity string
	Key    string
}

CephUserCredentials holds the entity name and key for a Ceph auth user.

type CodesphereEnvironment

type CodesphereEnvironment struct {
	BaseDomain   string   `json:"base_domain"`
	Experiments  []string `json:"experiments"`
	FeatureFlags []string `json:"feature_flags"`
	Profile      string   `json:"profile"`
	// Installer
	InstallVersion string `json:"install_version"`
	InstallHash    string `json:"install_hash"`
	InstallLocal   string `json:"install_local"`
	// Registry
	RegistryUser     string `json:"-"`
	RegistryPassword string `json:"-"`
	// Config
	InstallDir         string              `json:"-"`
	ExistingConfigUsed bool                `json:"-"`
	InstallConfigPath  string              `json:"-"`
	SecretsFilePath    string              `json:"-"`
	InstallConfig      *files.RootConfig   `json:"-"`
	Vault              *files.InstallVault `json:"-"`
}

type LocalBootstrapper

type LocalBootstrapper struct {

	// Environment
	Env *CodesphereEnvironment
	// contains filtered or unexported fields
}

func (*LocalBootstrapper) Bootstrap

func (b *LocalBootstrapper) Bootstrap() error

func (*LocalBootstrapper) CreateCephAdminSecrets

func (b *LocalBootstrapper) CreateCephAdminSecrets() error

CreateCephAdminSecrets creates the ceph-admin-credentials Secret in the codesphere and workspaces namespaces containing the CephFS admin credentials.

func (*LocalBootstrapper) DeployCephBlockPoolAndStorageClass

func (b *LocalBootstrapper) DeployCephBlockPoolAndStorageClass() error

func (*LocalBootstrapper) DeployCephFilesystem

func (b *LocalBootstrapper) DeployCephFilesystem() error

DeployCephFilesystem creates the CephFS filesystem "codesphere" via a CephFilesystem CRD.

func (*LocalBootstrapper) DeployCephFilesystemSubVolumeGroup

func (b *LocalBootstrapper) DeployCephFilesystemSubVolumeGroup() error

DeployCephFilesystemSubVolumeGroup creates the "workspace-volumes" SubVolumeGroup on the CephFS filesystem.

func (*LocalBootstrapper) DeployCephUsers

func (b *LocalBootstrapper) DeployCephUsers() error

DeployCephUsers creates CephClient CRDs for the Ceph auth users required by Codesphere.

func (*LocalBootstrapper) DeployPostgresDatabase

func (b *LocalBootstrapper) DeployPostgresDatabase() error

func (*LocalBootstrapper) DeployTestCephCluster

func (b *LocalBootstrapper) DeployTestCephCluster() error

func (*LocalBootstrapper) DownloadInstallerPackage

func (b *LocalBootstrapper) DownloadInstallerPackage() (string, error)

DownloadInstallerPackage downloads the Codesphere installer package from the OMS portal, similar to how the GCP bootstrapper fetches it onto a jumpbox. The package is downloaded into the directory that contains the config/secrets files and its on-disk filename is returned.

func (*LocalBootstrapper) EnsureGitHubAccessConfigured

func (b *LocalBootstrapper) EnsureGitHubAccessConfigured() error

func (*LocalBootstrapper) EnsureInstallConfig

func (b *LocalBootstrapper) EnsureInstallConfig() error

func (*LocalBootstrapper) EnsureNamespaces

func (b *LocalBootstrapper) EnsureNamespaces() error

func (*LocalBootstrapper) EnsureSecrets

func (b *LocalBootstrapper) EnsureSecrets() error

func (*LocalBootstrapper) InstallCloudNativePGHelmChart

func (b *LocalBootstrapper) InstallCloudNativePGHelmChart() error

func (*LocalBootstrapper) InstallRookHelmChart

func (b *LocalBootstrapper) InstallRookHelmChart() error

func (*LocalBootstrapper) PrepareInstallerBundle

func (b *LocalBootstrapper) PrepareInstallerBundle() (string, error)

PrepareInstallerBundle resolves the installer package to a directory. It handles three cases:

  1. Portal download: InstallVersion+InstallHash are set → download tar.gz, then extract.
  2. Local tar.gz/tgz: InstallLocal points to an archive → extract.
  3. Local directory: InstallLocal points to an already-unpacked directory → use as-is.

func (*LocalBootstrapper) ReadCephCredentials

func (b *LocalBootstrapper) ReadCephCredentials() (*CephCredentials, error)

ReadCephCredentials reads all Ceph credentials from the cluster:

  • FSID from CephCluster status
  • Custom user keys from CephClient-generated K8s Secrets
  • CSI user keys from Rook-managed K8s Secrets

func (*LocalBootstrapper) ReadClusterCIDRs

func (b *LocalBootstrapper) ReadClusterCIDRs() (podCIDR string, serviceCIDR string, err error)

ReadClusterCIDRs reads the pod and service CIDRs from the running Kubernetes cluster. Pod CIDR is read from the first node's spec.podCIDR. Service CIDR is read from the kube-apiserver pod's --service-cluster-ip-range flag.

func (*LocalBootstrapper) ReadPostgresCA

func (b *LocalBootstrapper) ReadPostgresCA() (string, error)

func (*LocalBootstrapper) ReadPostgresSuperuserPassword

func (b *LocalBootstrapper) ReadPostgresSuperuserPassword() (string, error)

func (*LocalBootstrapper) ResolveAgeKey

func (b *LocalBootstrapper) ResolveAgeKey() error

func (*LocalBootstrapper) RunInstaller

func (b *LocalBootstrapper) RunInstaller() (err error)

RunInstaller extracts the deps.tar.gz archive locally and then runs the install-components.js script directly on the local machine for each required component step (setUpCluster, codesphere), instead of running the private-cloud-installer.js which orchestrates remote nodes via SSH.

func (*LocalBootstrapper) SyncCephMonEndpoints

func (b *LocalBootstrapper) SyncCephMonEndpoints() error

SyncCephMonEndpoints copies the rook-ceph-mon-endpoints ConfigMap from the rook-ceph namespace into the codesphere and workspaces namespaces so that CSI plugins and other consumers can discover the Ceph monitor addresses.

func (*LocalBootstrapper) UpdateInstallConfig

func (b *LocalBootstrapper) UpdateInstallConfig() (err error)

func (*LocalBootstrapper) WaitForPostgresDatabaseReady

func (b *LocalBootstrapper) WaitForPostgresDatabaseReady() error

func (*LocalBootstrapper) WaitForTestCephClusterReady

func (b *LocalBootstrapper) WaitForTestCephClusterReady() error

Jump to

Keyboard shortcuts

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