You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

私有AKS集群无法找到本地文件路径进行Helm部署求助

问题描述

尝试通过私有AKS集群部署本地Helm Chart时,执行部署命令后集群无法找到本地目录路径,导致部署失败。

执行的部署命令:

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

收到的错误信息:

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

已验证从远程Helm仓库拉取Chart的官方示例命令可正常执行:

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"
解决方案

核心原因

az aks command invoke是在AKS集群的节点内部执行命令,本地目录不会自动同步到集群节点上,因此节点无法找到本地的./haro_files_helm_chart路径。不存在集群配置缺失的问题,本质是本地文件未同步到执行环境。

具体解决方法

方法1:使用--file参数同步本地Chart目录到节点

通过--file参数可以将本地的Chart目录上传到集群节点的临时执行目录,之后执行helm命令即可访问到该目录:

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

方法2:打包Chart为tgz文件后上传部署

先将本地Chart打包成压缩文件:

helm package ./haro_files_helm_chart

再通过--file上传打包好的文件到节点并执行安装:

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

注意替换命令中的tgz文件名和版本号为实际打包后的名称。

方法3:上传Chart到私有Helm仓库后部署

将本地Chart推送到你自己的私有Helm仓库,之后就可以像官方示例那样,直接通过仓库地址执行helm安装命令,无需处理本地文件同步问题。

内容的提问来源于stack exchange,提问作者Hvaandres

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 03:30:40