Token导航 LogoToken导航TokenDH.com
运维和基础设施需要联网github未标认证来源可访问clear审计异常

implementing-gitops实施 gitops

Agent Skill

implementing-gitops 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

485

周安装

20

GitHub Stars

350

下载量

158
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:implementing-gitops(实施 gitops)
来源仓库:https://github.com/ancoleman/ai-design-components
仓库路径:skills/implementing-gitops
安装命令:
npx skills add https://github.com/ancoleman/ai-design-components --skill implementing-gitops
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill implementing-gitops

简介

implementing-gitops 实施 GitOps 工作流程,支持 ArgoCD 与 Flux 两种部署模式。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中 Kubernetes 自动化交付与多集群管理。
  • 通过 npx skills add 命令从指定仓库安装,集成秘密管理与灾难恢复。
  • 需注意 Gen 代理信任中心安全审计失败警告与套接字权限问题。
  • 建议在生产环境使用前完成完整安全评估与回滚方案验证。

SKILL.md

GitOps Workflows

Implement GitOps continuous delivery for Kubernetes using declarative, pull-based deployment models where Git serves as the single source of truth for infrastructure and application configuration.

When to Use

Use GitOps workflows for:

  • Kubernetes Deployments: Automating application and infrastructure deployments to Kubernetes clusters
  • Multi-Cluster Management: Managing deployments across development, staging, production, and edge clusters
  • Continuous Delivery: Implementing pull-based CD pipelines with automated reconciliation
  • Drift Detection: Automatically detecting and correcting configuration drift from desired state
  • Audit Requirements: Maintaining complete audit trails via Git commits for compliance
  • Progressive Delivery: Implementing canary, blue-green, or rolling deployment strategies
  • Disaster Recovery: Enabling rapid cluster recovery with GitOps bootstrap processes

Trigger keywords: "deploy to Kubernetes", "ArgoCD setup", "Flux bootstrap", "GitOps pipeline", "environment promotion", "multi-cluster deployment", "automated reconciliation"

Core GitOps Principles

1. Git as Single Source of Truth

All system configuration stored in Git repositories. No manual kubectl apply or cluster modifications. Declarative manifests (YAML) for all Kubernetes resources, environment-specific overlays, infrastructure configuration, and application deployments.

2. Pull-Based Deployment

Operators running inside clusters pull changes from Git and apply them automatically. Benefits include no cluster credentials in CI/CD pipelines, support for air-gapped environments, self-healing through continuous reconciliation, and simplified CI/CD.

3. Automated Reconciliation

GitOps operators continuously compare actual cluster state with desired state in Git and reconcile differences through a continuous loop: watch Git, compare live state, apply differences, report status, repeat.

4. Declarative Configuration

Use declarative Kubernetes manifests (not imperative scripts) to define desired state.

Tool Selection

ArgoCD vs Flux

Decision FactorChoose ArgoCDChoose Flux
Team PreferenceVisual management with web UICLI/API-first workflows
Learning CurveEasier onboarding with UISteeper but more flexible
ArchitectureMonolithic, stateful controllerModular, stateless controllers
Multi-TenancyBuilt-in RBAC and projectsKubernetes-native RBAC
Resource UsageHigher (includes UI components)Lower (minimal controllers)
Best ForTransitioning to GitOpsPlatform engineering

Hybrid Approach: Some teams use Flux for infrastructure and ArgoCD for applications.

For ArgoCD implementation patterns, see references/argocd-patterns.md For Flux implementation patterns, see references/flux-patterns.md For Kustomize overlay patterns, see references/kustomize-overlays.md

Quick Start

ArgoCD Installation

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Basic Application:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: myapp
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/org/repo.git
    targetRevision: HEAD
    path: k8s/overlays/prod
  destination:
    server: https://kubernetes.default.svc
    namespace: myapp
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

Flux Bootstrap

flux bootstrap github \
  --owner=myorg \
  --repository=fleet-infra \
  --branch=main \
  --path=clusters/production

Basic Kustomization:

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: myapp
  namespace: flux-system
spec:
  interval: 10m
  path: "./k8s/prod"
  prune: true
  sourceRef:
    kind: GitRepository
    name: myapp

For complete examples, see examples/argocd/ and examples/flux/

Environment Promotion

Branch-Based Strategy: dev branch → staging branch → main branch (prod) Kustomize-Based Strategy: k8s/base/ → k8s/overlays/{dev,staging,prod}/

Promotion Process:

  1. Merge code changes to main branch
  2. CI builds container image with tag
  3. Update image tag in environment overlay (Git commit)
  4. GitOps operator detects change and deploys
  5. Test in environment
  6. Promote to next environment by updating Git

For multi-environment ApplicationSet patterns, see references/argocd-patterns.md

Multi-Cluster Management

ArgoCD: Register external clusters with argocd CLI, use ApplicationSets to generate Applications per cluster, manage from single ArgoCD instance.

Flux: Bootstrap Flux per cluster, use same Git repo with cluster-specific paths, configure remote clusters via kubeConfig secrets.

For detailed multi-cluster patterns, see references/multi-cluster.md

Progressive Delivery

Canary Deployments: Gradually shift traffic to new version, monitor metrics during rollout, automated rollback on failures.

Blue-Green Deployments: Deploy new version alongside old, switch traffic atomically, instant rollback if issues detected.

ArgoCD: Use Argo Rollouts for progressive delivery Flux: Integrate Flagger for automated canary analysis

For progressive delivery strategies and Argo Rollouts examples, see references/progressive-delivery.md

Secret Management

