Adjust k8s
This commit is contained in:
@@ -9,10 +9,12 @@ func Help_K3S() {
|
||||
fmt.Println(`
|
||||
K3S commands: oc-k8s <action> k3s
|
||||
install - Install k3s
|
||||
create - Create a new cluster
|
||||
help - Show this help message
|
||||
|
||||
Usage:
|
||||
oc-k8s install k3s
|
||||
oc-k8s create k3s
|
||||
oc-k8s help values `)
|
||||
}
|
||||
|
||||
@@ -22,12 +24,16 @@ func Install_K3S() error {
|
||||
if err := utils.Exec("curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644"); err != nil {
|
||||
return err
|
||||
}
|
||||
utils.Exec("yes | sudo cp -rf /etc/rancher/k3s/k3s.yaml ~/.kube/config")
|
||||
utils.Exec("chmod 700 /home/mr/.kube")
|
||||
utils.Exec("sudo chmod 600 ~/.kube/config")
|
||||
Create_K3S()
|
||||
|
||||
if err := utils.Exec("sudo systemctl status k3s"); err != nil {
|
||||
return err
|
||||
}
|
||||
return utils.Exec("chmod 600 ~/.kube/config")
|
||||
}
|
||||
|
||||
func Create_K3S() error {
|
||||
utils.Exec("yes | sudo cp -rf /etc/rancher/k3s/k3s.yaml ~/.kube/config")
|
||||
utils.Exec("chmod 700 /home/mr/.kube")
|
||||
return utils.Exec("chmod 600 ~/.kube/config")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user