command
This commit is contained in:
29
internal/k3s.go
Normal file
29
internal/k3s.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"oc-k8s/utils"
|
||||
)
|
||||
|
||||
func Help_K3S() {
|
||||
fmt.Println(`
|
||||
K3S commands: oc-k8s <action> k3s
|
||||
install - Install k3s
|
||||
help - Show this help message
|
||||
|
||||
Usage:
|
||||
oc-k8s install k3s
|
||||
oc-k8s help values `)
|
||||
}
|
||||
|
||||
func Install_K3S() error {
|
||||
utils.Exec("sudo /usr/local/bin/k3s-uninstall.sh")
|
||||
utils.Exec("sudo rm -rf /etc/rancher /var/lib/rancher ~/.kube")
|
||||
if err := utils.Exec("curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644"); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := utils.Exec("sudo systemctl status k3s"); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user