简体   繁体   English

如何通过 REST-API 更新 ARGO-CD 参数?

[英]Howto update an ARGO-CD parameter via REST-API?

I found the swagger-ui.我找到了swagger-ui。 But the only functionality I can imagine to do this job (I found) was the application patch method (swagger-ui#operation/Patch).但我能想到的唯一功能(我发现)是应用程序补丁方法(swagger-ui#operation/Patch)。 But I find no explenation how to do it.但我找不到如何做到这一点。

The explenation I found is for the cli tool of argocd ( https://argoproj.github.io/argo-cd/user-guide/parameters/ ) which does not really help me.我发现的解释是针对 argocd 的 cli 工具( https://argoproj.github.io/argo-cd/user-guide/parameters/ ),这对我没有帮助。

Any idea?任何想法?

The whole point of adopting GitOps is to use Git as a single source of truth.If you want to change your application with ArgoCD you are expected to commit your change to the Git repository watched by ArgoCD.采用 GitOps 的全部意义在于使用 Git 作为单一事实来源。如果您想使用 ArgoCD 更改应用程序,您需要将更改提交到 ArgoCD 监视的 Git 存储库。

Changing manually values via REST APIs is against GitOps.通过 REST API 手动更改值是违反 GitOps 的。

Kazanki's answer does not address the question. Kazanki 的回答没有解决这个问题。 While I agree that it may be an "anti-pattern", there are still times when this is desirable.虽然我同意这可能是一种“反模式”,但仍有一些时候这是可取的。 For example, not wanting to maintain multiple sets of helm charts that would be identical other than for a single value (in my case, the ingress hostname).例如,不想维护除了单个值(在我的例子中是入口主机名)之外相同的多组掌舵图。

This update can be done using argocd cli.可以使用 argocd cli 完成此更新。 Example: argocd app set -p ingress.hostname=示例:argocd app set -p ingress.hostname=

I've yet to find out how to do this with REST but would very much like to know as well.我还没有弄清楚如何用 REST 做到这一点,但也非常想知道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM