Files
kubesolo-os/cloud-init/config.go
Adolfo Delorenzo 1b44c9d621
Some checks failed
ARM64 Build / Build generic ARM64 disk image (push) Failing after 3s
CI / Go Tests (push) Successful in 1m27s
CI / Shellcheck (push) Failing after 50s
CI / Build Go Binaries (amd64, linux, linux-amd64) (push) Failing after 1m33s
CI / Build Go Binaries (arm64, linux, linux-arm64) (push) Failing after 1m15s
feat: bump KubeSolo to v1.1.5 + cross-arch CI workflow
Phase 4 of v0.3 — KubeSolo version bump and CI gating.

KubeSolo v1.1.0 → v1.1.5 brings:
- New flag --disable-ipv6 (v1.1.5)
- New flag --db-wal-repair (v1.1.5) — important for power-loss resilience
  on edge appliances; surfaced as kubesolo.db-wal-repair in cloud-init
- New flag --full (v1.1.4) — disables edge-optimised k8s overrides
- Pod egress connectivity fix after reboot (v1.1.4)
- Registry config persistence fix (v1.1.5)
- k8s 1.34.7, CoreDNS 1.14.3, Go 1.26.2

All three new flags wired into cloud-init: config.go fields, kubesolo.go
extra-flag emission, full-config.yaml example.

Supply-chain hygiene:
- Per-arch checksums: KUBESOLO_SHA256_AMD64 and KUBESOLO_SHA256_ARM64 in
  versions.env. Replaces the single shared KUBESOLO_SHA256 that couldn't
  meaningfully verify both binaries at once.
- Checksum now applied to the tarball (the immutable upstream artifact)
  rather than the post-extract binary.

CI:
- New .gitea/workflows/build-arm64.yaml routes the full kernel + rootfs +
  disk-image build to the Odroid arm64-linux runner. Triggers on push to
  main, tags, and manual workflow_dispatch. The boot smoke test is
  continue-on-error because KubeSolo's first-boot image import deadline
  fires under QEMU TCG on the Odroid.

VERSION bumped to 0.3.0-dev. CHANGELOG entry under [0.3.0-dev] captures all
Phase 1-4 work + the known limitations documented in arm64-status.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 16:26:20 -06:00

77 lines
2.8 KiB
Go

// Package cloudinit implements a lightweight cloud-init parser for KubeSolo OS.
//
// It reads a simplified cloud-init YAML config and applies:
// - hostname
// - network configuration (static IP or DHCP)
// - KubeSolo extra flags and settings
// - NTP servers
//
// The config file is typically at /mnt/data/etc-kubesolo/cloud-init.yaml
// or specified via kubesolo.cloudinit= boot parameter.
package cloudinit
// Config is the top-level cloud-init configuration.
type Config struct {
Hostname string `yaml:"hostname"`
Network NetworkConfig `yaml:"network"`
KubeSolo KubeSoloConfig `yaml:"kubesolo"`
NTP NTPConfig `yaml:"ntp"`
Airgap AirgapConfig `yaml:"airgap"`
Portainer PortainerConfig `yaml:"portainer"`
}
// NetworkConfig defines network settings.
type NetworkConfig struct {
Mode string `yaml:"mode"` // "dhcp" or "static"
Interface string `yaml:"interface"` // e.g. "eth0" (auto-detected if empty)
Address string `yaml:"address"` // CIDR notation, e.g. "192.168.1.100/24"
Gateway string `yaml:"gateway"` // e.g. "192.168.1.1"
DNS []string `yaml:"dns"` // nameservers
}
// KubeSoloConfig defines KubeSolo-specific settings.
type KubeSoloConfig struct {
ExtraFlags string `yaml:"extra-flags"`
LocalStorage *bool `yaml:"local-storage"`
LocalStorageSharedPath string `yaml:"local-storage-shared-path"`
ExtraSANs []string `yaml:"apiserver-extra-sans"`
Debug bool `yaml:"debug"`
PprofServer bool `yaml:"pprof-server"`
PortainerEdgeID string `yaml:"portainer-edge-id"`
PortainerEdgeKey string `yaml:"portainer-edge-key"`
PortainerEdgeAsync bool `yaml:"portainer-edge-async"`
// v1.1.4+: skip edge-optimised overrides, use upstream k8s defaults
// (useful for CI and powerful machines, disabled by default).
Full bool `yaml:"full"`
// v1.1.5+: disable IPv6 in the cluster.
DisableIPv6 bool `yaml:"disable-ipv6"`
// v1.1.5+: detect SQLite WAL corruption on startup and recover from
// unclean shutdowns (e.g. power loss). Recommended ON for edge devices.
DBWALRepair bool `yaml:"db-wal-repair"`
}
// NTPConfig defines NTP settings.
type NTPConfig struct {
Servers []string `yaml:"servers"`
}
// AirgapConfig defines air-gapped deployment settings.
type AirgapConfig struct {
ImportImages bool `yaml:"import-images"`
ImagesDir string `yaml:"images-dir"`
}
// PortainerConfig defines Portainer Edge Agent settings.
type PortainerConfig struct {
EdgeAgent EdgeAgentConfig `yaml:"edge-agent"`
}
// EdgeAgentConfig holds Portainer Edge Agent connection details.
type EdgeAgentConfig struct {
Enabled bool `yaml:"enabled"`
EdgeID string `yaml:"edge-id"`
EdgeKey string `yaml:"edge-key"`
PortainerURL string `yaml:"portainer-url"`
Image string `yaml:"image"`
}