【问题标题】:Helm Installation Failed: configMap cannot be handled as a ConfigMap: json: cannot unmarshal bool into Go struct field ConfigMap.data of type stringHelm 安装失败:configMap 无法作为 ConfigMap 处理:json:无法将 bool 解组为字符串类型的 Go struct 字段 ConfigMap.data
【发布时间】:2022-09-29 17:52:34
【问题描述】:

尝试进行 helm install 但我收到如下错误消息:

install.go:178: [debug] Original chart version: \"\"
install.go:195: [debug] CHART PATH: /Users/lkkto/Dev/pipelines/manifests/helm/helm-pipeline/charts/base/charts/installs/charts/multi-user/charts/api-service
client.go:128: [debug] creating 4 resource(s)
Error: INSTALLATION FAILED: ConfigMap in version \"v1\" cannot be handled as a ConfigMap: json: cannot unmarshal bool into Go struct field ConfigMap.data of type string
helm.go:84: [debug] ConfigMap in version \"v1\" cannot be handled as a ConfigMap: json: cannot unmarshal bool into Go struct field ConfigMap.data of type string
INSTALLATION FAILED
main.newInstallCmd.func2
    helm.sh/helm/v3/cmd/helm/install.go:127
github.com/spf13/cobra.(*Command).execute
    github.com/spf13/cobra@v1.3.0/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
    github.com/spf13/cobra@v1.3.0/command.go:974
github.com/spf13/cobra.(*Command).Execute
    github.com/spf13/cobra@v1.3.0/command.go:902
main.main
    helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
    runtime/proc.go:250
runtime.goexit
    runtime/asm_amd64.s:1571

似乎它与我生成的配置图有关:

apiVersion: v1
data:
  DEFAULTPIPELINERUNNERSERVICEACCOUNT: default-editor
  MULTIUSER: true
  VISUALIZATIONSERVICE_NAME: ml-pipeline-visualizationserver
  VISUALIZATIONSERVICE_PORT: 8888
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: kubeflow-pipelines
    app.kubernetes.io/component: ml-pipeline
    application-crd-id: kubeflow-pipelines
  name: pipeline-api-server-config-f4t72426kt
  namespace: kubeflow

有什么问题吗?

  • 您可以尝试用双引号将data: 下的键值括起来吗?如MULTIUSER: \"true\"

标签: kubernetes-helm


【解决方案1】:

来自docs ConfigMap.data 是string:string 映射。在您的示例中,您将 MULTIUSER 设置为布尔值。

将您的 ConfigMap 更新为:

apiVersion: v1
data:
  DEFAULTPIPELINERUNNERSERVICEACCOUNT: default-editor
  MULTIUSER: 'true'
  VISUALIZATIONSERVICE_NAME: ml-pipeline-visualizationserver
  VISUALIZATIONSERVICE_PORT: 8888
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: kubeflow-pipelines
    app.kubernetes.io/component: ml-pipeline
    application-crd-id: kubeflow-pipelines
  name: pipeline-api-server-config-f4t72426kt
  namespace: kubeflow

注意'true' 对应MULTIUSER。这明确地将其设置为字符串。

【讨论】:

  • 谢谢,就是这个问题。如果我将其设置为“true”,则可以部署它。
【解决方案2】:

只是为了支持更多这一点。设置入口控制器时遇到此问题。

我最初的配置是这样的:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: prometheus-kube-prometheus-prometheus
  namespace: monitoring
  labels:
    app: kube-prometheus-stack-prometheus
    heritage: Helm
    release: prometheus
    self-monitor: true

问题在于 self-monitor: true,Helm 无法将其编组为字符串,因为它是布尔值。它应该用这样的引号括起来 - self-monitor: "true",所以我们之后会有这个:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: prometheus-kube-prometheus-prometheus
  namespace: monitoring
  labels:
    app: kube-prometheus-stack-prometheus
    heritage: Helm
    release: prometheus
    self-monitor: "true"

【讨论】:

    猜你喜欢
    • 2023-03-28
    • 2022-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-04
    • 2018-08-19
    • 2021-03-05
    • 1970-01-01
    相关资源
    最近更新 更多