获取 helm 子图服务名称以引用位于父图表中的入口 Controller 的最佳方法是什么
values.yaml
---
ingress:
paths:
- serviceName: app-1
path: /app-1/*
port: 8080
- serviceName: app-2
path: /app-2/*
port: 8080
ingress.yaml
---
{{- range .Values.ingress.paths }}
- path: {{ .path }}
backend:
{{- $subchart := .serviceName -}}
serviceName: {{- include "$subchart.fullname" .}}
servicePort: {{ .port }}
{{- end }}
模板:没有与模板“gotpl”关联的模板“$subchart.fullname”
最佳答案
helm 3.7版本已解决该问题
https://github.com/helm/helm/pull/9957 .
你可以像这样使用
{{ template "bar.fullname" .Subcharts.bar }}
关于kubernetes - helm 获取子图服务名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49142353/