Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/website/npm_and_yarn…
Browse files Browse the repository at this point in the history
…-c82b2b8218
  • Loading branch information
osterman authored Oct 30, 2024
2 parents af9f3ec + 315e694 commit 13c9639
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
12 changes: 10 additions & 2 deletions examples/demo-helmfile/atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@ schemas:
atmos:
manifest: "schemas/atmos-manifest.json"


templates:
settings:
enabled: true
sprig:
enabled: true
gomplate:
enabled: true

components:
helmfile:
base_path: "components/helmfile"
use_eks: false
kubeconfig_path: "{{ .Env.KUBECONFIG }}"

stacks:
base_path: "stacks"
included_paths:
- "**/*"
- "deploy/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_pattern: "{stage}"
Expand Down
4 changes: 2 additions & 2 deletions examples/demo-helmfile/stacks/mixins/k3s.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
env:
# Configure `kubectl` to use the `kubeconfig.yaml` file generated by the K3s server
KUBECONFIG: "./kubeconfig.yaml"

# This needs to be an absolute path, since `helmfile` is executed from the component's directory
KUBECONFIG: '{{ .Env.KUBECONFIG | default (printf "%s/kubeconfig.yaml" (getenv "PWD")) }}'
4 changes: 4 additions & 0 deletions internal/exec/helmfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ func ExecuteHelmfile(info schema.ConfigAndStacksInfo) error {
envVars = append(envVars, fmt.Sprintf("REGION=%s", context.Region))
}

if cliConfig.Components.Helmfile.KubeconfigPath != "" {
envVars = append(envVars, fmt.Sprintf("KUBECONFIG=%s", cliConfig.Components.Helmfile.KubeconfigPath))
}

if cliConfig.Components.Helmfile.UseEKS {
envVars = append(envVars, envVarsEKS...)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var (
},
Helmfile: schema.Helmfile{
BasePath: "components/helmfile",
KubeconfigPath: "/dev/shm",
KubeconfigPath: "",
HelmAwsProfilePattern: "{namespace}-{tenant}-gbl-{stage}-helm",
ClusterNamePattern: "{namespace}-{tenant}-{environment}-{stage}-eks-cluster",
UseEKS: true,
Expand Down

0 comments on commit 13c9639

Please sign in to comment.