Add k3s and flux installation

This commit is contained in:
Daniel Cosme
2026-04-17 18:11:18 -04:00
parent 78ec3af8c4
commit ff4eb295ef
16 changed files with 341 additions and 6498 deletions

49
magefiles/magefile.go Normal file
View File

@@ -0,0 +1,49 @@
package main
import (
"danicos.dev/daniel/homelab/pkg/root"
"danicos.dev/daniel/homelab/pkg/target"
// "github.com/magefile/mage/mg" // mg contains helpful utility functions, like Deps
/*
NOTE: Mage https://github.com/magefile/mage
Mage other packages
"github.com/magefile/mage/mage"
"github.com/magefile/mage/parse"
"github.com/magefile/mage/target"
*/)
var r target.Runner
var Default = Run
var Aliases = map[string]any{
"r": Run,
}
func init() {
Env := map[string]string{
"LINUX_ADMIN": "arch",
"CLUSTER_NAME": root.HYDRA_CLUSTER,
"CLUSTER_HOST": root.HYDRA_HOSTNAME,
"GITEA_HOST": root.GITEA_HOST,
}
r = target.NewRunner(Env, nil)
}
func Run() error {
t := target.NewA("go", "run", ".")
return r.RunV("run", t)
}
func InstallK3S() error {
t := target.New("./scripts/install_k3s.sh")
return r.RunV("Install k3s", t)
}
func GetKubeconfig() error {
t := target.New("./scripts/get_kubeconfig.sh")
return r.RunV("Get Kubeconfig", t)
}
func InstallFlux() error {
t := target.New("./scripts/install_flux.sh")
return r.RunV("Install Flux", t)
}