GitOps requires storing configuration in Git, but secrets must be protected.

ToolApproachSecurityComplexity
Sealed SecretsEncrypt secrets for GitMediumLow
SOPSEncrypt files with KMSHighMedium
External SecretsReference external vaultsHighMedium
HashiCorp VaultCentral secret managementVery HighHigh

For secret management integration patterns, see references/secret-management.md

Drift Detection and Remediation

GitOps operators continuously monitor for drift between Git (desired state) and cluster (actual state).

ArgoCD Automatic Self-Healing:

syncPolicy:
  automated:
    prune: true      # Remove resources not in Git
    selfHeal: true   # Revert manual changes

Flux Automatic Reconciliation:

spec:
  interval: 10m    # Check every 10 minutes
  prune: true      # Remove resources not in Git
  force: true      # Force apply on conflicts

Manual Operations:

# ArgoCD
argocd app get myapp           # View sync status
argocd app diff myapp          # Show differences
argocd app sync myapp          # Manually trigger sync

# Flux
flux get kustomizations              # View sync status
flux reconcile kustomization myapp   # Force immediate sync

For drift detection strategies and troubleshooting, see references/drift-remediation.md

Sync Hooks and Lifecycle

Execute operations before/after syncs using hooks.

PreSync Hook (Database Migration):

apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded

PostSync Hook (Smoke Test):

apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    argocd.argoproj.io/hook: PostSync

For complete sync hook examples, see examples/argocd/sync-hooks.yaml

Monitoring and Observability

Key Metrics

  • Sync Status: OutOfSync, Synced, Unknown
  • Sync Frequency: How often reconciliation occurs
  • Drift Detection: Time to detect configuration drift
  • Sync Duration: Time to apply changes
  • Failure Rate: Failed syncs and causes

ArgoCD Metrics: Exposed at /metrics endpoint (argocd_app_sync_total, argocd_app_info) Flux Metrics: From controllers (gotk_reconcile_condition, gotk_reconcile_duration_seconds)

Troubleshooting

Common Issues

Sync Stuck/OutOfSync:

  • Check Git repository accessibility
  • Verify manifests are valid YAML
  • Review sync logs for errors
  • Check resource finalizers

Self-Heal Not Working:

  • Verify selfHeal enabled in syncPolicy
  • Check operator has write permissions
  • Review resource ownership labels

Secrets Not Decrypting:

  • Verify SOPS/ESO controllers installed
  • Check KMS/Vault credentials
  • Review encryption key configuration

CLI Quick Reference

ArgoCD Commands

argocd app create <name>          # Create application
argocd app get <name>              # View status
argocd app sync <name>             # Trigger sync
argocd app diff <name>             # Show drift
argocd app list                    # List all applications

Flux Commands

flux create source git <name>      # Create Git source
flux create kustomization <name>   # Create kustomization
flux get all                       # View all resources
flux reconcile <kind> <name>       # Force reconciliation
flux logs                          # View controller logs

Kustomize Commands

kustomize build k8s/overlays/prod  # Preview generated YAML
kubectl apply -k k8s/overlays/prod # Apply directly
kubectl diff -k k8s/overlays/prod  # Show differences

Installation Scripts

Use the provided installation scripts for quick setup:

# Install ArgoCD
./scripts/install-argocd.sh

# Bootstrap Flux
export GITHUB_TOKEN=<token>
export GITHUB_OWNER=<org>
export GITHUB_REPO=fleet-infra
./scripts/install-flux.sh

# Check for drift
./scripts/check-drift.sh

# Promote environment
./scripts/promote-env.sh dev staging

Example Files

Complete working examples provided in examples/ directory:

ArgoCD Examples:

  • examples/argocd/application.yaml - Basic Application
  • examples/argocd/applicationset.yaml - Multi-environment ApplicationSet
  • examples/argocd/progressive-rollout.yaml - Progressive rollout strategy
  • examples/argocd/sync-hooks.yaml - PreSync/PostSync hooks

Flux Examples:

  • examples/flux/gitrepository.yaml - Git source configuration
  • examples/flux/kustomization.yaml - Kustomization controller
  • examples/flux/helmrelease.yaml - Helm release management
  • examples/flux/ocirepository.yaml - OCI artifact source

Kustomize Examples:

  • examples/kustomize/base/ - Base configuration
  • examples/kustomize/overlays/{dev,staging,prod}/ - Environment overlays

Rollout Examples:

  • examples/rollouts/canary.yaml - Canary deployment with Argo Rollouts
  • examples/rollouts/blue-green.yaml - Blue-green deployment strategy

Related Skills

  • kubernetes-operations: Kubernetes fundamentals and resource management
  • infrastructure-as-code: Provisioning clusters that GitOps deploys to
  • building-ci-pipelines: CI builds images, GitOps deploys them
  • secret-management: Vault/ESO integration with GitOps
  • deploying-applications: GitOps as the deployment mechanism

Summary

GitOps provides automated, declarative continuous delivery for Kubernetes with Git as the single source of truth. Choose ArgoCD for UI-driven workflows or Flux for CLI/API-first approaches. Implement automated reconciliation, drift detection, and progressive delivery for reliable deployments at scale. Integrate secret management, multi-cluster orchestration, and disaster recovery for production-grade GitOps workflows.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

30.51%
按下载量换算48

Gemini CLI

22.65%
按下载量换算36

Antigravity

16.93%
按下载量换算27

Claude Code

11.84%
按下载量换算19

roo

6.85%
按下载量换算11

Cursor

3.25%
按下载量换算5

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills