Loading...
Loading...
This skill should be used when users need to sync/promote configuration from staging (aws-staging) to production (aws-prod) environment. It handles image tag synchronization, identifies configuration differences, and manages the promotion workflow. Triggers on requests mentioning "sync to prod", "promote to production", "update prod images", or comparing staging vs production.
npx skill4agent add oldwinter/skills sync-to-prod# View pending changes (safe, read-only)
argocd app get simplex-aws-prod
argocd app diff simplex-aws-prod
# Manual sync (ONLY when user explicitly requests)
argocd app sync simplex-aws-prodargocd app sync simplex-aws-prodkubernetes/overlays/aws-staging/kustomization.yaml # Staging config
kubernetes/overlays/aws-prod/kustomization.yaml # Production config# Using the sync script
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --diff
# Or using make target (if in kubernetes/ directory)
make compare-images# Sync specific services
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --images front,anotherme-agent
# Sync all images (dry-run first)
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --all --dry-run
# Sync all images (apply changes)
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --allpython3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --diff# Promote a single critical service
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --images front --dry-run
# Promote frontend services
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --images front,front-homepage --dry-run
# Promote all AI services
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --images anotherme-agent,anotherme-api,anotherme-search,anotherme-worker --dry-run
# Promote everything
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --all --dry-runpython3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --images <services>cd /path/to/simplex-gitops
git add kubernetes/overlays/aws-prod/kustomization.yaml
git commit -m "chore: promote <services> to production"
git push# 查看待同步的变更
argocd app get simplex-aws-prod
argocd app diff simplex-aws-prod
# 用户确认后手动同步
argocd app sync simplex-aws-prodsimplex-aws-prodimages:patches/| Patch File | Purpose | Sync Consideration |
|---|---|---|
| API config | Usually environment-specific, don't sync |
| Gateway config | Usually environment-specific |
| Agent config | May need selective sync |
| Agent secrets | Never sync, environment-specific |
| Search config | May need selective sync |
| Cron config | Usually environment-specific |
| Router config | Usually environment-specific |
| Frontend env vars | Usually environment-specific |
| Ingress rules | Never sync, different domains |
karpenter.sh/nodepool: stagingsingleton-stagingkarpenter.sh/nodepool: productionsingleton-productiongp3ebs-gp3-autotopologySpreadConstraintsterminationGracePeriodSeconds: 60# Compare
diff kubernetes/overlays/aws-staging/patches/anotherme-agent-env-configmap.yaml \
kubernetes/overlays/aws-prod/patches/anotherme-agent-env-configmap.yaml
# Copy if needed (carefully review first!)
cp kubernetes/overlays/aws-staging/patches/anotherme-agent-env-configmap.yaml \
kubernetes/overlays/aws-prod/patches/anotherme-agent-env-configmap.yamlresources:kustomization.yaml# 查看应用状态和待同步变更
argocd app get simplex-aws-prod
argocd app diff simplex-aws-prod# ⛔ 仅在用户明确要求时执行
argocd app sync simplex-aws-prod# Production namespace
k1 get pods -n production -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}'
# Staging namespace
k2 get pods -n staging -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}'kubectl kustomize kubernetes/overlays/aws-prod > /tmp/prod-manifests.yaml
kubectl kustomize kubernetes/overlays/aws-staging > /tmp/staging-manifests.yaml
diff /tmp/staging-manifests.yaml /tmp/prod-manifests.yamlcd /path/to/simplex-gitops
python3 ~/.claude/skills/sync-to-prod/scripts/sync_images.py --diff# 查看应用状态(只读)
argocd app get simplex-aws-prod --show-operation
# 刷新应用检测最新变更(只读,安全)
argocd app refresh simplex-aws-prod
# ⛔ 手动同步 - 仅在用户明确要求时执行
argocd app sync simplex-aws-prod| Category | Services |
|---|---|
| AI Core | |
| Frontend | |
| Backend | |
| Data | |
| Infrastructure | |