我正在尝试使用 helmfile 部署图表。它在本地使用相同的版本和相同的集群运行良好。
头盔文件
environments:
dev:
values:
- kubeContext: nuc
- host: urbantz-api.dev.fitfit.dk
prod:
values:
- kubeContext: nuc
- host: urbantz-api.fitfit.dk
releases:
- name: urbantz-api
namespace: urbantz-api-{{ .Environment.Name }}
chart: helm/
kubeContext: "{{ .Values.kubeContext }}"
# verify: true
values:
- image:
tag: '{{ requiredEnv "IMAGE_TAG" }}'
- ingress:
enabled: true
hosts:
- host: {{ .Values.host }}
paths:
- path: /
完整的管道可以在这里找到,但相关的命令可以在下面看到
[ "$IMAGE_TAG" == "latest" ] && ./helmfile --debug -e dev sync
管道的完整输出可以在这里找到,但相关部分可以在下面看到
...
NOTES:
1. Get the application URL by running these commands:
http://urbantz-api.dev.fitfit.dk/
helm:whTHc> WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/runner/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/runner/.kube/config
helm:whTHc> NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
urbantz-api urbantz-api-dev 4 2021-03-13 12:07:01.111013559 +0000 UTC deployed urbantz-api-0.1.0 1.16.0
getting deployed release version failed:Failed to get the version for:helm
Removed /tmp/helmfile212040489/urbantz-api-dev-urbantz-api-values-569bd76cf
Removed /tmp/helmfile850374772/urbantz-api-dev-urbantz-api-values-57897fc66b
UPDATED RELEASES:
NAME CHART VERSION
urbantz-api helm/
urbantz-api urbantz-api-dev 4 2021-03-13 12:07:01.111013559 +0000 UTC deployed urbantz-api-0.1.0 1.16.0
Error: Process completed with exit code 1.
请注意,在本地运行时,我还会收到消息“获取部署的发布版本失败:无法获取:helm 的版本”。但是退出码还是0。
更新ls
:我通过在管道末尾添加 a 使其工作。[ "$IMAGE_TAG" == "latest" ] && ./helmfile --debug -e dev sync
如果评估失败,则表达式以 1 退出。有没有人有比ls
之后上线更好的解决方案?