Helm 安装失败:configMap 无法作为 ConfigMap 处理:json:无法将 bool 解组为字符串类型的 Go 结构字段 ConfigMap.data

Jim*_*itu 16 kubernetes-helm

尝试安装 helm 但收到如下错误消息:

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
Run Code Online (Sandbox Code Playgroud)

似乎这与我生成的 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
Run Code Online (Sandbox Code Playgroud)

这有什么问题吗?

tes*_*ile 20

文档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
Run Code Online (Sandbox Code Playgroud)

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