这个问题,其实需要分版本做不同的处理,是通过ArgoCD健康检查的自定义的资源检查来排除对Ingress的检查。

具体解决步骤如下:

kubectl edit cm -n argocd argocd-cm

集群v1.20.0及以上添加:

data:
  resource.customizations: |
    networking.k8s.io/Ingress:
        health.lua: |
          hs = {}
          hs.status = "Healthy"
          return hs
  resource.customizations.useOpenLibs.extensions_Ingress: "true"

集群v1.20.0以下添加:

data:
  resource.customizations.health.extensions_Ingress: |
    hs = {}
    hs.status = "Healthy"
    hs.message = "SoulChild"
    return hs
  resource.customizations.useOpenLibs.extensions_Ingress: "true"

最后删除argo应用控制器;并重新同步应用

kubectl delete pod -n argocd argocd-application-controller-0
sleep 10
argocd app sync <Your APP> --force

更多参考这三篇文章:

https://argo-cd.readthedocs.io/en/stable/operator-manual/health/#ingress
https://github.com/argoproj/argo-cd/issues/1704
https://argoproj.github.io/argo-cd/operator-manual/health/#custom-health-checks

Last modification:October 16, 2023
如果觉得我的文章对你有用,请随意赞赏