在 ArgoCD 中,可以使用 argoproj.io/compare-options: ignore-missing-annotations=false
注释来解决该问题。这将指示 ArgoCD 包括未在 CRD 中描述的字段。
示例:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp
spec:
source:
repoURL: https://github.com/org/repo.git
path: ./
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: default
project: myapp
syncPolicy:
automated:
prune: true
selfHeal: true
# 添加要忽略的注释,将 ignore-missing-annotations 设置为 false
# 这将允许 ArgoCD 向 CRD 中添加未描述的字段
annotations:
argo-cd.argoproj.io/sync-options: Validate=false
argoproj.io/compare-options: ignore-missing-annotations=false