Documentation
¶
Overview ¶
Package executor carries out an upgrade or rollback. It runs as a detached kubesolo process (kubesolo --upgrade-executor=<job>), outside the KubeSolo service it stops and restarts, and holds the upgrade lock from start to finish.
It needs SQLite and a Kubernetes client, so only the kubesolo binary links it. The parts kubesoloctl shares live in internal/upgrade.
Index ¶
- Constants
- func CheckDatastore(path string) error
- func CheckHealth(ctx context.Context, kubeconfig, wantVersion string) upgrade.Health
- func CloneFile(src, dst string, mode os.FileMode) error
- func Main(jobFile string) int
- func QuickCheck(path string) error
- func SnapshotDatastore(src, dst string) error
- func Summary(h upgrade.Health) string
Constants ¶
const ( CheckAPIServer = "apiserver" CheckNode = "node" CheckVersion = "version" CheckDNS = "coredns" )
Health check names, as they appear in upgrade.Health.Checks.
Variables ¶
This section is empty.
Functions ¶
func CheckDatastore ¶
CheckDatastore is the datastore dry-run, run by the *new* binary against a copy of the datastore: it opens the copy exactly as kine will, which applies kine's schema setup and data migration, then checks the result is intact and readable.
It catches the one failure that makes a rollback ugly — a binary that cannot open, or corrupts, the store it is about to be started on — while the real datastore is untouched and the old binary is still running.
func CheckHealth ¶
CheckHealth is KubeSolo's own view of whether it works: the API server is ready, the node is Ready, and CoreDNS — the first workload KubeSolo deploys, and so a fair test that the runtime, the network and the kubelet all work — has a ready pod.
wantVersion, when set, must be the KubeSolo version the kubelet reports. The node object outlives the process, so a Ready node alone does not show which binary is behind it.
func CloneFile ¶
CloneFile copies src to dst, sharing blocks when the filesystem supports it (FICLONE: btrfs, XFS with reflink, bcachefs, overlayfs on those). A clone is instant and takes no space until either file changes. Elsewhere it is an ordinary copy. dst is synced either way.
func Main ¶
Main runs the job in jobFile and returns the process exit code. It is the whole of `kubesolo --upgrade-executor`.
func QuickCheck ¶
QuickCheck runs SQLite's quick_check on a database file.
func SnapshotDatastore ¶
SnapshotDatastore writes a consistent copy of the live datastore at src to dst while kine keeps running.
VACUUM INTO reads the database inside one transaction, so the copy is a single point in time even with kine writing, and it folds the WAL in: the result is one self-contained file with no -wal or -shm to keep beside it. Copying state.db alone would lose every transaction still in the WAL.
Types ¶
This section is empty.