无法安装 helm 图表,但当我使用 helm 生成的原始文件时,我可以通过 kubectl apply 安装。
当我使用时显示以下错误helm install myChart . --debug
Error: cannot re-use a name that is still in use
helm.go:88: [debug] cannot re-use a name that is still in use
helm.sh/helm/v3/pkg/action.(*Install).availableName
helm.sh/helm/v3/pkg/action/install.go:442
helm.sh/helm/v3/pkg/action.(*Install).Run
helm.sh/helm/v3/pkg/action/install.go:185
main.runInstall
helm.sh/helm/v3/cmd/helm/install.go:242
main.newInstallCmd.func2
helm.sh/helm/v3/cmd/helm/install.go:120
github.com/spf13/cobra.(*Command).execute
github.com/spf13/cobra@v1.1.3/command.go:852
github.com/spf13/cobra.(*Command).ExecuteC
github.com/spf13/cobra@v1.1.3/command.go:960
github.com/spf13/cobra.(*Command).Execute
github.com/spf13/cobra@v1.1.3/command.go:897
main.main
helm.sh/helm/v3/cmd/helm/helm.go:87
runtime.main
runtime/proc.go:225
runtime.goexit
runtime/asm_amd64.s:1371
Run Code Online (Sandbox Code Playgroud)
使用以下命令安装 helm 生成的原始文件效果很好,但当我运行时helm install myChart .会出现上述错误
helm install myChart . --dry-run > myChart.yaml
kubectl apply -f myChart.yaml
Run Code Online (Sandbox Code Playgroud) 我尝试使用卸载 AKS 集群中的 helm 版本,helm uninstall RELEASE_NAME但似乎失败了。发生故障的原因是,由于某种原因,当我使用 时,集群中的所有节点都处于未就绪状态helm uninstall。
从那时起,我让所有节点都恢复并运行,并且集群正常运行。现在,当我尝试时helm list,我不会再看到此版本,但执行 ahelm list -a会显示该版本的状态仍处于uninstalling状态。我已经尝试了很多方法,但在过去的 3-4 天里它一直卡在那里。
我尝试过使用helm uninstall RELEASE_NAME,helm delete --purge RELEASE_NAME但这些命令会抛出错误,因为版本已经处于uninstalling状态。我尝试修改此特定版本的集群中的 Helm Secret,但这也没有帮助。Helm3正在使用,所以我不能重新启动舵柄吊舱来稳定这个问题。
是否Helm3使用某种可以修改的终结器机制来纠正此问题,或者是否没有其他方法可以尝试删除此版本?我希望将来也对特定 API 使用相同的版本名称。
任何帮助将不胜感激。
我想使用 k8s、nginx 入口控制器、helm 图表为我的项目设置通配符子域:
在ingress.yaml文件中:
...
rules:
- host: {{ .Values.ingress.host }}
...
Run Code Online (Sandbox Code Playgroud)
在values.yaml文件中,我将主机更改example.local为*.example.local:
...
ingress:
enabled: true
host: "*.example.local"
...
Run Code Online (Sandbox Code Playgroud)
然后,当我使用 helm Chart 安装图表时:
Error: YAML parse error on example/templates/ingress.yaml: error converting YAML to JSON: yaml: line 15: did not find expected alphabetic or numeric character
Run Code Online (Sandbox Code Playgroud)
我该如何修复它?
感谢您的支持。
现在,我必须在不同的命名空间中安装多个 Helm Chart 才能使我的产品正常工作。我正在尝试创建一个超级舵图,我计划在其中添加舵图(我的工具,如上所述)并一次性安装它们。我的问题是,由于这些工具位于不同的命名空间中,我不确定在哪里指定我想要安装特定依赖项(图表)的命名空间键。例如,如果下面是我的超级舵图的 Charts.yaml
dependencies:
- name: first_chart
version: 1.2.3
repository: https://firstchart.repo
- name: second_chart
version: 1.5.6
repository: https://secondchart.repo
Run Code Online (Sandbox Code Playgroud)
我希望我的第一个图表安装在命名空间 foo 中,第二个图表安装在命名空间 bar 中。
我正在考虑使用条件,但我相信条件只会将布尔值作为值。
我偶然发现了这个链接(https://github.com/helm/helm/issues/2060),它说我们可以在 Helm 3 中做到这一点,但主要是关于如何在不同命名空间之间保持发布。它没有具体回答我的问题。
我使用依赖项的第三方图表允许从值文件传入额外的注释。然而我想传递的注释是checksum/config
值.yaml
mychart:
annotations:
checksum/config: "{{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}"
Run Code Online (Sandbox Code Playgroud)
但从值文件传递的任何内容都会呈现为字符串。有没有一种有效的方法可以从values.yaml传递checksum/config ?
我有一个关于.Capability.APIVersions.Has 的问题 - 我不确定它是如何工作的我有以下功能:
{{- define "fybrik.certManagerApiVersion" -}}
{{- if .Capabilities.APIVersions.Has "cert-manager.io/v1beta1" -}}
cert-manager.io/v1beta1
{{- else if .Capabilities.APIVersions.Has "cert-manager.io/v1alpha2" -}}
cert-manager.io/v1alpha2
{{- else if .Capabilities.APIVersions.Has "certmanager.k8s.io/v1alpha1" -}}
certmanager.k8s.io/v1alpha1
{{- else -}}
cert-manager.io/v1
{{- end -}}
Run Code Online (Sandbox Code Playgroud)
kubectl api-versions 显示:
cert-manager.io/v1
cert-manager.io/v1alpha2
cert-manager.io/v1alpha3
cert-manager.io/v1beta1
Run Code Online (Sandbox Code Playgroud)
但当使用 helm install 命令生成资源时,我总是将 cert-manager.io/v1 作为 api。我希望 api 是 cert-manager.io/v1beta1,我想知道缺少什么?谢谢
基本上,我已经使用提供的 Helm Chart 存储库prometheus-community从kube-prometheus-stack安装了 Prometheus-Grafana
# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
# helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack
Run Code Online (Sandbox Code Playgroud)
他们工作得很好。
但我现在面临的问题是将Thanos与现有的kube-prometheus-stack集成。
我从Bitnami Helm Chart 仓库安装了 Thanos
# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm install thanos bitnami/thanos
Run Code Online (Sandbox Code Playgroud)
我可以加载 Thanos 查询前端 GUI,但那里没有显示任何指标。
我现在正在努力让它正常工作。是因为来自完全不同的 Helm Chart 的 Thanos 和来自另一个 Helm Chart 的 Prometheus-operator-grafana 堆栈吗?
我在 AWS 上的 Kubernetes 集群是使用 Kops 创建的。而且,我使用 Gitlab pipeline 和 helm 将应用程序部署到集群。
我们正在寻找一种在管道中设置 Chart.AppVersion 的方法,以便“helm 历史记录”返回正确的应用程序版本。
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
1 Mon Jun 8 11:39:51 2020 superseded spring-1.0.0 1.0.0 Install complete
2 Mon Jun 8 12:19:21 2020 superseded spring-1.0.0 1.0.0 Upgrade complete
3 Mon Jun 8 12:20:51 2020 deployed spring-1.0.0 1.0.0 Upgrade complete
Run Code Online (Sandbox Code Playgroud)
目前,helm“history”返回与上述类似的结果(从此处借用:https: //github.com/helm/helm/issues/8194#issuecomment-640598047),而不是实际的应用程序版本。
helm upgrade --app-version "$variable
Run Code Online (Sandbox Code Playgroud)
通过这样的命令,我们希望达到如下结果。
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
1 Mon Jun 8 11:39:51 2020 superseded spring-1.0.0 1.0.1 Install complete
2 Mon Jun 8 12:19:21 2020 superseded spring-1.0.0 1.0.2 Upgrade …Run Code Online (Sandbox Code Playgroud) 有人可以帮忙吗?我试图在配置映射上注入舵值,但它破坏了格式。如果我直接使用该值而不是 .Values,它可以正常工作。
我拥有的:
data:
application.instanceLabelKey: argocd.argoproj.io/instance
oidc.config: |
name: Okta
issuer: https://mycompany.okta.com
clientID: {{ .Values.okta.clientID }}
clientSecret: {{ .Values.okta.clientSecret }}
requestedScopes: ["openid", "profile", "email", "groups"]
requestedIDTokenClaims: {"groups": {"essential": true}}
Run Code Online (Sandbox Code Playgroud)
结果
data:
application.instanceLabelKey: argocd.argoproj.io/instance
oidc.config: "name: Okta\nissuer: https://mycompany.okta.com\nclientID: myClientId \nclientSecret:
mySecret\nrequestedScopes: [\"openid\", \"profile\",
\"email\", \"groups\"]\nrequestedIDTokenClaims: {\"groups\": {\"essential\": true}}\n"
Run Code Online (Sandbox Code Playgroud) 我有如下的 k8s 清单,用 Helm 打包。
apiVersion: v1
kind: ServiceAccount
metadata:
{{- template "myFunction" "blah" -}}
Run Code Online (Sandbox Code Playgroud)
我将_helper.tplmyFunction 定义如下。
{{- define "myFunction" }}
{{- if .Values.nameOverride }}
name: {{ . }}
{{- else }}
name: "test"
{{- end }}
{{- end }}
Run Code Online (Sandbox Code Playgroud)
最后,我values.yaml定义了nameOverride: "". 根据我的理解,由于我没有为 nameOverride 定义任何内容,因此myFunction应该输出name: "test",当我为 nameOverride 定义某些内容时,输出应该为name: "blah"。但是,我收到以下错误。
Error: template: product-search/templates/_helpers.tpl:2:16: executing "myFunction" at <.Values.nameOverride>: can't evaluate field Values in type string
helm.go:88: [debug] template: product-search/templates/_helpers.tpl:2:16: executing …Run Code Online (Sandbox Code Playgroud)