microsoft / microsoft/aspire

Ability to override values in the helm values.yaml file.

Open
#9,431 1 comment 1 reaction 0 assignees View on GitHub
area-deployment kubernetes
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

Aspire 9.3 added support for overriding or adding values to Kubernetes manifests by using the `PublishAsKubernetesService` method. For Aspire to be the "source of truth" for deployments, it is necessary to define your image and tag when defining your services in `Program.cs`.

It is possible to overwrite the default image by using `PublishAsKubernetesService` as follows

```csharp
builder.AddProject("myproject")
.PublishAsKubernetesService(resource =>
{
resource.Deployment!.Spec.Template!.Spec.Containers[0].Image = "my-image:my-tag";
});
```

This is acceptable, but negates the need for the Image variable in `values.yaml`. Modifying the image variable would not end up effecting the deploy, as it's hard-coded in the service's `deployment.yaml` as a result of the previous `PublishAsKubernetesService` call.

### Describe the solution you'd like

`values.yaml` serves a valuable role as a one-stop place to modify constantly evolving variables such as image tags. The default tag is `myproject:latest`, which is fine for local development, but does not work when your package is in a remote repository.

An additional parameter in `PublishAsKubernetesService` would be good to overwrite the value in the values.yaml file

```csharp
PublishAsKubernetesService((resource, values) => {
values.Get("myproject").Get("myproject_image") = "myimage:mytag"
});
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.