ArgoCD GitOps Platform
Introductie
ArgoCD implementeert GitOps principes voor Kubernetes deployment management. Deze documentatie beschrijft de configuratie en het gebruik van ArgoCD binnen de organisatie.
Core Functionaliteit
ArgoCD biedt de volgende kernfunctionaliteiten:
- Declaratieve, versiebeheerde applicatie deployment
- Automatische synchronisatie van Git repositories
- Rollback mogelijkheden
- RBAC integratie
- Multi-cluster ondersteuning
Configuratie
1. Applicatie Definitie
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: example-app
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/organisatie/repository.git
targetRevision: HEAD
path: kubernetes/
destination:
server: https://kubernetes.default.svc
namespace: example
syncPolicy:
automated:
prune: true
selfHeal: true
2. Project Configuratie
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: example-project
namespace: argocd
spec:
description: Voorbeeld project configuratie
sourceRepos:
- https://github.com/organisatie/*
destinations:
- namespace: example
server: https://kubernetes.default.svc
clusterResourceWhitelist:
- group: '*'
kind: '*'
Deployment Workflow
1. Applicatie Deployment
# Applicatie aanmaken
kubectl apply -f application.yaml
# Status verificatie
argocd app get example-app
# Handmatige synchronisatie
argocd app sync example-app
2. Monitoring
# Applicatie status
argocd app list
# Gedetailleerde informatie
argocd app resources example-app
Best Practices
1. Repository Structuur
repository/
├── base/ # Basis manifesten
│ ├── deployment.yaml
│ ├── service.yaml
│ └── kustomization.yaml
└── overlays/ # Omgevingsspecifieke configuraties
├── development/
│ └── kustomization.yaml
└── production/
└── kustomization.yaml
2. Deployment Strategie
- Implementeer progressive delivery met canary deployments
- Configureer automatische rollbacks bij fouten
- Definieer health checks voor applicaties
3. Security
- Implementeer RBAC voor toegangscontrole
- Gebruik SSH keys voor repository authenticatie
- Configureer network policies
Troubleshooting
1. Synchronisatie Issues
# Synchronisatie status controleren
argocd app get example-app
# Gedetailleerde logs bekijken
argocd app logs example-app
# Diff weergeven
argocd app diff example-app
2. Common Issues
| Issue | Oplossing |
|---|---|
| Out of sync | Controleer Git repository status |
| ImagePullBackOff | Verifieer image repository toegang |
| Health degraded | Controleer applicatie logs |
Monitoring & Alerting
1. Prometheus Integratie
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: argocd-metrics
namespace: monitoring
spec:
selector:
matchLabels:
app.kubernetes.io/name: argocd-metrics
endpoints:
- port: metrics
2. Alerting Configuratie
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: argocd-alerts
spec:
groups:
- name: argocd
rules:
- alert: ArgoCDSyncFailed
expr: argocd_app_sync_status{status="Failed"} > 0
for: 5m
labels:
severity: critical
Next Steps
- Learn about Helm Charts for package management
- Dive deeper into Platform Management
- Explore Monitoring for system observability