chore(k8s): update kub-deploy workflow and frontoffice deployment configuration
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 10m11s

- Modified the kub-deploy.yml to remove cached images using containerd's ctr command, ensuring that both IfNotPresent and Always image pull policies work correctly.
- Updated frontoffice-deployment.yaml to set imagePullPolicy to Always, preventing stale node cache issues with the :latest tag.

These changes improve the deployment process and ensure that the latest images are always used in the staging environment.
This commit is contained in:
masoodafar-web
2026-10-03 23:53:02 +03:30
parent d7f25efce2
commit 392e038913
2 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -74,7 +74,11 @@ jobs:
# Apply manifests and restart
sshpass -e ssh -o StrictHostKeyChecking=no root@${{ env.K8S_SERVER }} "
kubectl apply -n kbs-stage -f /tmp/frontoffice-deployment.yaml &&
crictl rmi ${REGISTRY}/${IMAGE_NAME}:latest 2>/dev/null || true &&
# Drop cached :latest so IfNotPresent/Always both pick the new digest
# (crictl is broken on this host — use containerd ctr)
ctr -n k8s.io images ls -q | grep -E 'frontoffice(:latest|@)' | while read -r ref; do
ctr -n k8s.io images rm \"\$ref\" 2>/dev/null || true
done
kubectl -n kbs-stage rollout restart deployment/frontoffice &&
kubectl -n kbs-stage rollout status deployment/frontoffice --timeout=180s &&
rm -f /tmp/frontoffice-deployment.yaml
+2 -1
View File
@@ -21,7 +21,8 @@ spec:
containers:
- name: frontoffice
image: 185.252.31.44:30080/admin/frontoffice:latest
imagePullPolicy: IfNotPresent
# Staging uses :latest — Always avoids stale node cache after registry retag
imagePullPolicy: Always
ports:
- containerPort: 80
name: http