Skip to content

Commit 3e0fefc

Browse files
committed
Enhance LoadBalancer readiness checks for ArgoCD, Prometheus, and Grafana URLs
1 parent 875a4b3 commit 3e0fefc

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

.github/workflows/terraform.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,15 @@ jobs:
9292
- name: Get ArgoCD URL
9393
if: ${{ inputs.terraform-action == 'apply' || inputs.terraform-action == '' }}
9494
run: |
95-
echo "ArgoCD URL:"
96-
kubectl get svc argocd-server -n argocd -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
97-
echo ""
95+
echo "Waiting for ArgoCD LoadBalancer..."
96+
kubectl wait --namespace argocd \
97+
--for=condition=available svc/argocd-server \
98+
--timeout=300s
99+
100+
ARGOCD_URL=$(kubectl get svc argocd-server -n argocd \
101+
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
102+
103+
echo "ArgoCD URL: $ARGOCD_URL"
98104
echo "ArgoCD Username: admin"
99105
echo "ArgoCD Password:"
100106
kubectl -n argocd get secret argocd-initial-admin-secret \
@@ -104,17 +110,29 @@ jobs:
104110
- name: Get Prometheus URL
105111
if: ${{ inputs.terraform-action == 'apply' || inputs.terraform-action == '' }}
106112
run: |
107-
echo "Prometheus URL:"
108-
kubectl get svc kube-prometheus-stack-prometheus -n monitoring \
109-
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
113+
echo "Waiting for Prometheus LoadBalancer..."
114+
kubectl wait --namespace monitoring \
115+
--for=condition=available svc/kube-prometheus-stack-prometheus \
116+
--timeout=300s
117+
118+
PROM_URL=$(kubectl get svc kube-prometheus-stack-prometheus -n monitoring \
119+
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
120+
121+
echo "Prometheus URL: $PROM_URL"
110122
echo ""
111123
112124
- name: Get Grafana URL
113125
if: ${{ inputs.terraform-action == 'apply' || inputs.terraform-action == '' }}
114126
run: |
115-
echo "Grafana URL:"
116-
kubectl get svc kube-prometheus-stack-grafana -n monitoring \
117-
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
118-
echo ""
127+
echo "Waiting for Grafana LoadBalancer..."
128+
kubectl wait --namespace monitoring \
129+
--for=condition=available svc/kube-prometheus-stack-grafana \
130+
--timeout=300s
131+
132+
GRAFANA_URL=$(kubectl get svc kube-prometheus-stack-grafana -n monitoring \
133+
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
134+
135+
echo "Grafana URL: $GRAFANA_URL"
119136
echo "Grafana Username: admin"
120137
echo "Grafana Password: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}"
138+
echo ""

helm/values.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,4 @@ image:
88
service:
99
type: LoadBalancer
1010
port: 80
11-
targetPort: 3000
12-
13-
mongo:
14-
uri: "YOUR_URI"
15-
username: "YOUR_USERNAME"
16-
password: "YOUR_PASSWORD"
11+
targetPort: 3000

0 commit comments

Comments
 (0)