AGENT SKILL

argocd-gitops

暂无简介

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 13
Forks
2

03 SKILL.md 正文

/argocd-gitops

When to Use

  • Git repo = single source of truth for cluster state; any manual change is auto-reverted
  • Continuous delivery: merge to main → Argo CD syncs cluster automatically
  • Drift detection: alert/auto-fix when someone kubectl-edits a resource directly
  • App-of-Apps: one root Application manages 50+ sub-applications declaratively

Do NOT use for

  • Non-Kubernetes deployments
  • Secrets management (combine with External Secrets Operator or Sealed Secrets)

Application manifest

# application.yaml — deploy yamtam-agent from Helm chart in Git
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name:      yamtam-prod
  namespace: argocd
spec:
  project: default

  source:
    repoURL:        https://github.com/org/yamtam-config
    targetRevision: main
    path:           charts/yamtam-agent
    helm:
      valueFiles:
        - values-prod.yaml
      parameters:
        - name:  image.tag
          value: "1.3.52"

  destination:
    server:    https://kubernetes.default.svc
    namespace: yamtam

  syncPolicy:
    automated:
      prune:    true       # delete resources removed from Git
      selfHeal: true       # auto-revert manual kubectl changes
    syncOptions:
      - CreateNamespace=true
      - PrunePropagationPolicy=foreground
      - ApplyOutOfSyncOnly=true
    retry:
      limit: 3
      backoff: { duration: 5s, factor: 2, maxDuration: 3m }

App-of-Apps pattern

# root-app.yaml — manages all sub-applications
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: root
  namespace: argocd
spec:
  source:
    repoURL:        https://github.com/org/yamtam-config
    targetRevision: main
    path:           apps/          # directory with Application yamls
  destination:
    server:    https://kubernetes.default.svc
    namespace: argocd
  syncPolicy:
    automated: { prune: true, selfHeal: true }

Sync via Argo CD CLI

# Manual sync (force re-apply)
argocd app sync yamtam-prod

# Wait for sync to complete
argocd app wait yamtam-prod --timeout 120

# Check sync status
argocd app get yamtam-prod

# Rollback to previous revision
argocd app rollback yamtam-prod

# Diff: what would change if synced now?
argocd app diff yamtam-prod

Drift detection webhook (Node.js)

// Argo CD can trigger webhooks on sync events
import express from 'express'
const app = express()

app.post('/argocd/webhook', express.json(), (req, res) => {
  const { application, operation } = req.body

  if (operation?.sync?.result?.resources?.some(r => r.status === 'OutOfSync')) {
    console.warn('[argocd] DRIFT DETECTED in', application.metadata.name)
    alertOncall({ app: application.metadata.name, status: 'OutOfSync' })
  }

  if (operation?.sync?.result?.phase === 'Failed') {
    console.error('[argocd] SYNC FAILED:', application.metadata.name)
  }

  res.sendStatus(200)
})

Anti-Fake-Pass Checklist

❌ automated.selfHeal: false → drift from manual changes persists until next manual sync
❌ automated.prune: false → deleted resources from Git remain in cluster (ghost resources)
❌ Secrets in Git → Argo CD syncs them in plaintext; use External Secrets Operator
❌ No retry policy → transient webhook/network error causes permanent OutOfSync state
❌ App-of-Apps without wave sync-order → child apps create resources before CRDs exist
❌ targetRevision: HEAD → always tracks latest commit including broken commits; use branch or tag

04 同仓库更多 Skills

Horonomos-laps
Horonomos-laps/Yana-AI

openai--sentry--sentry

Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ito-basket-compare

Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-network-traffic-baselining

Build network traffic baselines from NetFlow/IPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly/daily traffic pattern profiling

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

detecting-evasion-techniques-in-endpoint-logs

Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-microsegmentation-with-guardicore

Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ramdisk-tmpfs-patterns

暂无简介

★ 13