kubernetes - Helmfile 如何将现有资源更改为另一个图表
问题描述
我想将sw-api图表模板中的官方网站这个图表移动到独立图表,并将文件移出sw-api的模板然后使用helmfile apply,给我这个错误。
这是我的错误代码
Error: Failed to render chart: exit status 1:
Error: rendered manifests contain a resource that already exists.
Unable to continue with install: ConfigMap "official-web-config" in namespace "develop" exists and cannot be imported into the current release: invalid ownership metadata;
annotation validation error: key "meta.helm.sh/release-name" must equal "official-web": current value is "sw-api"
解决方案
现在这是我的 helm 文件夹
── sw-api
│ ├── Chart.yaml
│ ├── templates
│ │ ├── micros-worker
│ │ │ ├── configMap.yaml
│ │ │ ├── deployment.yaml
│ │ │ └── hpa.yaml
│ │ └── official-web
│ │ ├── certificate.yaml
│ │ ├── configMap.yaml
│ │ ├── deployment.yaml
│ │ ├── hpa.yaml
│ │ ├── ingress.yaml
│ │ ├── ip.yaml
│ │ └── svc.yaml
│ ├── values-dev.yaml
├── sw-api-values.yaml.gotmpl
── swagger
│ ├── Chart.yaml
│ ├── templates
│ │ ├── _helpers.tpl
│ │ ├── deployment.yaml
│ │ └── svc.yaml
│ ├── values-dev.yaml
我变成这样
── official-web
│ ├── Chart.yaml
│ ├── templates
│ │ ├── _helpers.tpl
│ │ ├── certificate.yaml
│ │ ├── configMap.yaml
│ │ ├── deployment.yaml
│ │ ├── hpa.yaml
│ │ ├── ingress.yaml
│ │ ├── ip.yaml
│ │ └── svc.yaml
│ ├── values-dev.yaml
├── official-web-values.yaml.gotmpl
├── sw-api
│ ├── Chart.yaml
│ │ └── micros-worker
│ │ ├── configMap.yaml
│ │ ├── deployment.yaml
│ │ └── hpa.yaml
│ ├── values-dev.yaml
│ └── values-test.yaml
├── sw-api-values.yaml.gotmpl
并执行 helmfile apply 命令(在命名空间“develop”中):
helmfile -f helmfile.yaml --log-level=debug --debug -e dev apply
此错误显示在 hemlfile 应用之前
Error: Failed to render chart: exit status 1:
Error: rendered manifests contain a resource that already exists.
Unable to continue with install: ConfigMap "official-web-config" in namespace "develop" exists and cannot be imported into the current release: invalid ownership metadata;
annotation validation error: key "meta.helm.sh/release-name" must equal "official-web": current value is "sw-api"
推荐阅读
- testing - 如何在 Flutter 小部件中测试回调函数
- javascript - 在收到来自单个工作人员的消息后发送所有工作人员消息
- arrays - 检查列是否在列数组中
- php - 如何通过 Ajax 将数据从 HTML 传递到 PHP 文件?
- python - 使用 SWIG 包装共享指针对象不授予对类成员函数的访问权限
- javascript - 创建留在 DOM 中的文档片段
- amazon-web-services - 如何使用来自 CW 代理的指标自动更新 cloudwatch 仪表板?
- amazon-web-services - 在使用 grapesjs 创建的模板中通过 Amazon SES 发送图像时不显示
- python - Not able to scrape data which is not visible on screen but is part of the slider/carousel
- java - 声明 List 并将其分配给 LinkedList 或 ArrayList 时,是否仍然保留了不同的性能优势?