feat: add distribution and fleet management — CI/CD, OCI, metrics, ARM64 (Phase 5)
- Gitea Actions CI pipeline: Go tests, build, shellcheck on push/PR - Gitea Actions release pipeline: full build + artifact upload on version tags - OCI container image builder for registry-based OS distribution - Zero-dependency Prometheus metrics endpoint (kubesolo_os_info, boot, memory, update status) with 10 tests - USB provisioning tool for air-gapped deployments with cloud-init injection - ARM64 cross-compilation support (TARGET_ARCH env var + build-cross.sh) - Updated build scripts to accept TARGET_ARCH for both amd64 and arm64 - New Makefile targets: oci-image, build-cross Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
21
update/cmd/metrics.go
Normal file
21
update/cmd/metrics.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"github.com/portainer/kubesolo-os/update/pkg/metrics"
|
||||
)
|
||||
|
||||
// Metrics starts the Prometheus-compatible metrics HTTP server.
|
||||
func Metrics(args []string) error {
|
||||
fs := flag.NewFlagSet("metrics", flag.ExitOnError)
|
||||
listenAddr := fs.String("listen", ":9100", "Metrics HTTP listen address")
|
||||
grubenvPath := fs.String("grubenv", "/boot/grub/grubenv", "Path to grubenv file")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return fmt.Errorf("parse flags: %w", err)
|
||||
}
|
||||
|
||||
srv := metrics.NewServer(*listenAddr, *grubenvPath)
|
||||
return srv.ListenAndServe()
|
||||
}
|
||||
Reference in New Issue
Block a user