Skip to content

Commit 65ee5fc

Browse files
committed
Another fix to try deployment
1 parent 1601c9c commit 65ee5fc

File tree

2 files changed

+38
-42
lines changed

2 files changed

+38
-42
lines changed

.github/workflows/deploy-azure.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ env:
1313
ENVIRONMENT: dev
1414
AZURE_RESOURCE_GROUP: GitHub
1515
AZURE_LOCATION: germanywestcentral
16-
MEMGRAPH_URI_TEMPLATE: memgraph-aiagent-{env}.{location}.cloudapp.azure.com
1716

1817
jobs:
1918
deploy-infrastructure:
@@ -170,32 +169,32 @@ jobs:
170169
171170
echo "Memgraph deployment successful!"
172171
173-
# Wait for the LoadBalancer service to get an external IP
174-
echo "Waiting for LoadBalancer to get external IP..."
172+
echo "Waiting for LoadBalancer to expose an address..."
175173
for i in {1..45}; do
176174
EXTERNAL_IP=$(kubectl get service memgraph -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
177-
if [[ -n "$EXTERNAL_IP" ]]; then
178-
echo "Memgraph is accessible at: ${EXTERNAL_IP}:7687"
179-
180-
# Add a simple connectivity check
175+
DNS_NAME=$(kubectl get service memgraph -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
176+
if [[ -n "$EXTERNAL_IP" || -n "$DNS_NAME" ]]; then
177+
HOST=${EXTERNAL_IP:-$DNS_NAME}
178+
echo "Memgraph is accessible at: ${HOST}:7687"
179+
# make host usable by subsequent steps
180+
echo "MEMGRAPH_URI=${HOST}" >> $GITHUB_ENV
181181
echo "Performing basic connectivity test..."
182-
if nc -z -w 5 ${EXTERNAL_IP} 7687; then
182+
if nc -z -w 5 ${HOST} 7687; then
183183
echo "Successfully connected to Memgraph on port 7687!"
184184
else
185185
echo "Warning: Could not connect to Memgraph on port 7687. The service may not be fully ready yet."
186186
fi
187187
break
188188
fi
189-
echo "Waiting for external IP (attempt $i)..."
189+
echo "Waiting for address (attempt $i)..."
190190
sleep 10
191191
done
192192
193-
if [[ -z "$EXTERNAL_IP" ]]; then
194-
echo "Warning: Could not obtain external IP for Memgraph service within timeout."
195-
echo "Checking LoadBalancer service status:"
193+
if [[ -z "$EXTERNAL_IP" && -z "$DNS_NAME" ]]; then
194+
echo "Warning: LoadBalancer address not available within timeout."
196195
kubectl describe service memgraph
197196
else
198-
MEMGRAPH_HOST="memgraph-aiagent-${{ env.ENVIRONMENT }}.${{ env.AZURE_LOCATION }}.cloudapp.azure.com"
197+
MEMGRAPH_HOST=${EXTERNAL_IP:-$DNS_NAME}
199198
echo "=========================================================="
200199
echo "Memgraph Connection Information:"
201200
echo "Host: $MEMGRAPH_HOST"

infra/k8s/memgraph.yaml

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spec:
5252
- containerPort: 7444 # HTTP API
5353
- containerPort: 3000 # MemGraph Lab UI
5454
env:
55-
- name: MEMGRAPH_USER
55+
- name: MEMGRAPH_USERNAME # aligns with test script
5656
valueFrom:
5757
secretKeyRef:
5858
name: memgraph-credentials
@@ -62,45 +62,53 @@ spec:
6262
secretKeyRef:
6363
name: memgraph-credentials
6464
key: password
65+
- name: MG_USERNAME # Memgraph native vars
66+
valueFrom:
67+
secretKeyRef:
68+
name: memgraph-credentials
69+
key: username
70+
- name: MG_PASSWORD
71+
valueFrom:
72+
secretKeyRef:
73+
name: memgraph-credentials
74+
key: password
75+
envFrom: # auto-load future config vars
76+
- configMapRef:
77+
name: memgraph-config
6578
volumeMounts:
6679
- name: data
6780
mountPath: /data
6881
- name: logs
6982
mountPath: /var/log/memgraph
70-
- name: config
71-
mountPath: /etc/memgraph
7283
resources:
7384
requests:
7485
memory: "1Gi"
7586
cpu: "500m"
7687
limits:
7788
memory: "2Gi"
7889
cpu: "1000m"
79-
livenessProbe:
80-
httpGet:
81-
path: /api/v1/storage/status
82-
port: 7444
83-
initialDelaySeconds: 60
84-
periodSeconds: 30
85-
timeoutSeconds: 10
86-
failureThreshold: 3
87-
readinessProbe:
88-
httpGet:
89-
path: /api/v1/storage/status
90-
port: 7444
90+
livenessProbe: # simpler, always available
91+
tcpSocket:
92+
port: 7687
9193
initialDelaySeconds: 30
9294
periodSeconds: 15
9395
timeoutSeconds: 5
96+
readinessProbe:
97+
tcpSocket:
98+
port: 7687
99+
initialDelaySeconds: 10
100+
periodSeconds: 10
101+
timeoutSeconds: 3
94102
volumes:
95103
- name: data
96104
persistentVolumeClaim:
97105
claimName: memgraph-data
98106
- name: logs
99107
persistentVolumeClaim:
100108
claimName: memgraph-logs
101-
- name: config
102-
persistentVolumeClaim:
103-
claimName: memgraph-config
109+
- name: config # mount ConfigMap instead of PVC
110+
configMap:
111+
name: memgraph-config
104112
---
105113
apiVersion: v1
106114
kind: PersistentVolumeClaim
@@ -125,17 +133,6 @@ spec:
125133
storage: 5Gi
126134
---
127135
apiVersion: v1
128-
kind: PersistentVolumeClaim
129-
metadata:
130-
name: memgraph-config
131-
spec:
132-
accessModes:
133-
- ReadWriteOnce
134-
resources:
135-
requests:
136-
storage: 1Gi
137-
---
138-
apiVersion: v1
139136
kind: Service
140137
metadata:
141138
name: memgraph

0 commit comments

Comments
 (0)