File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,30 +217,6 @@ jobs:
217217 oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} tag \
218218 ${{ env.IMAGE_NAME }}:${{ needs.push.outputs.SHORT_SHA }} ${{ env.IMAGE_NAME }}:ci-latest
219219
220- - name : Migrate MongoDB from DeploymentConfig to Deployment
221- run : |
222- echo "Checking MongoDB deployment status..."
223-
224- # Check if new Helm-managed MongoDB Deployment exists
225- if oc get deployment eagle-api-mongodb -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} &>/dev/null; then
226- echo "✓ MongoDB Deployment already exists (Helm-managed)"
227- else
228- echo "MongoDB Deployment not found - migrating from DeploymentConfig..."
229-
230- # Check if legacy DeploymentConfig exists
231- if oc get dc eagle-api-mongodb -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} &>/dev/null; then
232- echo "Scaling down legacy MongoDB DeploymentConfig to 0 replicas..."
233- oc scale dc/eagle-api-mongodb --replicas=0 -n ${{ env.OPENSHIFT_NAMESPACE_DEV }}
234-
235- echo "Waiting for MongoDB pod to terminate..."
236- oc wait --for=delete pod -l name=eagle-api-mongodb -n ${{ env.OPENSHIFT_NAMESPACE_DEV }} --timeout=120s || true
237-
238- echo "✓ Legacy DeploymentConfig scaled down - Helm will create new Deployment"
239- else
240- echo "No legacy DeploymentConfig found - proceeding with fresh Helm install"
241- fi
242- fi
243-
244220 - name : Deploy with Helm
245221 run : |
246222 helm upgrade --install ${{ env.APP_NAME }} ./helm/${{ env.APP_NAME }} \
Original file line number Diff line number Diff line change @@ -124,30 +124,6 @@ jobs:
124124 curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
125125 helm version
126126
127- - name : Migrate MongoDB from DeploymentConfig to Deployment
128- run : |
129- echo "Checking MongoDB deployment status..."
130-
131- # Check if new Helm-managed MongoDB Deployment exists
132- if oc get deployment eagle-api-mongodb -n ${{ env.OPENSHIFT_NAMESPACE_TEST }} &>/dev/null; then
133- echo "✓ MongoDB Deployment already exists (Helm-managed)"
134- else
135- echo "MongoDB Deployment not found - migrating from DeploymentConfig..."
136-
137- # Check if legacy DeploymentConfig exists
138- if oc get dc eagle-api-mongodb -n ${{ env.OPENSHIFT_NAMESPACE_TEST }} &>/dev/null; then
139- echo "Scaling down legacy MongoDB DeploymentConfig to 0 replicas..."
140- oc scale dc/eagle-api-mongodb --replicas=0 -n ${{ env.OPENSHIFT_NAMESPACE_TEST }}
141-
142- echo "Waiting for MongoDB pod to terminate..."
143- oc wait --for=delete pod -l name=eagle-api-mongodb -n ${{ env.OPENSHIFT_NAMESPACE_TEST }} --timeout=120s || true
144-
145- echo "✓ Legacy DeploymentConfig scaled down - Helm will create new Deployment"
146- else
147- echo "No legacy DeploymentConfig found - proceeding with fresh Helm install"
148- fi
149- fi
150-
151127 - name : Deploy with Helm
152128 run : |
153129 helm upgrade --install ${{ env.APP_NAME }} ./helm/${{ env.APP_NAME }} \
Original file line number Diff line number Diff line change @@ -59,3 +59,14 @@ autoscaling:
5959 minReplicas : 3
6060 maxReplicas : 6
6161 targetCPUUtilizationPercentage : 70
62+
63+ # MongoDB Configuration
64+ mongodb :
65+ enabled : true
66+ resources :
67+ requests :
68+ cpu : 100m
69+ memory : 1Gi
70+ limits :
71+ cpu : 250m
72+ memory : 2Gi
Original file line number Diff line number Diff line change @@ -151,15 +151,15 @@ mongodb:
151151 tag : " 4.4.30"
152152 pullPolicy : IfNotPresent
153153
154- # Use existing secret created by legacy DeploymentConfig
154+ # Existing secret with MongoDB credentials
155155 existingSecret : eagle-api-mongodb
156156 secretKeys :
157157 user : MONGODB_USER
158158 password : MONGODB_PASSWORD
159159 database : MONGODB_DATABASE
160160 adminPassword : MONGODB_ADMIN_PASSWORD
161161
162- # Use existing PVC to preserve data during migration
162+ # Existing PVC for MongoDB data persistence
163163 persistence :
164164 existingClaim : eagle-api-mongodb-data
165165
You can’t perform that action at this time.
0 commit comments