https://pulumi.com logo
#kubernetes
Title
# kubernetes
n

nice-father-44210

10/23/2022, 6:47 PM
Is installing a Helm chart from an AWS ECR repo supported in
pulumi-kubernetes
? I’m trying to find the right combination of arguments to make it work but coming up short. Appreciate the help, thanks in advance 🙂
Copy code
ecr_token = aws.ecr.get_authorization_token()

pulumi_kubernetes.helm.v3.Release(
    "release",
    pulumi_kubernetes.helm.v3.ReleaseArgs(
        name = "test",
        chart = "my-chart",
        version = "0.1.0",
        repository_opts = pulumi_kubernetes.helm.v3.RepositoryOptsArgs(
            repo = f"oci://{account_id}.dkr.ecr.{region}.<http://amazonaws.com|amazonaws.com>",
            username = "AWS",
            password = ecr_token.authorization_token,
        ),
        values = {}
    ),
    opts = pulumi.ResourceOptions(provider = my_k8s_provider, )
)
I also tried the approach referenced in this PR: https://github.com/pulumi/pulumi-kubernetes/pull/1892
Copy code
pulumi_kubernetes.helm.v3.Release(
    "release",
    pulumi_kubernetes.helm.v3.ReleaseArgs(
        name = "test",
        chart = f"oci://{account_id}.dkr.ecr.{region}.<http://amazonaws.com/my-chart|amazonaws.com/my-chart>",
        version = "0.1.0",
        values = {}
    ),
    opts = pulumi.ResourceOptions(provider = my_k8s_provider)
)
This resulted in:
failed to load chart from temp directory: stat oci:/12345...
q

quiet-guitar-71730

10/24/2022, 8:01 AM
I’m also having issues with this. I’ve also tried using
Copy code
pulumi_kubernetes.helm.v3.Chart
f

fierce-pillow-7950

10/24/2022, 1:12 PM
you need to specify the repository via
repository_opts
like the example here
n

nice-father-44210

10/24/2022, 3:54 PM
Thanks for the feedback @fierce-pillow-7950. If we assume these variables:
Copy code
chart-name: my-chart
registry_url: {account_id}.dkr.ecr.{region}.<http://amazonaws.com|amazonaws.com>
chart_oci_url: oci://{account_id}.dkr.ecr.{region}.<http://amazonaws.com/my-chart|amazonaws.com/my-chart>
What would you pass as values for
chart
and
repository_opts.repo
? I feel like I’ve tried all the combinations already 😅
f

fierce-pillow-7950

10/24/2022, 4:07 PM
try something like this:
Copy code
release_args = ReleaseArgs(
    chart="my-chart",
    repository_opts=RepositoryOptsArgs(repo=f"oci://{account_id}.dkr.ecr.{region}.<http://amazonaws.com/my-chart%22)|amazonaws.com/my-chart")>,
    version="0.1.0",
    namespace=<namespace>,
    name="my-chart",
)
release = Release(
    "my-chart-release",
    args=release_args,
    opts=pulumi.ResourceOptions.merge(self.opts, pulumi.ResourceOptions(provider=my_k8s_provider)),
)
n

nice-father-44210

10/24/2022, 4:54 PM
Thanks for the suggestion. With this approach I get:
Copy code
error: failed to pull chart: looks like "<oci://12345.dkr.ecr.us-west-2.amazonaws.com/my-chart>" is not a valid chart repository or cannot be reached: object required
Looks like others have run into similar issues with Helm and OCI registries: https://pulumi-community.slack.com/archives/CRFURDVQB/p1662031548410299
The same OCI URL works with the Helm command line as follows:
Copy code
helm install test <oci://12345.dkr.ecr.us-west-2.amazonaws.com/my-chart> --version 0.1.0
393 Views