本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)48k · #4755

gitops-workflow

できること

このスキルは、GitOpsと呼ばれる仕組みを設定し、Kubernetes環境でのソフトウェアのデプロイを管理するのに役立ちます。Gitを信頼できる唯一の情報源として使い、アプリケーションの更新を自動化します。

使う場面

  • ✓初めてKubernetesクラスターにGitOpsを設定するとき。
  • ✓Gitリポジトリから新しいアプリケーションのバージョンを自動でデプロイしたいとき。
  • ✓アプリケーションを段階的に、またはフェーズごとに更新する方法を管理したいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gitops-workflow/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gitops-workflow/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ArgoCDを使って、Kubernetesクラスターに GitOps を設定し、GitHubのリポジトリ「my-repo」からアプリケーションのデプロイを自動化してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このシステムは、アプリケーションの設定ファイルを保管しているGitリポジトリを監視します。Gitの内容を更新すると、システムがその変更を検知し、Kubernetesクラスターに自動で反映します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

GitOps Workflow

Complete guide to implementing GitOps workflows with ArgoCD and Flux for automated Kubernetes deployments.

Purpose

Implement declarative, Git-based continuous delivery for Kubernetes using ArgoCD or Flux CD, following OpenGitOps principles.

Use this skill when

  • Set up GitOps for Kubernetes clusters
  • Automate application deployments from Git
  • Implement progressive delivery strategies
  • Manage multi-cluster deployments
  • Configure automated sync policies
  • Set up secret management in GitOps

Do not use this skill when

  • You need a one-off manual deployment
  • You cannot manage cluster access or repo permissions
  • You are not deploying to Kubernetes

Instructions

  1. Define repo layout and desired-state conventions.
  2. Install ArgoCD or Flux and connect clusters.
  3. Configure sync policies, environments, and promotion flow.
  4. Validate rollbacks and secret handling.

Safety

  • Avoid auto-sync to production without approvals.
  • Keep secrets out of Git and use sealed or external secret managers.

OpenGitOps Principles

  1. Declarative - Entire system described declaratively
  2. Versioned and Immutable - Desired state stored in Git
  3. Pulled Automatically - Software agents pull desired state
  4. Continuously Reconciled - Agents reconcile actual vs desired state

ArgoCD Setup

1. Installation

# Create namespace
kubectl create namespace argocd

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

# Get admin password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

Reference: See references/argocd-setup.md for detailed setup

2. Repository Structure

gitops-repo/
├── apps/
│   ├── production/
│   │   ├── app1/
│   │   │   ├── kustomization.yaml
│   │   │   └── deployment.yaml
│   │   └── app2/
│   └── staging/
├── infrastructure/
│   ├── ingress-nginx/
│   ├── cert-manager/
│   └── monitoring/
└── argocd/
    ├── applications/
    └── projects/

3. Create Application

# argocd/applications/my-app.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/org/gitops-repo
    targetRevision: main
    path: apps/production/my-app
  destination:
    server: https://kubernetes.default.svc
    namespace: production
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true

4. App of Apps Pattern

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: applications
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/org/gitops-repo
    targetRevision: main
    path: argocd/applications
  destination:
    server: https://kubernetes.default.svc
    namespace: argocd
  syncPolicy:
    automated: {}

Flux CD Setup

1. Installation

# Install Flux CLI
brew install fluxcd/tap/flux

# Alternative: download the official installer, inspect it, then execute it
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSLo "$tmpdir/flux-install.sh" https://fluxcd.io/install.sh
cat "$tmpdir/flux-install.sh"  # review the full installer before sudo
sudo bash "$tmpdir/flux-install.sh"

# Bootstrap Flux
flux bootstrap github \
  --owner=org \
  --repository=gitops-repo \
  --branch=main \
  --path=clusters/production \
  --personal

2. Create GitRepository

apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: my-app
  namespace: flux-system
spec:
  interval: 1m
  url: https://github.com/org/my-app
  ref:
    branch: main

3. Create Kustomization

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: my-app
  namespace: flux-system
spec:
  interval: 5m
  path: ./deploy
  prune: true
  sourceRef:
    kind: GitRepository
    name: my-app

Sync Policies

Auto-Sync Configuration

ArgoCD:

syncPolicy:
  automated:
    prune: true      # Delete resources not in Git
    selfHeal: true   # Reconcile manual changes
    allowEmpty: false
  retry:
    limit: 5
    backoff:
      duration: 5s
      factor: 2
      maxDuration: 3m

Flux:

spec:
  interval: 1m
  prune: true
  wait: true
  timeout: 5m

Reference: See references/sync-policies.md

…

よくある質問

GitOpsとは何ですか?

GitOpsは、Gitを使ってインフラとアプリケーションを管理する方法です。すべてをファイルで宣言的に記述してGitに保存し、実行環境にあるエージェントがその設定を自動で適用します。

ArgoCDやFluxとは何ですか?

ArgoCDとFluxは、GitOpsの実現を支援する代表的なツールです。Gitリポジトリを監視し、Kubernetesなどの環境がGitに定義された内容と一致するようにします。

GitOpsでシークレット(パスワードや鍵)をどのように管理しますか?

シークレットをGitに直接入れないことが非常に重要です。「External Secrets」や「Sealed Secrets」などのツールを使い、メインのリポジトリの外で暗号化または安全に管理します。

詳細

作者による元の説明

Complete guide to implementing GitOps workflows with ArgoCD and Flux for automated Kubernetes deployments.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4755
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル