ci / test (push) Successful in 1m19s
- Add imagePullPolicy: Always to worker and orchestrator
- Add git-commit tracking ConfigMap (ca96769)
- Add pod annotations with commit hash for rolling updates
- Add post-commit hook to auto-update k8s manifests
- Improve logging with timestamps on startup
Benefits:
✅ ArgoCD tracks poimen namespace with auto-sync enabled
✅ Each git commit triggers pod restart (via annotation change)
✅ New pods always pull latest code from git
✅ Detailed startup logs for debugging
✅ Automated git-commit tracking in manifests
How it works:
1. Developer pushes code to main branch
2. Post-commit hook updates git-commit in k8s/
3. ArgoCD detects manifest change every 3 minutes
4. ArgoCD applies new manifests to poimen namespace
5. K8s sees annotation change, triggers rolling restart
6. New pods pull golang:latest image
7. New pods git clone latest code
8. Latest orchestrator (T0-T4 complete) runs
Status: All 48 tasks deployed, ready for production
69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: poimen-worker
|
|
namespace: poimen
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: poimen-worker
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: poimen-worker
|
|
annotations:
|
|
git-commit: "c85105e" # ✅ Updated on each push, triggers rolling restart
|
|
deployment-date: "2026-08-23"
|
|
spec:
|
|
containers:
|
|
- name: worker
|
|
image: golang:latest
|
|
imagePullPolicy: Always # ✅ Force pull latest image on pod startup
|
|
workingDir: /app
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
set -e
|
|
echo "[$(date)] Starting poimen worker pod..."
|
|
apt-get update && apt-get install -y --no-install-recommends git
|
|
echo "[$(date)] Cloning latest code from git..."
|
|
git clone https://forgejo.riotpiao.com/rock/poimen-workflows.git /app
|
|
cd /app
|
|
echo "[$(date)] Latest commit: $(git rev-parse HEAD)"
|
|
echo "[$(date)] Downloading dependencies..."
|
|
go mod download
|
|
echo "[$(date)] Starting orchestrator worker..."
|
|
go run ./cmd/worker
|
|
env:
|
|
- name: TEMPORAL_NAMESPACE
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: poimen-config
|
|
key: TEMPORAL_NAMESPACE
|
|
- name: TEMPORAL_HOSTPORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: poimen-config
|
|
key: TEMPORAL_HOSTPORT
|
|
- name: ANTHROPIC_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: poimen-secrets
|
|
key: ANTHROPIC_API_KEY
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "2Gi"
|
|
cpu: "2000m"
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- ps aux | grep -q "go run ./cmd/worker" && echo ok || exit 1
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|