command
This commit is contained in:
55
internal/func.go
Normal file
55
internal/func.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"oc-k8s/utils"
|
||||
)
|
||||
|
||||
func Help_Func() {
|
||||
fmt.Println(`
|
||||
Main commands: oc-k8s <action>
|
||||
install - Install opencloud dependancies [arch] [version]
|
||||
start - Start opencloud k8s
|
||||
stop - Stop opencloud k8s
|
||||
Usage:
|
||||
oc-k8s install [arch] [version]
|
||||
arch - Arch of OS (required)
|
||||
kind_version - version of kind (required)
|
||||
oc-k8s start [env_folder] [release] [namespace] [branch] [target] [hostname]
|
||||
env_folder - Helm config folder (required, default: .)
|
||||
release - environnement selected (default: dev)
|
||||
namespace - namespace selected (default: dev)
|
||||
branch - Git branch to build (default: main)
|
||||
target - make target (default: all)
|
||||
oc-k8s stop`)
|
||||
Help_Cluster()
|
||||
Help_Services()
|
||||
Help_Helm()
|
||||
Help_Values()
|
||||
Help_K3S()
|
||||
Help_Kind()
|
||||
Help_DB()
|
||||
}
|
||||
|
||||
func Start(args ...string) error {
|
||||
utils.Exec("sudo sysctl -w fs.inotify.max_user_instances=256")
|
||||
utils.Exec("sudo /etc/init.d/apache2 stop")
|
||||
utils.Exec("sudo nginx -s stop")
|
||||
Create_Cluster(args...)
|
||||
Create_Services(args...)
|
||||
Create_Helm(args...)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Stop(args ...string) error {
|
||||
Delete_Helm(args...)
|
||||
Delete_Cluster(args...)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Install_Func(args ...string) error {
|
||||
Install_K3S()
|
||||
Install_Kind(args...)
|
||||
Install_Helm()
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user