Search code examples
azurekubernetes-helmazure-aks

Private AKS is not able to find the path of my local files to do a deployment through Helm


I'm currently trying to deploy my helm charts through my private aks cluster. However, I'm unable to do anything since it can't find the path of my local directory.

This is the command that I'm running:

az aks command invoke \
--resource-group aharo-aks-appgateway01 \
--name aharo-aks02 \
--command "helm install haro ./haro_files_helm_chart" 

This is the error message that I'm getting

command started at 2023-01-06 22:49:46+00:00, finished at 2023-01-06 22:49:46+00:00 with exitcode=1
Error: INSTALLATION FAILED: path "./haro_files_helm_chart" not found

To prove that this type of commands can work, I tried one from the Microsoft Documentation:

az aks command invoke \   
--resource-group aharo-aks-appgateway01 \
--name aharo-aks02 \  
--command "helm repo add bitnami https://charts.bitnami.com/bitnami && helm repo update && helm install my-release bitnami/nginx"

What else can I do to find the path of my directory? Do you know if I could be missing any configuration on my cluster?


Solution

  • When you are passing the helm install command to the AKS VMs, the VMs(nodes) will be looking for ./haro_files_helm_chart in their filesystem not the machine that is running the command, hence the path not found error.

    In the example you shared, the node is installing a helm chart that it is downloading first.

    To resolve the issue, you should attach the directory of the helm chart with the az aks command invoke as documented here. Below is the part you need:

    You can also attach all files in the current directory. For example:

    az aks command invoke \
      --resource-group myResourceGroup \
      --name myAKSCluster \
      --command "kubectl apply -f deployment.yaml configmap.yaml -n default" \
      --file .
    

    For example, I created a chart called "test-chart" and installed it using helm create test-chart. The chart would be created in the current directory im in:

    $ls
    test-chart
    

    Then run the same command shared above and just change the command (without changing the directory):

    az aks command invoke \
      --resource-group myResourceGroup \
      --name myAKSCluster \
      --command "helm install test-chart-override-name test-chart" \
      --file .