https://pulumi.com logo
#golang
Title
# golang
a

alert-monitor-28534

07/06/2021, 8:09 AM
Hi I'm not really a programmer but I'm still trying to have my homelab up and running with Pulumi and Golang. I try to deploy Traefik via Helm chart but I don't know how to define the "env" for the
values.yml
, this is what I have now:
"env": pulumi.Map{
"name": pulumi.String("DUCKDNS_TOKEN"),
"valueFrom": pulumi.Map{
"secretKeyRef": pulumi.Map{
"name": pulumi.String("duckdns"),
"key":  pulumi.String("token"),
},
},
},
pulumi up
says this when deploying:
warning: skipped value for env: Not a table.
How should I do this?
b

billowy-army-68599

07/06/2021, 2:30 PM
can you share your hold helm declaration?
a

alert-monitor-28534

07/07/2021, 4:20 AM
sure, here it is:
Copy code
traefik, err := helm.NewChart(ctx, "traefik", helm.ChartArgs{
			Chart:     pulumi.String("traefik"),
			Version:   pulumi.String("9.19.2"),
			Namespace: pulumi.String("default"),
			FetchArgs: helm.FetchArgs{
				Repo: pulumi.String("<https://helm.traefik.io/traefik>"),
			},
			Values: pulumi.Map{
				"image": pulumi.Map{
					"name": pulumi.String("traefik"),
				},
				"ingressRoute": pulumi.Map{
					"dashboard": pulumi.Map{
						"enabled": pulumi.Bool(false),
					},
				},
				"additionalArguments": pulumi.StringArray{
					pulumi.String("--<http://entryPoints.web.http.redirections.entryPoint.to|entryPoints.web.http.redirections.entryPoint.to>=websecure"),
					pulumi.String("--entryPoints.web.http.redirections.entryPoint.scheme=https"),
					pulumi.String("--certificatesresolvers.letsencrypt.acme.email=xxxx@gmail.com"),
					pulumi.String("--certificatesresolvers.le.acme.storage=/data/acme.json"),
					pulumi.String("--certificatesresolvers.letsencrypt.acme.caserver=<https://acme-v02.api.letsencrypt.org/directory>"),
					pulumi.String("--certificatesResolvers.letsencrypt.acme.dnschallenge=true"),
					pulumi.String("--certificatesResolvers.letsencrypt.acme.dnschallenge.provider=duckdns"),
					pulumi.String("--log.level=INFO"),
				},
				"persistence": pulumi.Map{
					"enabled:":   pulumi.Bool(true),
					"name":       pulumi.String("data"),
					"accessMode": pulumi.String("ReadWriteOnce"),
					"size":       pulumi.String("128Mi"),
					"path":       pulumi.String("/data"),
				},
				"env": pulumi.Map{
					"name": pulumi.String("DUCKDNS_TOKEN"),
					"valueFrom": pulumi.Map{
						"secretKeyRef": pulumi.Map{
							"name": pulumi.String("duckdns"),
							"key":  pulumi.String("token"),
						},
					},
				},
			},
		}, pulumi.DependsOn([]pulumi.Resource{ddns_secret}))
		if err != nil {
			return err
		}
b

brash-match-91530

07/14/2021, 8:56 AM
I think
env
should be
pulumi.Array
and not a map
5 Views