Skip to content

Commit 7bb08d4

Browse files
authored
feat: add script to verify Argo CD service labels for auto-detection (#423)
1 parent 35ec9e8 commit 7bb08d4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Check if NAMESPACE is set
4+
if [ -z "$NAMESPACE" ]; then
5+
echo "❌ ERROR: NAMESPACE environment variable is not set."
6+
echo "Please set the NAMESPACE environment variable and try again."
7+
echo "Example: NAMESPACE=argocd ./verify-argocd-auto-detection.sh"
8+
exit 1
9+
fi
10+
11+
echo "Checking Argo CD service labels in namespace '$NAMESPACE'..."
12+
S=$(kubectl get svc -n "$NAMESPACE" -l app.kubernetes.io/component=server,app.kubernetes.io/part-of=argocd -o name 2>/dev/null)
13+
R=$(kubectl get svc -n "$NAMESPACE" -l app.kubernetes.io/component=repo-server,app.kubernetes.io/part-of=argocd -o name 2>/dev/null)
14+
D=$(kubectl get svc -n "$NAMESPACE" -l app.kubernetes.io/component=redis,app.kubernetes.io/part-of=argocd -o name 2>/dev/null)
15+
[ -z "$S" ] && echo "❌ Server: NOT FOUND" || echo "✅ Server: Found"
16+
[ -z "$R" ] && echo "❌ Repo: NOT FOUND" || echo "✅ Repo: Found"
17+
[ -z "$D" ] && echo "❌ Redis: NOT FOUND" || echo "✅ Redis: Found"
18+
if [ -n "$S" ] && [ -n "$R" ] && [ -n "$D" ]; then
19+
echo "✅ SUCCESS: All Argo CD services have proper labels for auto-detection."
20+
else
21+
echo "❌ ISSUE: Missing services in namespace '$NAMESPACE'. Required labels:"
22+
echo "- Server: app.kubernetes.io/component=server,app.kubernetes.io/part-of=argocd"
23+
echo "- Repo: app.kubernetes.io/component=repo-server,app.kubernetes.io/part-of=argocd"
24+
echo "- Redis: app.kubernetes.io/component=redis,app.kubernetes.io/part-of=argocd"
25+
fi

0 commit comments

Comments
 (0)