ワンクリックで
gitops
GitOps fundamentals, Flux/ArgoCD workflows, desired-state reconciliation, multi-cluster topology, and secrets management patterns
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
GitOps fundamentals, Flux/ArgoCD workflows, desired-state reconciliation, multi-cluster topology, and secrets management patterns
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when designing Copilot agents, authoring agent definitions, creating skill folders, or scaffolding instruction files. Provides templates and conventions for the agent ecosystem.
Use when designing, reviewing, or evolving API contracts. Provides OpenAPI templates, breaking-change checklists, versioning decision trees, and governance checklists.
API authentication, authorization, input validation, rate limiting, and protection patterns
Scan legacy applications to discover project structure, NuGet/npm dependencies, database connection strings, external service bindings, framework versions, and migration complexity scores. Produces structured JSON, YAML, or Markdown inventory reports.
Use when designing systems, recording architecture decisions, evaluating technologies, or assessing architectural risks. Provides C4 diagram templates, ADR format, technology selection matrices, and risk registers.
Deploy, scale, and manage containerized applications on Azure Container Apps with Dapr, revision management, and advanced networking
| name | gitops |
| description | GitOps fundamentals, Flux/ArgoCD workflows, desired-state reconciliation, multi-cluster topology, and secrets management patterns |
| compatibility | Requires kubectl and Git. Works with VS Code, CLI, and Copilot Coding Agent. |
| metadata | {"category":"infrastructure","keywords":"gitops, flux, argocd, kubernetes, desired-state, declarative","model-tier":"premium"} |
| allowed-tools | search/codebase bash kubectl |
GitOps is a set of practices that use Git as the single source of truth for declaring the desired state of infrastructure and applications.
Application Developer
↓
Commits manifests to Git (infrastructure-repo/)
↓
Git webhook triggers GitOps Operator (Flux/ArgoCD)
↓
Operator pulls manifests from Git
↓
Operator applies to Kubernetes (kubectl apply)
↓
Operator continuously monitors:
- Is actual state == desired state?
- If not, auto-correct (reconcile)
Flux automatically pulls manifests from Git and applies them to the cluster.
# Install Flux operator on cluster
flux install --namespace=flux-system
# Bootstrap: configure Flux to manage itself
flux bootstrap github \
--owner=my-org \
--repository=flux-config \
--branch=main \
--path=./clusters/prod \
--personal
flux-config/
├── clusters/
│ ├── prod/
│ │ ├── flux-system/ # Flux operator config
│ │ ├── apps.yaml # Application refs
│ │ └── infrastructure.yaml # Infrastructure refs
│ └── staging/
└── apps/
├── backend/
│ ├── kustomization.yaml
│ └── deployment.yaml
└── frontend/
├── kustomization.yaml
└── deployment.yaml
File: clusters/prod/apps.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
name: backend-app
namespace: flux-system
spec:
interval: 5m
sourceRef:
kind: GitRepository
name: flux-config
path: ./apps/backend
postBuild:
substitute:
env: prod
image_tag: v1.2.3
Promote changes from staging → prod via Git PR:
1. Developer commits to staging branch
2. Flux deploys to staging cluster
3. QA tests in staging
4. Developer creates PR: staging → prod
5. Approver merges PR
6. Flux detects change, deploys to prod
File: clusters/prod/backend-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
namespace: default
spec:
replicas: 3
template:
spec:
containers:
- name: backend
image: my-registry/backend:v1.2.3 # Tag from Git, pulled by Flux
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
ArgoCD provides a web UI for GitOps workflows and multi-cluster management.
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Access web UI
kubectl port-forward -n argocd svc/argocd-server 8080:443
# Browse: https://localhost:8080
# Default user: admin
# Password: kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
File: argocd-apps/backend.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: backend
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/my-org/app-config
targetRevision: main
path: apps/backend
destination:
server: https://kubernetes.default.svc # Local cluster
namespace: default
syncPolicy:
automated:
prune: true # Delete resources not in Git
selfHeal: true # Auto-sync on cluster drift
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: backend-prod-us
namespace: argocd
spec:
source:
repoURL: https://github.com/my-org/app-config
targetRevision: main
path: apps/backend
destination:
server: https://prod-us-cluster-api:6443 # US region
namespace: default
syncPolicy:
automated:
prune: true
selfHeal: true
Repeat for each cluster/region:
prod-us, prod-eu, staging-us, staging-eu, ...
Never commit secrets to Git! Use one of:
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
name: azure-keyvault
spec:
provider:
azurekv:
authSecretRef:
clientID:
name: azure-credentials
key: client-id
tenantID: 12345678-1234-1234-1234-123456789012
vaultURL: https://my-vault.vault.azure.net
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: app-secrets
spec:
secretStoreRef:
name: azure-keyvault
kind: SecretStore
target:
name: app-secrets
creationPolicy: Owner
data:
- secretKey: db-password
remoteRef:
key: db-password
# Install sealed-secrets controller
kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.x.x/controller.yaml
# Create secret on cluster, then seal for Git
echo -n mypassword | kubectl create secret generic app-secrets --dry-run=client --from-file=password=/dev/stdin -o yaml | kubeseal -f - > sealed-secret.yaml
# Commit sealed-secret.yaml to Git
# Controller automatically unseals when applied to cluster
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: block-unencrypted-secrets
spec:
validationFailureAction: audit
rules:
- name: check-secret-not-in-plaintext
match:
resources:
kinds:
- Secret
validate:
message: "Secrets must be sealed or external"
pattern:
kind: Secret
metadata:
labels:
sealed: "true" # Only allow sealed secrets
GitOps operators continuously compare actual cluster state with desired state in Git:
Every 30 seconds (configurable):
1. Read desired state from Git
2. Read actual state from cluster
3. Calculate diff
4. If diff exists, reconcile (kubectl apply)
5. Report status
# Watch Flux reconciliation status
flux get kustomizations --watch
# Watch ArgoCD application sync status
argocd app list
argocd app get my-app --refresh
# View recent operations
flux logs --follow
| Scenario | Cause | Resolution |
|---|---|---|
Manual kubectl apply in prod | Operator forgot to commit | Revert, commit to Git, let Flux reconcile |
| Cluster autoscaler scaled pod | Pod resource limits too high | Update limits in Git, reapply |
| Image tag changed | CI/CD pushed new tag without Git update | Update tag in Git, reconcile |
Central hub cluster runs GitOps controller; spoke clusters are managed targets:
┌─ Spoke-US (prod-us)
├─ Spoke-EU (prod-eu)
Hub Cluster ─┤
(ArgoCD Server) ├─ Spoke-Staging (staging)
└─ Spoke-DR (disaster recovery)
# Register spoke cluster
argocd cluster add my-spoke-us --name prod-us
argocd cluster list
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: backend-prod-us
spec:
destination:
server: https://prod-us-api:6443 # Spoke cluster API
namespace: default
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: backend-prod-eu
spec:
destination:
server: https://prod-eu-api:6443 # Spoke cluster API
namespace: default
kubectl apply commandslatest tags