Azure / Azure/azure-dev

[Issue] AKS service target deploys both Helm charts and manifests even when using Helm exclusively

Open
#5,191 0 comments 0 reactions 0 assignees View on GitHub
area/aks customer-reported enhancement needs-team-attention
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

- [x] Make sure you've installed the latest version using [instructions in the wiki](../wiki/install)

**Output from `azd version`**
```
azd version 1.15.1 (commit b8385e796d2a4b2e5b431ddf3fcc2069034d7ce3)
```

**Describe the bug**
When deploying to AKS with Helm charts specified, the AKS service target incorrectly deploys both the Helm charts and any YAML manifests found in the default manifests directory. This occurs even when the intention is to use Helm exclusively.

**To Reproduce**

1. Create an AKS-targeted service
2. Configure the service to use Helm charts in the azure.yaml file
3. Leave the deploymentPath empty in the configuration
4. Have YAML manifests in the default manifests directory
5. Run azd deploy

**Expected behavior**
When Helm is configured for a service, and deploymentPath is empty, only the Helm charts should be deployed. The service target should not automatically look for and deploy manifests from the default manifests directory.

**Additional context**
In service_target_aks.go, the Deploy method deploys resources in this order:

1. Helm charts
2. Kustomize manifests
3. YAML manifests

When Helm is configured but deploymentPath is empty, the code uses defaultDeploymentPath ("manifests") as the fallback location. It then checks if this directory exists and deploys any manifests found there, regardless of whether Helm deployment was already successful.

```
func (t *aksTarget) deployManifests(...) {
deploymentPath := serviceConfig.K8s.DeploymentPath
if deploymentPath == "" {
deploymentPath = defaultDeploymentPath // Set to "manifests"
}
// ...
// Later checks if directory exists and deploys manifests if found
}
```

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.