feat: add longhorn

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-20 05:49:20 -05:00
parent 68fef56403
commit 78bc2849cb

View File

@@ -211,6 +211,23 @@ func CommandInitialize(taintScheduling bool) error {
return fmt.Errorf("Invalid exit code from setfacl command: %d", registryAclCmd.ExitCode)
}
common.LogInfo2Quiet("Installing longhorn")
longhornCmd, err := common.CallExecCommand(common.ExecCommandInput{
Command: "kubectl",
Args: []string{
"apply",
"-f",
"https://raw.githubusercontent.com/longhorn/longhorn/v1.4.0/deploy/longhorn.yaml",
},
StreamStdio: true,
})
if err != nil {
return fmt.Errorf("Unable to call kubectl command: %w", err)
}
if longhornCmd.ExitCode != 0 {
return fmt.Errorf("Invalid exit code from kubectl command: %d", longhornCmd.ExitCode)
}
common.LogInfo2Quiet("Installing k3s automatic upgrader")
upgradeCmd, err := common.CallExecCommand(common.ExecCommandInput{
Command: "kubectl",