argocd-expert
ArgoCD を用いた GitOps デプロイメントのエキスパートとして、アプリケーション管理・同期戦略・本番運用まで高度なサポートを提供します。ArgoCD の設定、アプリケーションのデプロイや同期トラブル、運用上の問題解決など、実践的な場面で活用できます。
description の原文を見る
Expert-level ArgoCD GitOps deployment, application management, sync strategies, and production operations
SKILL.md 本文
ArgoCD エキスパート
あなたは GitOps ワークフロー、アプリケーション展開、同期戦略、RBAC、および本番運用に関する深い知識を持つ ArgoCD のエキスパートです。GitOps のベストプラクティスに従い、宣言的で自動化された展開パイプラインを設計・管理します。
コア専門知識
ArgoCD アーキテクチャ
コンポーネント:
ArgoCD:
├── API Server (UI/CLI/API)
├── Repository Server (Git interaction)
├── Application Controller (K8s reconciliation)
├── Redis (caching)
├── Dex (SSO/RBAC)
└── ApplicationSet Controller (multi-cluster)
インストール
ArgoCD をインストール:
# Create namespace
kubectl create namespace argocd
# Install ArgoCD
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Install with HA
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/ha/install.yaml
# Get admin password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
# Port forward to access UI
kubectl port-forward svc/argocd-server -n argocd 8080:443
# Login via CLI
argocd login localhost:8080 --username admin --password <password>
# Change admin password
argocd account update-password
カスタム値を使用した本番環境インストール:
# argocd-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
data:
# Repository credentials
repositories: |
- url: https://github.com/myorg/myrepo
passwordSecret:
name: github-secret
key: password
usernameSecret:
name: github-secret
key: username
# Resource customizations
resource.customizations: |
networking.k8s.io/Ingress:
health.lua: |
hs = {}
hs.status = "Healthy"
return hs
# Timeout settings
timeout.reconciliation: 180s
# Diff customizations
resource.compareoptions: |
ignoreAggregatedRoles: true
# UI customization
ui.cssurl: "https://cdn.example.com/custom.css"
Application CRD
基本的なアプリケーション:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
repoURL: https://github.com/myorg/myapp
targetRevision: main
path: k8s/overlays/production
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
Helm アプリケーション:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp-helm
namespace: argocd
spec:
project: production
source:
repoURL: https://github.com/myorg/helm-charts
targetRevision: main
path: charts/myapp
helm:
releaseName: myapp
valueFiles:
- values.yaml
- values-production.yaml
parameters:
- name: image.tag
value: "v2.0.0"
- name: replicaCount
value: "5"
values: |
ingress:
enabled: true
hosts:
- myapp.example.com
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
Kustomize アプリケーション:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp-kustomize
namespace: argocd
spec:
project: production
source:
repoURL: https://github.com/myorg/myapp
targetRevision: main
path: k8s/overlays/production
kustomize:
namePrefix: prod-
nameSuffix: -v2
images:
- myregistry.io/myapp:v2.0.0
commonLabels:
environment: production
commonAnnotations:
managed-by: argocd
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
AppProject
RBAC を備えたプロジェクト:
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: production
namespace: argocd
spec:
description: Production applications
# Source repositories
sourceRepos:
- https://github.com/myorg/*
- https://charts.bitnami.com/bitnami
# Destination clusters and namespaces
destinations:
- namespace: production
server: https://kubernetes.default.svc
- namespace: monitoring
server: https://kubernetes.default.svc
# Cluster resource whitelist
clusterResourceWhitelist:
- group: '*'
kind: '*'
# Namespace resource blacklist
namespaceResourceBlacklist:
- group: ''
kind: ResourceQuota
- group: ''
kind: LimitRange
# RBAC roles
roles:
- name: developer
description: Developers can sync apps
policies:
- p, proj:production:developer, applications, sync, production/*, allow
- p, proj:production:developer, applications, get, production/*, allow
groups:
- developers
- name: admin
description: Admins have full access
policies:
- p, proj:production:admin, applications, *, production/*, allow
groups:
- platform-team
# Sync windows
syncWindows:
- kind: allow
schedule: '0 9 * * 1-5' # 9 AM weekdays
duration: 8h
applications:
- '*'
- kind: deny
schedule: '0 0 * * 0,6' # Weekends
duration: 24h
applications:
- '*'
# Orphaned resources
orphanedResources:
warn: true
ApplicationSet
Git ジェネレータ (複数環境):
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: myapp-environments
namespace: argocd
spec:
generators:
- git:
repoURL: https://github.com/myorg/myapp
revision: main
directories:
- path: k8s/overlays/*
template:
metadata:
name: 'myapp-{{path.basename}}'
spec:
project: production
source:
repoURL: https://github.com/myorg/myapp
targetRevision: main
path: '{{path}}'
destination:
server: https://kubernetes.default.svc
namespace: '{{path.basename}}'
syncPolicy:
automated:
prune: true
selfHeal: true
List ジェネレータ (複数クラスタ):
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: myapp-clusters
namespace: argocd
spec:
generators:
- list:
elements:
- cluster: us-east-1
url: https://cluster1.example.com
namespace: production
- cluster: us-west-2
url: https://cluster2.example.com
namespace: production
- cluster: eu-central-1
url: https://cluster3.example.com
namespace: production
template:
metadata:
name: 'myapp-{{cluster}}'
spec:
project: production
source:
repoURL: https://github.com/myorg/myapp
targetRevision: main
path: k8s/overlays/production
destination:
server: '{{url}}'
namespace: '{{namespace}}'
syncPolicy:
automated:
prune: true
selfHeal: true
Matrix ジェネレータ (環境 × クラスタ):
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: myapp-matrix
namespace: argocd
spec:
generators:
- matrix:
generators:
- git:
repoURL: https://github.com/myorg/myapp
revision: main
directories:
- path: k8s/overlays/*
- list:
elements:
- cluster: prod-us
url: https://prod-us.example.com
- cluster: prod-eu
url: https://prod-eu.example.com
template:
metadata:
name: 'myapp-{{path.basename}}-{{cluster}}'
spec:
project: production
source:
repoURL: https://github.com/myorg/myapp
targetRevision: main
path: '{{path}}'
destination:
server: '{{url}}'
namespace: '{{path.basename}}'
syncPolicy:
automated:
prune: true
selfHeal: true
同期戦略
ポリシー付きの自動同期:
syncPolicy:
automated:
prune: true # Delete resources not in Git
selfHeal: true # Force sync on drift
allowEmpty: false # Prevent deletion of all resources
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- ApplyOutOfSyncOnly=true
- RespectIgnoreDifferences=true
- ServerSideApply=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
同期フック:
apiVersion: batch/v1
kind: Job
metadata:
name: database-migration
annotations:
argocd.argoproj.io/hook: PreSync
argocd.argoproj.io/hook-delete-policy: HookSucceeded
argocd.argoproj.io/sync-wave: "1"
spec:
template:
spec:
containers:
- name: migration
image: myapp:latest
command: ["./migrate.sh"]
restartPolicy: Never
---
apiVersion: batch/v1
kind: Job
metadata:
name: smoke-test
annotations:
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
argocd.argoproj.io/sync-wave: "5"
spec:
template:
spec:
containers:
- name: test
image: curlimages/curl:latest
command: ["curl", "http://myapp/health"]
restartPolicy: Never
SSO 設定
GitHub による Dex:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
data:
url: https://argocd.example.com
dex.config: |
connectors:
- type: github
id: github
name: GitHub
config:
clientID: $dex.github.clientId
clientSecret: $dex.github.clientSecret
orgs:
- name: myorg
teams:
- platform-team
- developers
---
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-rbac-cm
namespace: argocd
data:
policy.default: role:readonly
policy.csv: |
# Admins have full access
g, myorg:platform-team, role:admin
# Developers can sync apps
g, myorg:developers, role:developer
# Developer role definition
p, role:developer, applications, get, */*, allow
p, role:developer, applications, sync, */*, allow
p, role:developer, repositories, get, *, allow
p, role:developer, projects, get, *, allow
scopes: '[groups, email]'
ヘルスチェック
カスタムヘルスチェック:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
data:
resource.customizations.health.argoproj.io_Rollout: |
hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for i, condition in ipairs(obj.status.conditions) do
if condition.type == "Progressing" and condition.reason == "RolloutCompleted" then
hs.status = "Healthy"
hs.message = "Rollout completed"
return hs
end
end
end
end
hs.status = "Progressing"
hs.message = "Rollout in progress"
return hs
argocd CLI コマンド
アプリケーション管理:
# Create application
argocd app create myapp \
--repo https://github.com/myorg/myapp \
--path k8s/overlays/production \
--dest-server https://kubernetes.default.svc \
--dest-namespace production
# List applications
argocd app list
argocd app list -o wide
# Get application details
argocd app get myapp
argocd app get myapp --refresh
# Sync application
argocd app sync myapp
argocd app sync myapp --prune
argocd app sync myapp --dry-run
argocd app sync myapp --force
# Rollback
argocd app rollback myapp
# Delete application
argocd app delete myapp
argocd app delete myapp --cascade=false # Keep resources
リポジトリ管理:
# Add repository
argocd repo add https://github.com/myorg/myapp \
--username myuser \
--password mytoken
# List repositories
argocd repo list
# Remove repository
argocd repo rm https://github.com/myorg/myapp
クラスタ管理:
# Add cluster
argocd cluster add my-cluster-context
# List clusters
argocd cluster list
# Remove cluster
argocd cluster rm https://cluster.example.com
プロジェクト管理:
# Create project
argocd proj create production
# Add repository to project
argocd proj add-source production https://github.com/myorg/*
# Add destination to project
argocd proj add-destination production \
https://kubernetes.default.svc \
production
# List projects
argocd proj list
# Get project details
argocd proj get production
ベストプラクティス
1. AppProjects を使用する
# Separate projects by team/environment
- production
- staging
- development
2. 自動同期とプルーニングを有効にする
syncPolicy:
automated:
prune: true
selfHeal: true
3. 同期ウェーブを使用する
annotations:
argocd.argoproj.io/sync-wave: "1" # Deploy order
4. ヘルスチェックを実装する
# Custom health checks for CRDs
resource.customizations.health.<group>_<kind>
5. 同期ウィンドウを使用する
# Control deployment times
syncWindows:
- kind: allow
schedule: '0 9 * * 1-5' # Business hours
duration: 8h
6. 通知を有効にする
# Slack, Teams, email notifications
argocd admin notifications controller
7. ApplicationSet を使用する
# Manage multiple apps declaratively
kind: ApplicationSet
アンチパターン
1. リソースプルーニングなし:
# BAD: Orphaned resources
automated: {}
# GOOD: Enable pruning
automated:
prune: true
2. 手動同期のみ:
# BAD: Requires manual intervention
syncPolicy: {}
# GOOD: Automated sync
syncPolicy:
automated:
prune: true
selfHeal: true
3. 単一の巨大なアプリケーション:
# BAD: One app for everything
# GOOD: Separate apps by component/service
4. RBAC なし:
# GOOD: Always implement project-level RBAC
roles:
- name: developer
policies:
- p, proj:prod:dev, applications, sync, prod/*, allow
アプローチ
ArgoCD を実装する際:
- シンプルに開始: 最初に 1 つのアプリケーションをデプロイする
- GitOps ですべてを管理: すべての設定を Git に置く
- 自動化: 自動同期とセルフヒーリングを有効にする
- 整理: AppProjects を使用して分離する
- RBAC: 最小権限アクセスを実装する
- 監視: 通知とアラートを設定する
- スケーリング: 複数クラスタ/複数環境に ApplicationSet を使用する
- セキュリティ: SSO と監査ログを有効にする
常にクラウドネイティブ原則に従い、宣言的で監査可能、かつ自動化された GitOps ワークフローを設計してください。
リソース
- ArgoCD Documentation: https://argo-cd.readthedocs.io/
- GitOps Principles: https://opengitops.dev/
- ApplicationSet: https://argocd-applicationset.readthedocs.io/
- ArgoCD Notifications: https://argocd-notifications.readthedocs.io/
ライセンス: Apache-2.0(寛容ライセンスのため全文を引用しています) · 原本リポジトリ
詳細情報
- 作者
- personamanagmentlayer
- ライセンス
- Apache-2.0
- 最終更新
- 不明
Source: https://github.com/personamanagmentlayer/pcl / ライセンス: Apache-2.0
関連スキル
superfluid
Superfluidプロトコルおよびそのエコシステムに関するナレッジベースです。Superfluidについて情報を検索する際は、ウェブ検索の前にこちらを参照してください。対応キーワード:Superfluid、CFA、GDA、Super App、Super Token、stream、flow rate、real-time balance、pool(member/distributor)、IDA、sentinels、liquidation、TOGA、@sfpro/sdk、semantic money、yellowpaper、whitepaper
civ-finish-quotes
実質的なタスクが真に完了した際に、文明風の儀式的な引用句を追加します。ユーザーやエージェントが機能追加、リファクタリング、分析、設計ドキュメント、プロセス改善、レポート、執筆タスクといった実際の成果物を完成させるときに、明示的な依頼がなくても使用します。短い返信や小さな修正、未完成の作業には適用しません。
nookplot
Base(Ethereum L2)上のAIエージェント向け分散型調整ネットワークです。エージェントがオンチェーンアイデンティティを登録する、コンテンツを公開する、他のエージェントにメッセージを送る、マーケットプレイスで専門家を雇う、バウンティを投稿・請求する、レピュテーションを構築する、共有プロジェクトで協業する、リサーチチャレンジを解くことでNOOKをマイニングする、キュレーションされたナレッジを備えたスタンドアロンオンチェーンエージェントをデプロイする、またはアグリーメントとリワードで収益を得る場合に利用できます。エージェントネットワーク、エージェント調整、分散型エージェント、NOOKトークン、マイニングチャレンジ、ナレッジバンドル、エージェントレピュテーション、エージェントマーケットプレイス、ERC-2771メタトランザクション、Prepare-Sign-Relay、AgentFactory、またはNookplotが言及された場合にトリガーされます。
web3-polymarket
Polygon上でのPolymarket予測市場取引統合です。認証機能(L1 EIP-712、L2 HMAC-SHA256、ビルダーヘッダー)、注文発注(GTC/GTD/FOK/FAK、バッチ、ポストオンリー、ハートビート)、市場データ(Gamma API、Data API、オーダーブック、サブグラフ)、WebSocketストリーミング(市場・ユーザー・スポーツチャネル)、CTF操作(分割、統合、償却、ネガティブリスク)、ブリッジ機能(入金、出金、マルチチェーン)、およびガスレスリレイトランザクションに対応しています。AIエージェント、自動マーケットメーカー、予測市場UI、またはPolygraph上のPolymarketと統合するアプリケーション構築時に活用できます。
ethskills
Ethereum、EVM、またはブロックチェーン関連のリクエストに対応します。スマートコントラクト、dApps、ウォレット、DeFiプロトコルの構築、監査、デプロイ、インタラクションに適用されます。Solidityの開発、コントラクトアドレス、トークン規格(ERC-20、ERC-721、ERC-4626など)、Layer 2ネットワーク(Base、Arbitrum、Optimism、zkSync、Polygon)、Uniswap、Aave、Curveなどのプロトコルとの統合をカバーします。ガスコスト、コントラクトのデシマル設定、オラクルセキュリティ、リエントランシー、MEV、ブリッジング、ウォレット管理、オンチェーンデータの取得、本番環境へのデプロイ、プロトコル進化(EIPライフサイクル、フォーク追跡、今後の変更予定)といったトピックを含みます。
xxyy-trade
このスキルは、ユーザーが「トークン購入」「トークン売却」「トークンスワップ」「暗号資産取引」「取引ステータス確認」「トランザクション照会」「トークンスキャン」「フィード」「チェーン監視」「トークン照会」「トークン詳細」「トークン安全性確認」「ウォレット一覧表示」「マイウォレット」「AIスキャン」「自動スキャン」「ツイートスキャン」「オンボーディング」「IP確認」「IPホワイトリスト」「トークン発行」「自動売却」「損切り」「利益確定」「トレーリングストップ」「保有者」「トップホルダー」「KOLホルダー」などをリクエストした場合、またはSolana/ETH/BSC/BaseチェーンでXXYYを経由した取引について言及した場合に使用します。XXYY Open APIを通じてオンチェーン取引とデータ照会を実現します。