diff --git a/charts/hariko/Chart.yaml b/charts/hariko/Chart.yaml index 796d76f..2b9bf1a 100644 --- a/charts/hariko/Chart.yaml +++ b/charts/hariko/Chart.yaml @@ -1,3 +1,3 @@ apiVersion: v2 name: hariko -version: 0.1. +version: 0.3. diff --git a/charts/misskey/Chart.yaml b/charts/misskey/Chart.yaml index 05465ba..5611d8f 100644 --- a/charts/misskey/Chart.yaml +++ b/charts/misskey/Chart.yaml @@ -1,3 +1,3 @@ apiVersion: v2 name: misskey -version: 0.1. +version: 0.3. diff --git a/hariko/cmd/root.go b/hariko/cmd/root.go index e318c6c..c87d79a 100644 --- a/hariko/cmd/root.go +++ b/hariko/cmd/root.go @@ -158,6 +158,14 @@ func Execute() { } func deploy(namespace string, packageName string, repositoryName string, repositoryURL string, log io.Writer) error { + os.Setenv("HELM_DRIVER", "configmap") + os.Setenv("HELM_KUBEAPISERVER", "https://kubernetes.default.svc") + os.Setenv("HELM_KUBECAFILE", "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt") + token, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/token") + if err != nil { + return err + } + os.Setenv("HELM_KUBETOKEN", string(token)) if err := run(exec.Command("helm", "repo", "add", "-n", namespace, repositoryName, repositoryURL), log); err != nil { return err } @@ -171,7 +179,6 @@ func deploy(namespace string, packageName string, repositoryName string, reposit } func run(cmd *exec.Cmd, log io.Writer) error { - cmd.Env = append(cmd.Env, "HELM_DRIVER=configmap") cmd.Stdout = log cmd.Stderr = log return cmd.Run()