Add Volume

This commit is contained in:
mr
2026-01-15 15:48:10 +01:00
parent 8098a86dae
commit 1b77b8b6cf
55 changed files with 246 additions and 72 deletions

View File

@@ -44,7 +44,6 @@ func Delete_Cluster(args ...string) error {
}
func Create_Cluster(args ...string) error {
Delete_Cluster(args...)
folder := "."
env := "dev"
if len(args) > 0 {
@@ -109,5 +108,9 @@ containerdConfigPatches:
if err := utils.Exec("kubectl config use-context kind-opencloud"); err != nil {
return err
}
if err := utils.Exec("docker start opencloud-control-plane"); err != nil {
return err
}
return nil
}

View File

@@ -42,6 +42,8 @@ Usage:
func Start(args ...string) error {
utils.Exec("sudo sysctl -w fs.inotify.max_user_instances=256")
utils.Exec("sudo sysctl -w fs.inotify.max_user_watches=65536")
utils.Exec("sudo /etc/init.d/apache2 stop")
utils.Exec("sudo nginx -s stop")
Create_Cluster(args...)

View File

@@ -53,11 +53,11 @@ func Delete_Helm(args ...string) error {
func Create_Helm(args ...string) error {
tmp := "./opencloud-chart"
utils.Exec("sudo rm -rf " + tmp)
if err := os.MkdirAll(tmp, os.ModePerm); err != nil {
fmt.Println(err)
return err
}
defer os.RemoveAll(tmp)
ExtractTrees("assets", tmp)
folder := "."
@@ -77,22 +77,40 @@ func Create_Helm(args ...string) error {
if len(args) > 2 {
namespace = args[2]
}
fmt.Println("set up helm")
if err := utils.Exec("helm dependency update " + tmp); err != nil {
return err
}
fmt.Println("set up deps")
for name, repo := range utils.ExtractRepo() {
utils.Exec("helm repo add " + name + " " + repo)
}
if err := utils.Exec("helm dependency build " + tmp); err != nil {
return err
}
utils.Exec("kubectl delete sc longhorn-nor1")
if err := utils.Exec("helm install " + release + " " + tmp + " -n " + namespace + " --create-namespace -f " + folder + "/" + release + "-values.yaml --debug"); err != nil {
utils.Exec("sudo ulimit -n 1000000")
utils.Exec("helm repo add jetstack https://charts.jetstack.io")
utils.Exec("helm repo update")
utils.Exec("kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.crds.yaml")
utils.Exec("helm repo add jetstack https://charts.jetstack.io")
utils.Exec("helm repo update")
utils.Exec("helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.14.0")
utils.Exec("helm install admiralty oci://public.ecr.aws/admiralty/admiralty --namespace admiralty --create-namespace --version 0.17.0 --wait")
utils.Exec("helm repo add argo https://argoproj.github.io/argo-helm")
utils.Exec("helm repo update")
utils.Exec("helm install argo-workflows argo/argo-workflows --namespace argo --create-namespace")
if err := utils.Exec("helm upgrade --install " + release + " " + tmp + " -n " + namespace + " --create-namespace -f " + folder + "/" + release + "-values.yaml --debug"); err != nil {
return err
}
utils.Exec("kind get kubeconfig --name " + clusterName + " > ./deployed_config")
utils.Exec("kind export logs ./kind-logs")
utils.Exec("sudo rm -rf " + tmp)
return nil
}

View File

@@ -58,6 +58,7 @@ func generateConfig(confFile string, release string, output_folder string) error
if err != nil {
return err
}
confs["RELEASE"] = release
rendered := renderTemplate(string(content), confs)