Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #4755

gitops-workflow

Skill này làm gì

Kỹ năng này giúp thiết lập một hệ thống gọi là GitOps để quản lý triển khai phần mềm trong môi trường Kubernetes. Nó tự động hóa việc cập nhật ứng dụng bằng cách dùng Git làm nguồn chân lý chính.

Khi nào nên dùng

  • ✓Khi thiết lập GitOps lần đầu trong một cụm Kubernetes.
  • ✓Khi tự động triển khai các phiên bản ứng dụng mới từ kho Git.
  • ✓Khi quản lý cách ứng dụng được cập nhật dần dần hoặc theo giai đoạn.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gitops-workflow/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thiết lập GitOps cho cụm Kubernetes của tôi bằng ArgoCD và tự động hóa triển khai ứng dụng từ kho GitHub 'my-repo'.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Hệ thống theo dõi một kho Git chứa cấu hình ứng dụng của bạn. Khi bạn cập nhật Git, hệ thống phát hiện thay đổi và tự động áp dụng các cập nhật lên cụm Kubernetes của bạn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

…

Câu hỏi thường gặp

GitOps là gì?

GitOps là cách quản lý hạ tầng và ứng dụng bằng Git. Mọi thứ được mô tả trong tệp (khai báo) và lưu trong Git, còn một agent trong môi trường của bạn tự động áp dụng các cấu hình này.

ArgoCD và Flux là gì?

ArgoCD và Flux là các công cụ phổ biến giúp triển khai GitOps. Chúng theo dõi kho Git và đảm bảo môi trường (như Kubernetes) khớp với những gì được định nghĩa trong Git.

Làm thế nào để quản lý secret (mật khẩu, khóa) với GitOps?

Điều quan trọng là không đưa secret trực tiếp vào Git. Các công cụ như 'External Secrets' hoặc 'Sealed Secrets' được dùng để mã hóa hoặc quản lý secret an toàn bên ngoài kho chính.

Chi tiết

Mô tả gốc của tác giả

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

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4755
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự