Argocd自定义健康检查
概述
NAME CLASS HOSTS ADDRESS PORTS AGE
prod-blockscout geth-nginx x.x.x 80, 443 8h
prod-browser-node-geth-wss-ingress geth-nginx x.x.x 80, 443 14dingress 中添加注解
...
annotations:
argocd-ignore-health-check: "true"
...修改 argocd-cm 增加自定义健康检查
kubectl -n argo-cd edit cm argocd-cmdata:
...
resource.customizations.health.networking.k8s.io_Ingress: |
hs = {}
if obj.metadata.annotations ~= nil then
for k,v in pairs(obj.metadata.annotations) do
if k == "argocd-ignore-health-check" then
hs.status = "Healthy"
hs.message = "Ingress ignore health check"
return hs
end
end
end
if obj.status ~= nil then
if obj.status.loadBalancer ~= nil then
if obj.status.loadBalancer.ingress ~= nil then
hs.status = "Healthy"
hs.message = "Ingress healthy"
return hs
end
end
end
hs.status = "Progressing"
hs.message = "Waiting for ingerss"
return hs
resource.customizations.useOpenLibs.networking.k8s.io_Ingress: "true"参考
Last updated