Skip to content

Commit

Permalink
fix: adds server token args while starting k3s
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtcoder17 committed Jun 24, 2024
1 parent 8bdaa22 commit 0d860bc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 244 deletions.
23 changes: 1 addition & 22 deletions cmd/k3s-runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func execK3s(ctx context.Context, args ...string) error {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

// logger.Info("STARTING k3s @ timestamp: %s, with cmd: %s\n", time.Now().Format(time.RFC3339), cmd.String())
logger.Info("STARTING k3s", "timestamp", time.Now().Format(time.RFC3339), "cmd", cmd.String())

if err := cmd.Run(); err != nil {
Expand All @@ -37,30 +36,10 @@ func execK3s(ctx context.Context, args ...string) error {
return cmd.Wait()
}

// func getPublicIPv4() (string, error) {
// req, err := http.NewRequest(http.MethodGet, "https://ifconfig.me", nil)
// if err != nil {
// return "", err
// }
//
// r, err := http.DefaultClient.Do(req)
// if err != nil {
// return "", err
// }
//
// b, err := io.ReadAll(r.Body)
// if err != nil {
// return "", err
// }
// defer r.Body.Close()
//
// return string(b), nil
// }

func main() {
var runnerCfgFile string
var hasVersionFlag bool
flag.StringVar(&runnerCfgFile, "config", "./runner-config.yml", "--config runner-config-file")
flag.StringVar(&runnerCfgFile, "config", "/etc/kloudlite/runner-config.yml", "--config <runner-config-file>")
flag.BoolVar(&hasVersionFlag, "version", false, "--version")
flag.Parse()

Expand Down
222 changes: 0 additions & 222 deletions cmd/k3s-runner/main.go.old

This file was deleted.

1 change: 1 addition & 0 deletions terraform/modules/kloudlite/k3s/k3s-master/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ locals {
k3s_server_extra_args = {
for k, v in var.master_nodes : k => concat(
[
"token", random_password.k3s_server_token.result,
"--agent-token", random_password.k3s_agent_token.result,
"--disable-helm-controller",
"--disable", "traefik",
Expand Down

0 comments on commit 0d860bc

Please sign in to comment.