Created
November 14, 2024 21:47
-
-
Save marcosnils/0806e0203c7c1fa5f8916d9c2b7e3705 to your computer and use it in GitHub Desktop.
gen3 dagger k3s helm example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"dagger/gen-3/internal/dagger" | |
) | |
type Gen3 struct{} | |
// Returns a container that echoes whatever string argument is provided | |
func (m *Gen3) Service(ctx context.Context) *dagger.Container { | |
k3s := dag.K3S("gen3") | |
k3s.Server().Start(ctx) | |
return dag.Container().From("alpine/helm"). | |
WithWorkdir("/app"). | |
WithExec([]string{"apk", "add", "kubectl"}). | |
WithEnvVariable("KUBECONFIG", "/.kube/config"). | |
WithFile("/.kube/config", k3s.Config()). | |
WithExec([]string{"helm", "upgrade", "--repo", "https://helm.gen3.org", "--install", "gen3", "gen3"}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment