migrate from kubespray to library helm client
This commit is contained in:
@@ -2,13 +2,28 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"kube-forge/internal/additional"
|
||||
"kube-forge/internal/cicd"
|
||||
"kube-forge/internal/config"
|
||||
"kube-forge/internal/csi"
|
||||
"kube-forge/internal/kubespray"
|
||||
"kube-forge/internal/logging"
|
||||
"kube-forge/internal/observability"
|
||||
"kube-forge/internal/registry"
|
||||
"kube-forge/internal/secrets_storage"
|
||||
"kube-forge/internal/templates"
|
||||
"os"
|
||||
)
|
||||
|
||||
func installAndConfigureModules() {
|
||||
csi.ApplyCharts()
|
||||
additional.ApplyCharts()
|
||||
registry.ApplyCharts()
|
||||
secrets_storage.ApplyCharts()
|
||||
cicd.ApplyCharts()
|
||||
observability.ApplyCharts()
|
||||
}
|
||||
|
||||
func main() {
|
||||
var password, configPath, workDir string
|
||||
var verbose bool
|
||||
@@ -20,9 +35,6 @@ func main() {
|
||||
flag.Parse()
|
||||
config := config.CreateConfig(configPath, workDir, password)
|
||||
config.Verbose = verbose
|
||||
repositories, releases := templates.GetHelmAppsConfigData()
|
||||
config.Repositories = repositories
|
||||
config.Releases = releases
|
||||
|
||||
templates.ApplyK8sTemplates()
|
||||
|
||||
@@ -30,9 +42,10 @@ func main() {
|
||||
switch cmd {
|
||||
case "apply":
|
||||
kubespray.InstallCluster("")
|
||||
installAndConfigureModules()
|
||||
return
|
||||
case "apply-modules":
|
||||
kubespray.InstallCluster("helm-apps")
|
||||
installAndConfigureModules()
|
||||
return
|
||||
case "upgrade":
|
||||
kubespray.UpgradeCluster("")
|
||||
@@ -42,5 +55,5 @@ func main() {
|
||||
return
|
||||
}
|
||||
}
|
||||
fmt.Println("No such command\nAvailable commands: apply, apply-modules, upgrade, scale")
|
||||
logging.Log.Error("No such command\nAvailable commands: apply, apply-modules, upgrade, scale")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user